For my new surveillance IP cameras at home I had an idea to setup a light real time recorder on the remote Linux server in the Internet.

My Foxcam IP cameras can upload an image via FTP or send an image via eMail on motion detection. Alternatively a MJPEG image stream can be downloaded from the cam. I used these facts to get the best results for recording on the remote server.

Without an exact plan I came very fast to using Ffmpeg with x264 encoder and some filters for good results in recording videos. However installing and configuring that tools, and making them doing the job was not that easy. It took hours and days to create that small script which I present on this site.