I have an IP security camera (192.168.0.8) which able to broadcast rtsp content over network.
I'm able to save that (RAW) content without changes using next ffmpeg command from my computer:
ffmpeg -i "rtsp://192.168.0.8/stream=0.sdp" -acodec copy -vcodec copy test-raw.mp4
I'm also able to resize it on the fly:
ffmpeg -i "rtsp://192.168.0.8/stream=0.sdp" -vf "scale=640:-1" test640.mp4
But how to save only that video which contains motion detection parts only?
I tried to get it solved using ffmpeg's scene change filters, but no luck.
My goal - to have common video monitoring solution, which detects when someone is moving near the camera and save it into the video file. I understand that it might be not possible to do it on the fly from stream, so it is OK for me to save big file firstly, then process it with another ffmpeg command and generate new video file which contains only motion detected parts. If you can give me advice what exactly should I research more, I will be really thankful.
My camera stream is transmitted without sound. So, I can generate set of images from original video, then pick proper images and then save new video from images.