Last active
December 1, 2016 12:43
-
-
Save inooid/9adb294e63af3ae249a9 to your computer and use it in GitHub Desktop.
Mov to Gif and beyond!
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
# Convert mov to mp4 and resize | |
ffmpeg -i input.mov -codec:v libx264 -profile: high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale='948:-1' -threads 0 output_file.mp4 | |
# Convert mp4 to image frames | |
ffmpeg -i output_file.mp4 -r 10 frames/frame%03d.png | |
# Convert image frames to animated gif | |
convert -delay 5 -loop 0 frames/frame*.png output.gif | |
# -------- | |
# Another method: | |
ffmpeg -i input.mov -vf "scale=min(iw\,600):-1" -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=7 --colors 128 > output.gif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment