Created
February 14, 2018 21:09
-
-
Save marty-Wallace/e64d97adf20546e4299c300f8bcffcd6 to your computer and use it in GitHub Desktop.
Encode a .ogv to a .gif. Requires ffmpeg
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
#!/bin/bash | |
inputFile=$1 | |
FPS=15 | |
WIDTH=1200 | |
#Generate palette for better quality | |
ffmpeg -i $inputFile -vf fps=$FPS,scale=$WIDTH:-1:flags=lanczos,palettegen tmp_palette.png | |
#Generate gif using palette | |
ffmpeg -i $inputFile -i tmp_palette.png -loop 0 -filter_complex "fps=$FPS,scale=$WIDTH:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif | |
rm tmp_palette.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment