-
-
Save zchee/723ab1a05d53808615d7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function vid2Gif { | |
if [[ $# != 3 ]]; then | |
print "too many or too less arguments" | |
return | |
fi | |
ffmpeg -y -i $1.mov -vf fps=10,scale=${2}:${3}:flags=lanczos,palettegen palette_$1.png | |
ffmpeg -i $1.mov -i palette_$1.png -filter_complex "fps=10,scale=${2}:${3}:flags=lanczos[x];[x][1:v]paletteuse" -f gif - | gifsicle --optimize=3 > $1.gif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment