[FFmpeg-devel] [PATCH] Implement guessed_pts in avcodec_decode_video2.

Nicolas George nicolas.george
Tue Feb 1 21:09:21 CET 2011

Le tridi 13 pluvi?se, an CCXIX, M?ns Rullg?rd a ?crit?:
> The decoder has nothing to do with detecting or correcting bad
> timestamps.  The only thing it should do is allow a value to be
> tracked through the reordering.  If these values are good or bad is
> for something else to determine and, if desired, attempt to correct.

Agreed. But as far as I understand things, the correction we are talking
about can only kick in after the decoder has done its job and reordered the
frames. Which leads to the question: what kind of API do we want: do we want
avcodec_decode_the_video_and_take_care_of_everything, or do we want

And when asked that way, the answer seems quite obvious to me: we want both.

> The problem with the current approach is that perfectly good
> timestamps (e.g. from mkv files) are misdetected as wrong and "fixed",
> resulting in the notorious non-monotone timestamps error, among other
> problems.

Do you have a pointer to sample for this case? I do not think that the
guessing algorithm we are discussing right now can lead to non-monotone
timestamps on valid files.

> Any automatic tampering with timestamps should be conservative, only
> kicking in when things are obviously wrong, such as two frames with
> the same PTS stored in the container.  We have to assume files are
> correct by default, and enable aggressive fixups only after being
> explicitly requested.

I think the algorithm we are discussing in this thread is conservative: it
only selects one among the actual PTS and DTS: if only one is present, of if
both are present and valid (and therefore equals), it just outputs them.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110201/1ff7c58c/attachment.pgp>

More information about the ffmpeg-devel mailing list