[Ffmpeg-devel] [PATCH] GIF encoder

Baptiste Coudurier baptiste.coudurier
Wed Nov 1 23:41:29 CET 2006


Michael Niedermayer wrote:
> Hi
> 
> On Wed, Nov 01, 2006 at 11:12:07PM +0100, Baptiste Coudurier wrote:
>> Michael Niedermayer wrote:
>>> Hi
>>>
>>> On Wed, Nov 01, 2006 at 09:11:27PM +0100, Baptiste Coudurier wrote:
>>>> Hi
>>>>
>>>> GIF encoder ported from lavf to lavc.
>>>> Very simple encoder (no compression), if someone is motivated to code
>>>> LZW compression it would be nice.
>>>>
>>>> Now we can remove AVImageFormat from lavf without regression.
>>> what about animated gifs, do they work too with your encoder?
>>>
>>> and do the regression tests pass if the new encoder is used instead
>>> of the old? if not why not?
>> In fact, goal is to remove AVImageFormat, old gif muxer/demuxer in lavf
>> are still present and they provide animated gif support.
>> Now with encoder, image format can be dropped in favor of image2.
> 
> yes but what is missing for animated gif support? it cant be much ...
> 
> the idea that we would have a libavformat/gif.c which could do animated
> gif while libavcodec/gif.c wouldnt be able to is a lttle strange ...
> 
> but if you dont want to support it its still better to be able to finally
> kill AVImageFormat at least even if we have to keep libavformat/gif.c ...

Encoder as is will encode each picture as a standalone gif image.

I see animated gif more as muxing feature (adding gce extension with
correct delay based on timebase).

And yes, for now I want to kill AVImageFormat.

>>> if yes to both then apply it
>>>
>>> [...]
>>>> -    put_byte(pb, 0x00); /* end of image block */
>>>> -
>>>> +    bytestream_put_byte(bytestream, 0x00); /* end of image block */
>>>> +    bytestream_put_byte(bytestream, 0x3b);
>>>>      return 0;
>>>>  }
>>> this looks different?
>>>
>> In fact line was moved from gif_write to gif_image_write_image, but I
>> can let it in encode_frame if you want.
> 
> doesnt help, libavformat/gif.c wrote it only at the end of the movie
> IIRC

At the end of image writing also, see gif_write function.

> note you can easily detect the end of the movie by missusing CODEC_CAP_DELAY
> and writing the 0x3b if theres no input pic
> 

Thanks for the tip.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312




More information about the ffmpeg-devel mailing list