A court in Egypt has sentenced eight men to three years in prison for appearing in a video alleged to show a gay marriage.

All eight had denied charges of inciting debauchery and offending public morality.

The video, which was posted to YouTube in September, shows two men exchanging rings on a boat in the Nile.

Though homosexuality is legal in Egypt, it remains a taboo. Police raids on gay venues have risen in recent months.

The sentence was met with uproar from the families of the defendants, the Reuters news agency reported.

The BBC's Middle East editor Sebastian Usher says Islamists had led the chorus of outrage against the video, saying that it proved moral standards had dropped since Islamist President Mohammed Morsi was removed from power last year.

The authorities that replaced the Islamists, led by current president Abdul Fattah al-Sisi, may want to prove to Egyptians that they can be just as conservative on social issues, our correspondent adds.