[Libav-user] Animated GIF duration

Don Moir donmoir at comcast.net
Sat Oct 25 23:05:16 CEST 2014


----- Original Message ----- 
From: "Gonzalo Garramuno" <ggarra13 at gmail.com>
To: "This list is about using libavcodec, libavformat, libavutil,libavdevice and libavfilter." <libav-user at ffmpeg.org>
Sent: Saturday, October 25, 2014 4:37 PM
Subject: [Libav-user] Animated GIF duration


>I want to know how can I retrieve an animated GIF duration (length in frames or seconds).  I tried context->duration and 
>stream->duration and both return AV_NOPTS_VALUE.  Can somebody help?

You have to walk thru the gif blocks / tags to get the duration. ffmpeg is not going to do this for you at this time. If you look at 
the gif code in ffmpeg you should be able to figure out how to do this or you can look somewhere else for the file spec of a gif and 
sum the delays. 



More information about the Libav-user mailing list