Skip to content

Instantly share code, notes, and snippets.

@rriemann
Created April 17, 2013 14:33
Show Gist options
  • Save rriemann/5404791 to your computer and use it in GitHub Desktop.
Save rriemann/5404791 to your computer and use it in GitHub Desktop.
Create an animated gif using ffmpeg, convert (imagemagick) and gifsicle
#!/usr/bin/env sh
rm out*.jpg
rm out*.gif
ffmpeg -y -i 13040065.mp4 -t 1 -filter:v transpose=1,scale=400:-1,deshake,crop=400:400 out%02d.jpg
for file in *.jpg; do
convert $file ${file%.*}.gif
done
gifsicle --delay=5 --colors 256 --loop out*.gif > final.gif
convert final.gif -layers Optimize final.gif
rm out*.jpg
rm out*.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment