User:Silviolorusso/Gifmaka

From XPUB & Lens-Based wiki
< User:Silviolorusso
Revision as of 18:47, 15 October 2011 by Silviolorusso (talk | contribs) (Created page with "<source lang="bash"> #!/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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 
#!/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.