Created
August 8, 2021 18:48
-
-
Save y-taka-23/241067e8307b6fc9b8c676d026953a25 to your computer and use it in GitHub Desktop.
A script for converting mov 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/bash | |
rm -f cut.mov | |
rm -f palette.png | |
rm -f encoded.gif | |
rm -f output.gif | |
ffmpeg -ss 10 -to 15 -i input.mov -c copy cut.mov | |
ffmpeg -i cut.mov -vf fps=30,scale=340:-1:flags=lanczos,palettegen palette.png | |
ffmpeg -i cut.mov -i palette.png -filter_complex "fps=30,scale=340:-1:flags=lanczos[x];[x][1:v]paletteuse" encoded.gif | |
gifsicle -O3 --colors=16 --lossy=30 output.gif -o output.gif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment