[FFmpeg-devel] Animated GIF support

Vitaliy Sugrobov vsugrob at hotmail.com
Tue Aug 28 10:32:42 CEST 2012

On Mon, Aug 13, 2012 at 12:57:13PM +0400, Vitaliy Sugrobov wrote:
> > On Mon, 13 Aug 2012 06:15:35 +0400, Vitaliy Sugrobov wrote:
> > >
> > >Hi. I would like to participate in development of animated gif decoding support. Actually i've already implemented this feature by adding gif demuxer and slightly 
> > 
> > post your patch so we can take a look so far :)
> Here it is.For now conversion from animated gif to something other works only with -f gif option e.g.-f gif -i animation.gif out.mp4By the way: without -f option input treated as still image intended to be read with image2 demuxer. I think this is because of libavformat/img2dec.c:read_probe() which called without opening the file and seeks for one of the acceptable image extensions in the file name. It accepts ".gif" substring contained in the filename and returns some score. Then ffmpeg sees that it got non-zero score and proceeds not bothering to open the file and check its actual contents. Thats why my gif_probe() doesn't even have a change to be invoked.
> So the main question remains the same: how should i instruct ffmpeg that some frames should be displayed for longer than others in order to respect variable gif delays?
>seting AVPacket.duration and .pts shoudl be fine
I already figured it out, currently it works fine. I am still in the process of testing: proper handling of noisy and prematurely ended data is crucial for me. I'll post patch when everything is ok. 		 	   		  

More information about the ffmpeg-devel mailing list