Browse Source

Add arguments

pull/2/merge
Luke Childs 9 years ago
parent
commit
9b8353f841
  1. 22
      gifgen

22
gifgen

@ -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…
Cancel
Save