Skip to content

Instantly share code, notes, and snippets.

@vlandham

vlandham/gifmaker.sh

Created Apr 14, 2017
Embed
What would you like to do?
gifmaker.sh
#!/bin/sh
start_time=0:00.2
#duration=4.5
palette="/tmp/palette.png"
unoptimized="/tmp/unoptimized.gif"
filters="fps=24,scale=400:-1:flags=lanczos"
ffmpeg -v warning -ss $start_time -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -ss $start_time -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $unoptimized
#ffmpeg -v warning -ss $start_time -t $duration -i $1 -vf "$filters,palettegen" -y $palette
#ffmpeg -v warning -ss $start_time -t $duration -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $unoptimized
cp $unoptimized $2
convert -layers Optimize $unoptimized $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment