News organisations must hand over to police all footage from rioting in east Belfast last month, a judge has ruled.
Judge Tom Burgess decided the public interest in convicting those responsible outweighed the perceived danger for media representatives.
A photographer was shot in the leg during the two nights of trouble in the lower Newtownards Road area.
During the PSNI application it emerged that another journalist had narrowly escaped being shot.
Judge Burgess, the Recorder for Belfast, noted the "great fortune" of a television cameraman whose trousers had bullet holes in both legs.
Lawyers for the police argued the untelevised footage would contain information of substantial value in identifying those allegedly involved in attempted murder, grievous bodily harm with intent, and rioting.
But the news organisations' legal representatives contended the application was premature and a type of fishing expedition.
Arguments were also advanced about the rights of members of the press to protection when gathering and broadcasting information on the riots.
Judge Burgess acknowledged it was a difficult case because shots had been fired and a journalist injured.
He said he was concerned to ensure that a court order does not potentially put any lives at risk.
"What happened was scandalous, undoubtedly extremely frightening and of the utmost concern to those present on this occasion," he said.
"But in the balancing exercise I am asked to consider, what weight to I place on the risk attached to handing over unbroadcast material, in circumstances where the 'risk' has been assessed by those who have that material as such as allowed for the broadcasting of some of the material."
Judge Burgess added that he had weighed the European Convention rights of the media organisations against the public interest in securing prosecutions.
He held that there was a high likelihood the footage would be of substantial value to their apprehension.
He concluded: "The interests of the public in the disclosure of this material must take precedence."
The footage which is to be released must only be used for the prosecution of offences listed in the case and returned to the organisations once finished with.