Skip to content

Instantly share code, notes, and snippets.

Created February 3, 2017 16:33
What would you like to do?
Script to create a gif as explained in:
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