Une erreur inattendue s'est produite.

Creating animated GIFs from the shell using FFmpeg and ImageMagick - Snippets

Creating animated GIFs from the shell using FFmpeg and ImageMagick

  1. Extracting frames:
    mkdir anim && cd anim
    ffmpeg -ss 14:55 -i video.mkv -t 5 -s 480x270 -f image2 %03d.png
  2. Selecting the frames (only 1 in 3, from frame 10 to frame 72): seq -f %03g.png 10 3 72
  3. Creating the animation:
    convert -delay 1x8 `seq -f %03g.png 10 3 72` \
          -coalesce -layers OptimizeTransparency animation.gif
  4. ImageMagick tricks:
    convert -fuzz 1% -delay 1x8 `seq -f %03g.png 10 3 72` \
          -coalesce -layers OptimizeTransparency animation.gif

    or even :

    convert -delay 1x8 `seq -f %03g.png 10 3 72` \
          -ordered-dither o8x8,8 \
          -coalesce -layers OptimizeTransparency \
          +map animation.gif