# change to motion storage cd /tmp/motion # create temp dir if not exists if [ ! -d "./tmp/" ]; then mkdir ./tmp/ fi # clear temp dir rm ./tmp/* # copy all captured images to temp dir, an rename it to 00000.jpg x=1; for i in *.jpg; do counter=$(printf %06d $x); cp "$i" ./tmp/img"$counter".jpg; x=$(($x+1)); done # acvonv=ffmpeg avconv -r 30 -i ./tmp/img%06d.jpg -s hd720 -vcodec libx264 time-lapse.mp4 # clear temp dir rm ./tmp/*