[FFmpeg-devel] FAQ item on GIF demux

François Revol revol
Fri Nov 2 23:12:20 CET 2007


I tried to convert an animated GIF file today, but the result was quite bad.
Checking the file with identify (ImageMagick) gave something like:
ALCHIMIE7_89.GIF[0] GIF 164x104 164x104+0+0 PseudoClass 256c 1mb 20358.035u 1:08
ALCHIMIE7_89.GIF[1] GIF 160x16 164x104+2+86 PseudoClass 256c 1mb 20355.665u 1:08
ALCHIMIE7_89.GIF[2] GIF 160x100 164x104+2+2 PseudoClass 256c 1mb 20355.151u 1:08
ALCHIMIE7_89.GIF[3] GIF 158x84 164x104+4+2 PseudoClass 256c 1mb 20352.767u 1:08
ALCHIMIE7_89.GIF[4] GIF 155x83 164x104+7+2 PseudoClass 256c 1mb 20350.854u 1:08
ALCHIMIE7_89.GIF[5] GIF 157x90 164x104+4+2 PseudoClass 256c 1mb 20348.928u 1:08
It turned out the file used delta-like images which ffmpeg doesn't handle.
It seems ImageMagick itself has difficulties processing this kind of files 
directly.
Google came out with a nice workaround:
http://wiki.flux-cms.org/display/BLOG/Resizing+animated+GIFs+with+ImageMagick?focusedCommentId=4390991
Using convert -coalesce merges the deltas to each image (=makes them all 
keyframes).

It could be a nice addition to the FAQ:
"I tried to convert a GIF animation, the first frame looks good but next 
ones look inverted or distorted."

Could also fix the demuxer but it's probably not worth the pain.

Fran?ois.





More information about the ffmpeg-devel mailing list