Fork me on GitHub

Ivan-Site.com

Sync Videos from a Foscam Webcam

I was recently playing around with a Foscam FI9821W V2 webcam, and found its interface quite lacking in features. For example, it has no option of syncing alarm videos to any remote server. So it would just record until your SD card fills up at which point you would have to manually free up space.

Luckily, it also runs an (undocumented) FTP server on port 50021 where you can access and manage all of SD card contents. So, you can just run the following command as often as you like to move all new videos to your NAS.

Note: 192.168.1.11 is the webcam IP.

lftp -p 50021 -u admin, -e "set ftp:passive-mode false; mirror -X *.dat -X *.avi_idx --Remove-source-files /IPCamera/192.168.1.11 /local/path/to/alarm/videos; rm -f /IPCamera/192.168.1.11/record/192.168.1.11_index.dat; bye" 192.168.1.11

I tested it on FI9821W V2, but I suspect it will work on most Foscam webcams, as long as they have the FTP server running.

Posted Sat 07 December 2013 by Ivan Dyedov in Linux (Linux)