Last active
February 6, 2018 23:59
-
-
Save AshKyd/d60d9f7a621545429b108c2f988db6ba to your computer and use it in GitHub Desktop.
Gif encoder script
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 | |
# Use ./gifenc.sh input.mp4 output.gif | |
palette="/tmp/palette.png" | |
## Adjust start time and duration | |
# -ss 00:00:03 -t 00:00:08 | |
# Various filters change framerate, crop, scaling etc | |
#filters="crop=320:320:500:100,fps=16" | |
filters="fps=12,scale=200:-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