Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A quick way to convert Defold video (.ivf) into a compressed .gif
#!/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
@JCash

This comment has been minimized.

Copy link
Owner Author

JCash commented Jul 17, 2016

$ ./make_gif_from_video.sh ~/defold_rec.ivf output.gif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.