|
|
@ -25,6 +25,7 @@ palette="/tmp/gif-palette-$pid.png" |
|
|
|
fps="10" |
|
|
|
verbosity="warning" |
|
|
|
stats_mode="full" |
|
|
|
dither="sierra2_4a" |
|
|
|
|
|
|
|
# Parse args |
|
|
|
while getopts "hi:o:f:sv" opt; do |
|
|
@ -43,6 +44,7 @@ while getopts "hi:o:f:sv" opt; do |
|
|
|
;; |
|
|
|
s) |
|
|
|
stats_mode="diff" |
|
|
|
dither="none" |
|
|
|
;; |
|
|
|
v) |
|
|
|
verbosity="info" |
|
|
@ -70,5 +72,5 @@ echo "Generating palette..." |
|
|
|
ffmpeg -v $verbosity -i $input -vf "fps=$fps,palettegen=stats_mode=$stats_mode" -y $palette |
|
|
|
[[ "$verbosity" = "info" ]] && echo |
|
|
|
echo "Encoding GIF..." |
|
|
|
ffmpeg -v $verbosity -i $input -i $palette -lavfi "fps=$fps [x]; [x][1:v] paletteuse" -y $output |
|
|
|
ffmpeg -v $verbosity -i $input -i $palette -lavfi "fps=$fps [x]; [x][1:v] paletteuse=dither=$dither" -y $output |
|
|
|
echo "Done!" |
|
|
|