Skip to content

Instantly share code, notes, and snippets.

@hydroid7
Forked from scips/generate_stop_motion.sh
Last active February 19, 2019 20:56
Show Gist options
  • Save hydroid7/2cb593a723437eafa89ac32ef0694d37 to your computer and use it in GitHub Desktop.
Save hydroid7/2cb593a723437eafa89ac32ef0694d37 to your computer and use it in GitHub Desktop.
Stop motion for hackers using Image Magick and ffmpeg
## Rename file
j=1;for i in `ls | grep -E ".png|.jpg|.jpeg|.PNG|.JPG|.JPEG"`; do prt=$(printf '%04d' $j);j=$((j + 1));mv -v $i "$prt.JPG"; done
mogrify -crop 1920x1080+362+628 *.jpg
## or resize
mogrify -resize 1920x1080 *.jpg
## morph if necessary !!! takes time
convert *.jpg -delay 10 -morph 10 %05d.morph.jpg
## create movie
ffmpeg -r 25 -i %05d.morph.jpg output.mp4
## or
ffmpeg -r 12 -i "%04d.JPG" totoro.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment