Last active
May 26, 2018 15:13
-
-
Save alrocar/b6dcb5b91dd550b804a7a2a578b09736 to your computer and use it in GitHub Desktop.
high-quality-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
# first create a palette of the portion of the video with more colors | |
ffmpeg -y -ss 20 -t 3 -i input.mp4 -vf fps=50,scale=640:-1:flags=lanczos,palettegen palette.png | |
# then use the palette to obtain high quality colors | |
ffmpeg -i input.mp4 -i palette.png -filter_complex "fps=50,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif | |
# -ss -> start from second | |
# -t -> duration |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment