[Libav-user] Detecting if a gif is animated or not

Carl Eugen Hoyos ceffmpeg at gmail.com
Thu Sep 15 15:56:53 EEST 2016


2016-09-15 14:37 GMT+02:00 Gonzalo Garramuño <ggarra13 at gmail.com>:
>> Do you think this is possible in general (without decoding the gif)?
>
> I was hoping there was some kind of magic number or number of
> frames in the header.  But I guess from your answer, that's not the
> case. Anyway, I solved the issue in some other way.

If the gif does not contain a Graphic Control Extension (0x 21 F9) the gif
only contains one frame afaict.

I believe you have to parse the header to find (or not find) the extension.
I suspect that one-frame gifs with GCE are at least possible to create.

Carl Eugen


More information about the Libav-user mailing list