[Ffmpeg-devel] Timestamps on Decoding

Paul Curtis pfc
Mon Oct 24 02:48:51 CEST 2005


Rich Felker wrote:

> What's _very_ difficult is recovering pts for a sequence of encoded
> frames without decoding them, using only the dts values. Having pts is
> preferable since it's slightly more general and allows you do process
> the video in ways you couldn't (easily) do with just dts, but it
> doesn't seem essential in this case.

Thanks for the response. I suspected that since I was decoding complete 
frames that the dts would suffice in this instance. I also did some more 
research into the Helix SDK, and yes, it does smooth its own pts based 
on the complete frames presented with their start and end times.

For an example, I tripled up on frames, ie. presented the same frame 
with a start and end time that was approximately three times as long. As 
you would guess, the video ran three times slower. The Helix SDK is 
fairly forgiving on the timings also. If they overlap slightly, the 
Helix encoder seems to adjust to make the presentation smooth.

Since I can leave the actual presentation time to the encoder, I can use 
the dts to keep everything in sync. When I was calculating it myself, I 
could detect A/V sync drift over a long program ... more than five 
minutes or so.

Thanks again to all who responded. I'm also seriously looking into 
having the Helix SDK as a 'sink' for GStreamer ... that would allow for 
much more flexibility than the hardcoded encoder binary I've created.

Paul





More information about the ffmpeg-devel mailing list