Created
February 3, 2017 16:33
-
-
Save wmora/2abf7f3a4cd6e67b9dd12eb1817239ff to your computer and use it in GitHub Desktop.
Script to create a gif as explained in: http://chrismessina.me/b/13913393/mov-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
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