[Ffmpeg-devel] timestamp of a decoded frame?

Eric Fernandez egf05
Mon Jun 12 15:25:13 CEST 2006


Michel Bardiaux wrote:
> Eric Fernandez wrote:
>> Hi,
>>
>> I use avcodec_decode_video() in my program to decode each frame of an
>>  MPEG file. How can I determine the timestamp of the decoded frame? I
>>  tried to find a way in the documentation and examples, but was 
>> unsuccessful.
>>
>> Many thanks, Eric
>
> Look in the archives for a thread with subject "[Ffmpeg-devel]
> Timestamps on Decoding". It gives the easy rule "When you input a 
> frame with DTS "t", a frame with PTS "t" will come out of the 
> decoder". Plus lots of hints and code samples.
>
> What the field 'pts' in AVFrame is for is indeed puzzling. As well as 
> why the API does NOT give pts and dts to avcodec_decode_video, leaving 
> to it all the necessary logic...
>
Thanks a lot Michel, I just found the thread and will try to find a way 
to calculate the pts.

Eric




More information about the ffmpeg-devel mailing list