Skip to content

Instantly share code, notes, and snippets.

@heisters
Created March 26, 2015 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heisters/0d3c34d52d8f3eea05ec to your computer and use it in GitHub Desktop.
Save heisters/0d3c34d52d8f3eea05ec to your computer and use it in GitHub Desktop.
Convert videos to gifs
#!/bin/bash
in="$1"
out="$2"
fps=6
delay=$(printf "%0.f" $(echo "scale=2;100 / $fps" | bc))
mkdir gif
cd gif
ffmpeg -i $in -r $fps frame%05d.png
convert -delay $delay -loop 0 *.png $out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment