[Ffmpeg-devel] Timestamps on Decoding
Paul Curtis
pfc
Mon Oct 24 03:05:26 CEST 2005
Ronald S. Bultje wrote:
> Depends on how you call av_decode_video(). I call it in a loop, like
> this (quasi-code):
>
> for (;;) {
> if (output = av_decode_video (ctx, input)) {
> // do something with output
> }
> }
>
> 1) if it's an I frame, then output == input, roughly. Timestamps, all
> are the same. In addition, if ctx->has_b_frames is false, then output ==
> input also. In any case, output.PTS == input.PTS.
> 2) if neither of the above applies, then you probably have a
> backward-reference frame, so output may well represent a frame that you
> fed to the decoder earlier. You'll need to do PTS-calculationing, like I
> showed you in my first email (but there's other reasonable ways to do
> it, also).
>
> Does this make sense?
Absolutely ... thanks.
Paul
More information about the ffmpeg-devel
mailing list