Instantly share code, notes, and snippets.

@fedir /ogv2gif.sh
Last active Feb 14, 2017

Embed
What would you like to do?
Convert OGV to GIF
INPUT_FILE=$1
FPS=15
WIDTH=320
TEMP_FILE_PATH="~/tmp.png"
ffmpeg -i $INPUT_FILE -vf fps=$FPS,scale=$WIDTH:-1:flags=lanczos,palettegen $TEMP_FILE_PATH
ffmpeg -i $INPUT_FILE -i $TEMP_FILE_PATH -loop 0 -filter_complex "fps=$FPS,scale=$WIDTH:-1:flags=lanczos[x];[x][1:v]paletteuse" $INPUT_FILE.gif
rm $TEMP_FILE_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment