Created
July 17, 2016 10:12
-
-
Save JCash/dda6e6804c011b645a80abad96775645 to your computer and use it in GitHub Desktop.
A quick way to convert Defold video (.ivf) into a compressed .gif
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
#!/usr/bin/env bash | |
FPS=15 | |
SIZEPX=320 | |
STARTTIME=0 | |
DURATION=0 | |
PALETTE="/tmp/palette.png" | |
TMPGIF="/tmp/$2" | |
FILTERS="fps=$FPS,scale=$SIZEPX:-1:flags=lanczos" | |
ffmpeg -v warning -ss $STARTTIME -t $DURATION -i $1 -vf "$FILTERS,palettegen" -y $PALETTE | |
ffmpeg -v warning -ss $STARTTIME -t $DURATION -i $1 -i $PALETTE -lavfi "$FILTERS [x]; [x][1:v] paletteuse" -y $TMPGIF | |
gifsicle -O1 --lossy=80 -i $TMPGIF -o $2 | |
rm $PALETTE | |
rm $TMPGIF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ ./make_gif_from_video.sh ~/defold_rec.ivf output.gif