How to convert a video file to an animated GIF on Linux:
- Install required software:
apt-get install ffmpeg gifsicle imagemagick: - Convert the video file to a series of small images:
mkdir /tmp/gif/
ffmpeg -i YOURVIDEOFILE.mp4 -r 10 -s 711×400 /tmp/gif/out%04d.gif - Combine these images together into a GIF animation:
gifsicle –delay=10 –loop /tmp/gif/*.gif > animation.gif - Optimise the GIF animation so the file size is smaller:
convert -layers Optimize animation.gif animation_optimized.gif
Exactly what I need .. Thanx for writing it up!