Skip to content

Instantly share code, notes, and snippets.

@brockboland
Created February 10, 2014 18:22
Show Gist options
  • Save brockboland/8921355 to your computer and use it in GitHub Desktop.
Save brockboland/8921355 to your computer and use it in GitHub Desktop.
Better video-to-gif
# Convert a movie file to a gif. Better quality!
# The output file is the original file with .gif tacked on
# See http://superuser.com/a/556031/1090
function goodgif {
if [ -z "$1" ]
then
# No parameter passed, show usage
echo "Usage: goodgif filename.mov"
echo "Resulting gif is stored as out.gif"
else
mkdir framestmp
ffmpeg -i "$1" -vf scale=320:-1 -r 10 framestmp/ffout%03d.png
convert -delay 10 -loop 0 framestmp/ffout*.png out.gif
mv out.gif "$1.gif"
rm -rf framestmp
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment