Last active
November 22, 2018 06:52
-
-
Save fedir/56aeddde59571402a0d94f78eb6c7a5c to your computer and use it in GitHub Desktop.
Convert OGV 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
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