

Start recording when the cam connects to the FTP server.So recording the stream to a file is almoust easy. The idea is very easy: start recording the stream when the cam connects to the FTP server and end recording automatically after one minute (if no other FTP connection was done by the cam in the meantime).įortunately Ffmpeg can use MJPEG streams directly as input format and convert them to x264 encoded mp4 files in real time. I still need FTP upload in order to start recording the MJPEG stream only at times when motion is detected by the cam. So I tried the live recording and encoding by Ffmpeg from the MJPEG stream in real time. Another problem is that the server needs lots of storage space for the images (30-40 KB per 640×480 px image) and then it takes hours of time with ~100% CPU load every night to compress the images to video files. Even on the very fast FTP servers it wouldn’t be possible to go much higher than 1 fps.

For each image it takes a lot of time for FTP login and logout.

This idea works, but we only get a video stream at max. My first idea was just let the cam to upload the images via FTP as often as possible and then create video files from those single images by Ffmpeg in a daily job. After setting up the cams at home and software on the server we can install and start the main recording script.
