Create Timelapse from IP Camera using cURL/Wget and FFmpeg

Learn how to use the command line utilities of cURL, Wget and FFmpeg to download images from an Amcrest IP camera and turn them into a timelapse video.

Download Images with Curl
while :; do curl --digest -o "$(date +"%Y%m%d%H%M%S").jpg" http://username:password@ip_address/cgi-bin/snapshot.cgi; sleep 1; done
Download Images with wget
while :; do wget -O "$(date +"%Y%m%d%H%M%S").jpg" http://username:password@ip_address/cgi-bin/snapshot.cgi; sleep 1; done
Download Images with Curl (losslessly shrink with jpegoptim)
while :; do curl --digest http://username:password@ip_address/cgi-bin/snapshot.cgi --output - | jpegoptim --strip-all --stdin > "$(date +"%Y%m%d%H%M%S").jpg"; sleep 1; done
Recommended Video Settings

https://support.google.com/youtube/answer/1722171?hl=en

Turn Image Sequence into Video
ffmpeg -framerate 30 -pattern_type glob -i '*.jpg' -vf crop=in_w:in_w*9/16,scale=1920:1080 -c:v libx264 -b:v 10000k -r 30 -pix_fmt yuv420p out.mp4
Use Hardware Encoding on Mac
Change libx264 to h264_videotoolbox
Use Hardware Encoding on Windows (Intel processor, QuickSync)
Change libx264 to h264_qsv

Leave a comment

Your email address will not be published. Required fields are marked *