Skip to content

Instantly share code, notes, and snippets.

@NanoDano
Created June 5, 2018 04:40
Show Gist options
  • Save NanoDano/fc86e4fd3397b62c18edad48e78ce1ab to your computer and use it in GitHub Desktop.
Save NanoDano/fc86e4fd3397b62c18edad48e78ce1ab to your computer and use it in GitHub Desktop.
Create timelapse video from still images
# Requires: sudo apt-get install mencoder
# To set it up to run on a cron job once per day at 5am:
# crontab -e
# 0 5 * * * /home/pi/timelapse_scripts/stitch_video.sh
DATE=`date '+%Y-%m-%d %H:%M:%S'`
echo "$DATE [*] Creating timelapse video"
cd /home/pi/Pictures
ls *.jpg > image_list.txt
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:aspect=16/9:vbitrate=8000000 -vf scale=2592:1944 -o timelapse.avi -mf type=jpeg:fps=24 mf://@image_list.txt
echo "[+] Done creating video."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment