4

Animated GIFs cheatsheet

 2 years ago
source link: https://devhints.io/animated_gif
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Convert MP4 to GIF

mkdir -p gif
mplayer -ao null -vo gif89a:outdir=gif $INPUT
mogrify -format gif *.png
gifsicle --colors=256 --delay=4 --loopcount=0 --dither -O3 gif/*.gif > ${INPUT%.*}.gif
rm -rf gif

You’ll need mplayer, imagemagick and gifsicle. This converts frames to .png, then turns them into an animated gif.

A given range

mplayer -ao null -ss 0:02:06 -endpos 0:05:00 -vo gif89a:outdir=gif videofile.mp4

See -ss and -endpos.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK