mirror of https://github.com/lukechilds/gifgen.git
Luke Childs
9 years ago
1 changed files with 19 additions and 3 deletions
@ -1,9 +1,25 @@ |
|||
#!/bin/bash |
|||
|
|||
# Setup defaults |
|||
pid=$$ |
|||
palette="/tmp/gif-palette-$pid.png" |
|||
fps="10" |
|||
|
|||
filters="fps=15" |
|||
# Parse args |
|||
while getopts "i:o:f:" opt; do |
|||
case "$opt" in |
|||
i) |
|||
input=$OPTARG |
|||
;; |
|||
o) |
|||
output=$OPTARG |
|||
;; |
|||
f) |
|||
fps=$OPTARG |
|||
;; |
|||
esac |
|||
done |
|||
|
|||
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 |
|||
# Encode GIF |
|||
ffmpeg -v warning -i $input -vf "fps=$fps,palettegen" -y $palette |
|||
ffmpeg -v warning -i $input -i $palette -lavfi "fps=$fps [x]; [x][1:v] paletteuse" -y $output |
|||
|
Loading…
Reference in new issue