Created
November 30, 2018 09:42
-
-
Save kadimi/e90ce0cef01fdf5d78af59052e4223fc to your computer and use it in GitHub Desktop.
Video (.mp4) to animation (.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
#!/bin/sh | |
## Cleanup | |
rm -f palette.png video.gif | |
## Make palette | |
# --ss stop at seconds | |
# --t duration | |
ffmpeg -ss 10 -t 4 -i video.mp4 -vf fps=15,scale=800:-1:flags=lanczos,palettegen palette.png | |
## Make gif | |
# --ss stop at seconds | |
# --t duration | |
ffmpeg -ss 10 -t 4 -i video.mp4 -i palette.png -filter_complex "fps=15,scale=800:-1:flags=lanczos[x];[x][1:v]paletteuse" video.gif | |
# Cleanup | |
rm -f palette.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment