Created
February 10, 2014 18:22
-
-
Save brockboland/8921355 to your computer and use it in GitHub Desktop.
Better video-to-gif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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