Created
February 9, 2018 17:11
-
-
Save tomasdev/7ad92addfa839f3936e1a0df4c15601a to your computer and use it in GitHub Desktop.
MP4 to GIF using 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
# Step 1: define video | |
export VIDEO=name.mp4 | |
# Step 2: create palette to have a better image quality result | |
ffmpeg -i $VIDEO -vf fps=15,scale=320:-1:flags=lanczos,palettegen palette.png | |
# Step 3: use the palette to convert the mp4 to gif | |
ffmpeg -i $VIDEO -i palette.png -filter_complex "fps=15,scale=400:-1:flags=lanczos[x];[x][1:v]paletteuse" $VIDEO.gif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment