Created
June 8, 2016 03:26
-
-
Save juliocesar/ebb658162370d2482d5520ea7a8581c7 to your computer and use it in GitHub Desktop.
Shell function for converting videos into GIFs.
This file contains hidden or 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
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 21 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 50% out-static*.png GIF:- | gifsicle --colors 256 --delay=5 --loop --optimize=3 --mul | |
tifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else | |
echo "proper usage: gifify <input_movie.mov>. You DO need to include extension." | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment