[Ffmpeg-devel] global frame timestamp or number

Baptiste Coudurier baptiste.coudurier
Wed Mar 21 23:22:48 CET 2007


Hi

Uoti Urpala wrote:
> On Wed, 2007-03-21 at 16:21 -0500, Martin Luessi wrote:
>> I'm having problems of figuring out what the global frame number of a
>> frame is, the struct members
>> av_frame->coded_picture_number
>> av_frame->display_picture_number
>> codec_ctx->frame_number
>> do not seem to be global but depend on the order the frames are
>> decoded. Can anybody tell me if there is a way to find global index of
>> a frame. (with global I mean the frame number in the stream)
> 
> There is no general way to know the number of a frame except decoding
> the file from the beginning until that frame. Containers normally have
> timestamps but no frame numbers, so you cannot know how many frames
> there are prior to a seek position. One special case where calculating
> the frame number directly is possible is when you know for certain that
> the file you're dealing with is constant frame rate. Then you can
> calculate the frame number from the timestamp.

You can do that with mov/mp4/3gp though, full AVIndex table containing
all samples with all timestamps is built when reading header.

-- 
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