Police found the footage on electronic devices after they arrested Malcolm Luskshields at his workplace in Leeds.
Leeds Crown Court heard how the 40-year-old was also found to have accessed sickening child porn images.
David Hall, prosecuting, said West Yorkshire Police officers executed a search warrant at Luskshields' home on Harley Drive, Swinnow, in July 2019.
No one was at home at the time but officers forced their way into the property.
Luskshields was traced to his workplace at a nearby Tesco supermarket where he was arrested later the same day.
Electronic devices belonging to the defendant were seized.
They were analysed and 27 indecent images of children were recovered from them.
Mr Hall said 17 of the images were at category A - the most serious level of offending.
The images featured girls aged between four and 14 years of age being sexually abused.
The images were stored on a password-protected app.
Officers also found secret camera footage of a teenage girl in a bedroom.
Enquiries revealed Luskshields had set up the camera without the victim knowing and it could be accessed remotely from his mobile phone.
Nine videos of the girl were recovered and included footage of her changing her clothing and underwear.
Luskshields pleaded guilty to voyeurism and three counts of possessing indecent images of children.
He has one previous conviction for drink driving.
Richard Reed, mitigating, said Luskshields had been open about his offending from an early stage and recognised he needed help to address his behaviour.
Mr Reed said his client continued to receive the support of his wife and family.
Luskshields was given a 16-month prison sentence, suspended for two years.
He was also ordered to complete a 40-day rehabilitation activity requirement.
Describing the voyeurism offence, Judge Robin Mairs said: "This was obviously something you had done for your sexual gratification."
The judge described the indecent child images as "serious offending".
He said: "These are real children who suffer real harm because there is a market to feed the perverted appetites of people like you."