Last active
November 17, 2017 19:01
-
-
Save mtking2/25dfa4f3cf12dfd532c2c0288a76233b to your computer and use it in GitHub Desktop.
GIF encoder w/ ffmpeg
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
#!/bin/sh | |
# convert input.mov to 720px wide gif at 30fps | |
# ./gifenc input.mov output.gif 720 30 | |
palette="/tmp/palette.png" | |
filters="fps=$4,scale=$3:-1:flags=lanczos" | |
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette | |
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment