User:Silviolorusso/Gifmaka
A little script to get frames from a video file and create an animated gif.
#!/bin/sh
# Extract three PNG frames from a movie | $1 movie name | $2 time position in seconds | $3 number of frames
ffmpeg -i $1 -r 25 -ss $2 -vframes $3 $1-%03d.png
# convert PGN to single GIF
for FRAME in $(seq -f %03g $3)
do
convert $1-$FRAME.png $1-$FRAME.gif
rm $1-$FRAME.png
done
# combine all individual GIF in an animated one
FWD=$(/bin/ls $1-*.gif)
BWD=$(echo "${FWD}" | sed 1d | sort -r | sed 1d)
gifsicle --delay 4 --loopcount=0 --colors 256 \
$FWD $BWD > $1-anim.gif
# remove files
rm $FWD
Examples of use of GIFMAKA capturing frames from Vampire in Venice directed by Augusto Caminito.