Cairo (CNN) Two men exchange rings and hug in celebration aboard a Nile boat, as ululations fill the air and a traditional engagement song plays in the background.

But within days, their celebration has turned to shock and sadness: after a video of the "gay wedding" spread across Egyptian social media, the men were arrested and eventually sentenced to three years in prison for distributing pornographic material.

Homosexuality is not mentioned in the Egyptian penal code, and technically it is not illegal, but members of the LGBT community are often arrested and charged with pornography, prostitution or debauchery.

At least 20 homosexual and transgender persons were convicted of debauchery and other charges in 2014, which human rights activists say has been the worst year for the community in recent memory.

Fear of arrest and social stigma force the majority of the LGBT community to conceal their identity and sexual orientation.

"You have to be aware of everything you're doing; your clothes, your reactions toward people," Nour told CNN. He has asked us not to use his real name to protect his identity.

Both dominant religions in Egypt, Islam and Christianity, prohibit homosexuality. Rather than the literal translation, the word usually used for homosexuality in Arabic is "shezoz", meaning "abnormality."

This category is wide enough to lump together homosexuals and transgender people as one, in both media reports and court cases.

A video posted on a popular news portal last May showed five people after their arrest at a residential apartment; their faces, like their bodies, barely covered. Two weeks later, they were sentenced to 12, seven and four years in prison. Among the charges they faced was that of using the internet to spread debauchery.

"The police would make the defendants go through their contacts and the pictures they post on [dating apps and social media] to use them as evidence against them and get information on others," says Dalia Abd Elhameed, gender and women's rights officer at the Egyptian Initiative for Personal Rights.

Earlier this year, a group of rights activists reached out to gay dating websites urging them to issue safety warnings to their Egyptian users.

Grindr, a gay dating application, warned their Egyptian users that "police may be posing as LGBT on social media to entrap you." In September, Grindr announced that locations would be hidden by default for users in countries such as Egypt, Saudi Arabia and Russia, which have a history of prosecuting those from the LGBT community.

"I'm always afraid if I meet someone and he is from the government then I'll get arrested like other people," Nour said.

Such fears encompass both the humiliation of having one's identity revealed, and the prospect of coming face-to-face with an unclear judicial procedure.

The verdicts in such court cases, Abd Elhameed said, were often illogical.

"Take the [wedding] case for example: The judge cleared them of the debauchery charges, yet he sentenced them to three years for filming and distributing pornographic material, even though he ruled that there was no debauchery involved."

A forensic report from the court found that the men hadn't engaged in homosexual intercourse.

"I think the police will not treat them as humans. This is a very big problem in Egypt," said psychiatrist Dr. Wa'el Abu Hendy. He says he supports gay rights, but he also has another view: "My thought about this is that this is something that can be changed, can be corrected," says Abu Hendy. "Of course there are those who cannot be cured but we have had many successes with the treatment."

That view is widely discredited by leading physiological experts in the West. In 2009, the American Psychological Association (APA) recommended that specialists avoid telling clients that sexual orientation is changeable through therapy or other forms of treatment. It warned of "the potential for harm," stressing the lack of proof that such types of therapy can lead to a permanent change in sexual orientation.

The APA called into question Hendy's practices.

"Contrary to claims of sexual orientation change advocates and practitioners, there is insufficient evidence to support the use of psychological interventions to change sexual orientation," said Judith M. Glassgold, chair of the task force that created the APA report.

Abu Hendy claims those expert findings are the result of pressure from the LGBT lobby.

But Nour said such "change" attempts were nonsense. "My father took me to a psychiatrist once and he gave me this medical thing that actually makes you stop having any sexual feelings but doesn't cure you. Know what I mean? So it's bulls***."

In the majority of Egypt's film productions over the decades, homosexuals are stereotypically portrayed as overtly flamboyant and part of criminal or prostitution rings.

"Family Secrets", a film released earlier this year, was ground-breaking in having a gay protagonist. The film faced problems with the censors and was criticized when it began showing in Egyptian cinemas.

The stigma and lack of recognition even extends into the human rights sphere, one activist told CNN, explaining that some safety guidelines and advocacy work are done anonymously, not only due to social rejection but also because of a largely unwelcoming community.

"What needs to happen is there needs to be an official voice for gay people in Egypt," Ahmed -- not his real name -- told CNN.

In private, more homosexual men and women are coming out to their families in Egypt to varying reactions, Nour said. But in the public sphere, the situation is more precarious.

LGBT activists say they find their work more difficult than their human rights counterparts in other fields, who are already bracing for a potential government crackdown on civil society, particularly organizations working on human rights.

The activists themselves run a "double risk" both because of their choice of field and by exposing their identity as members of the LGBT community, says Abd Elhameed.

The "Solidarity with Egypt LGBT" campaign was launched earlier this year, but an online petition against the imprisonment of homosexuals in Egypt received just 216 signatures in six months.

Ahmed would like to see an organization, recognized by the government, to advocate on the behalf of the LGBT community. He believes this would greatly improve their situation. But with the Ministry of Religious endowment -- an influential government agency-- condemning homosexuality, many see little prospect for change.

"There is no room for dialogue, that is my problem with Egypt. It is like, I want you to ask me about it and I will tell you and maybe you'll understand," he says.

Until that time comes, Egypt's gays and lesbians will remain in the shadows.

"Hypothetically, there could be an uprising. But the whole country would back the mass killings of homosexuals; the whole country would sweep it under the rug, they would be behind the violence, that's the problem," Ahmed said.

"You can't fight the government when you don't have anything to fight the government with."