Created
October 30, 2018 10:31
-
-
Save eduard-sukharev/9baa8b6d195db35cb9929528024fa5ac to your computer and use it in GitHub Desktop.
Convert video 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
#!/bin/sh | |
file_in=${1:-"input.mp4"} | |
file_out=${2:-"output.gif"} | |
fps=${3:-20} | |
width=${4:-400} | |
ffmpeg -y -i $file_in -vf fps=$fps,scale=$width:-1:flags=lanczos,palettegen palette.png | |
ffmpeg -y -i $file_in -i palette.png -filter_complex "fps=$fps,scale=$width:-1:flags=lanczos[x];[x][1:v]paletteuse" $file_out | |
rm -f palette.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment