Skip to content

Instantly share code, notes, and snippets.

@wmora
Created February 3, 2017 16:33
Embed
What would you like to do?
Script to create a gif as explained in: http://chrismessina.me/b/13913393/mov-to-gif
echo Setting up stuff
rm -fr ./pngs
rm -fr ./gifs
mkdir ./pngs
mkdir ./gifs
echo Chopping $1
ffmpeg -i $1 -r 5 ./pngs/out%04d.png
sips -s format gif pngs/*.png --out ./gifs
cd gifs
filename=$(echo $1 | cut -f 1 -d '.').gif
echo Creating gif $filename
gifsicle --optimize=3 --colors=256 --loopcount *.gif > $filename
cd ..
mv ./gifs/$filename ./$filename
rm -fr ./pngs
rm -fr ./gifs
echo Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment