A police inspector has admitted making and distributing more than 300 indecent images of children, including a boy aged just six.
A court heard Lee Bartram also filmed a teenager who was sunbathing - after West Midlands Police opted to release the 44-year-old officer on bail.
Bartram, whose address was withheld by the court over terrorism fears, pleaded guilty to five counts of making indecent images of a child and two counts of distributing similar images.
The charges, spanning a period between August 2013 and the same month of this year, relate to a total of 328 images, including some found on an iPad and an iPhone.
Opening the facts of the case at Walsall Magistrates' Court, prosecutor Mark Cooper said some of the films made by Bartram had a "commentary" from the officer "as to what he would like to do" with the children.
On one of the films, Bartram was recorded "blaming the parents" of a child because of the way the youngster was dressed.
Mr Cooper added that although Bartram, who worked as an inspector in Birmingham city centre, had breached his bail, the evidence showed he had not acted upon his "fantasies" in the virtual world.
Bartram, wearing jeans and a T-shirt, sat with his head bowed and his hands over his face throughout much of Thursday's hearing.
His lawyer disputed the Crown's claim that the video of a 15-year-old boy sunbathing had been made after his arrest, saying it was made last year.
But the prosecution submitted that Bartram is at risk of suicide and poses a threat of committing further offences.
Remanding Bartram in custody after rejecting an application for bail, District Judge Graham Wilkinson told the disgraced officer: "You will know better than most that when dealing with bail I take the Crown's case at its strongest.
"It is the Crown's case that the videoing happened while you were subject to police bail.
"Whilst on bail you have continued to show an interest in under-age children for sexual gratification. I have no option but to remand you in custody."
The magistrate directed that Bartram should be treated as the "most vulnerable" class of inmate whilst in prison custody.
The district judge ordered that Bartram's address should not be published as it could lead to him or his family being "targeted by terrorists for the most serious acts of violence".
West Midlands Police Assistant Chief Constable Gareth Cann submitted a letter to the court asking the judge to take into consideration the current "severe" terror threat rating.
Mr Cann's letter stated: "Should you feel able to direct that an address can be withheld, taking into account all the circumstances of the case before you, then you would be making a valuable contribution to mitigating the current threat we face."
Bartram will be sentenced at Wolverhampton Crown Court on September 13.