Skip to content

Instantly share code, notes, and snippets.

@danielepolencic
Last active August 29, 2015 14:25
Show Gist options
  • Save danielepolencic/1aa7ce8281332a480845 to your computer and use it in GitHub Desktop.
Save danielepolencic/1aa7ce8281332a480845 to your computer and use it in GitHub Desktop.
video to gif
#!/bin/bash
rm -rf frames
mkdir frames
ffmpeg -i "$1" -vf scale=320:-1:flags=lanczos,fps=10 frames/ffout%03d.png
convert -delay 5 -loop 0 -dither None -colors 128 "frames/ffout*.png" -fuzz "10%" -layers OptimizeFrame "$2"
rm -rf frames
# as seen on:
# http://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment