1. Install ffmpeg, gifsicle, and imagemagick:
shell# sudo aptitude update
shell# sudo aptitude install ffmpeg gifsicle imagemagick
That install command should work on Debain and Ubuntu (if you have sudo rights); other distros will install similarly.
2. Break apart your video into JPGs, which we'll convert later but this will give us a higher quality:
shell$ ffmpeg -i source_video.mp4 stills_%4d.jpg
3. Optional, delete the odd-numbered files to have fewer frames (all one line) and a faster video:
shell$ rm stills_*{1,3,5,7,9}.jpg
4. Convert existing images into GIF with ImageMagick
shell$ mogrify -format gif *.jpg
5. Convert your images to the animated GIF (all one line):
shell$ gifsicle --loopcount --careful --colors 256 --interlace --optimize --resize-width 200 --delay 1 stills_*.gif -o animated-gif.gif
Or rotate if necessary (all one line):
shell$ gifsicle --rotate-90 --loopcount --careful --colors 256 --interlace --optimize --resize-width 200 --delay 1 stills_*.gif -o animated-gif.gif
Your output GIF will be named animated-gif.gif
shell# sudo aptitude update
shell# sudo aptitude install ffmpeg gifsicle imagemagick
That install command should work on Debain and Ubuntu (if you have sudo rights); other distros will install similarly.
2. Break apart your video into JPGs, which we'll convert later but this will give us a higher quality:
shell$ ffmpeg -i source_video.mp4 stills_%4d.jpg
3. Optional, delete the odd-numbered files to have fewer frames (all one line) and a faster video:
shell$ rm stills_*{1,3,5,7,9}.jpg
4. Convert existing images into GIF with ImageMagick
shell$ mogrify -format gif *.jpg
5. Convert your images to the animated GIF (all one line):
shell$ gifsicle --loopcount --careful --colors 256 --interlace --optimize --resize-width 200 --delay 1 stills_*.gif -o animated-gif.gif
Or rotate if necessary (all one line):
shell$ gifsicle --rotate-90 --loopcount --careful --colors 256 --interlace --optimize --resize-width 200 --delay 1 stills_*.gif -o animated-gif.gif
Your output GIF will be named animated-gif.gif