Created
March 2, 2017 17:19
-
-
Save lancehunt/319d293582ea9f7b8f4fcc3607f4db5c to your computer and use it in GitHub Desktop.
Convert MP4 to animated 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 | |
brew install ffmpeg | |
ffmpeg -y -ss 3 -t 3 -i ~/Downloads/input.mp4 -vf fps=10,scale=800:-1:flags=lanczos,palettegen palette.png | |
ffmpeg -ss 1 -t 30 -i ~/Downloads/input.mp4 -i palette.png -filter_complex "fps=10,scale=800:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif | |
# 30-second output at 800 x 600 resolution |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment