Created
April 28, 2017 17:37
-
-
Save shaneshifflett/b6a4c339d347b4af741e12aeff2a2d3c to your computer and use it in GitHub Desktop.
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
brew install ffmpeg --with-libvorbis, --with-libvpx, --with-theora, --with-opus, --with-x265, --with-fdk-aac --with-ffplay, --with-freetype, --with-libass, --with-libquvi | |
#shrink video | |
ffmpeg -ss 0:01 -i YOURVIDEO.mov -vcodec libx264 -vprofile high -preset veryslow -b:v 1m -maxrate 300k -bufsize 1000k -vf scale=-1:-1 -threads 2 -pass 1 -an -f mp4 intro.mp4 | |
#capture dominant colors | |
ffmpeg -y -t 5 -i intro.mp4 -vf fps=10,scale=1000:-1:flags=lanczos,palettegen palette.png | |
#create a new gif accentuating dominant colors from prior step | |
ffmpeg -i intro.mp4 -i palette.png -filter_complex "fps=18,scale=1000:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment