Use an old mobile phone (Android system)
then download alfred camera from the playstore, to both existing phone & old phone
connect them through a google account, & ay presto you have a perfect cctv camera.
that can have motion detection turned on & off when you like.
I have 2 set up around my home, since the missus past away early this year
there is a you tube video about all the set up