[FFmpeg-devel] [PATCH] AVCHD/H.264 parser: determination of frame type, question about timestamps

Michael Niedermayer michaelni
Mon Jan 19 14:47:23 CET 2009

On Sun, Jan 18, 2009 at 06:05:57PM -0800, Baptiste Coudurier wrote:
> Michael Niedermayer wrote:
> > On Sat, Jan 17, 2009 at 08:33:15PM +0100, Ivan Schreter wrote:
> > [...]
> >> As for the timestamps, there is a complicated algorithm guessing
> >> timestamps for frames which are missing DTS/PTS timestamps in
> >> libavformat/utils.c. IMHO this can be done much easier and more elegant
> >> in compute_pkt_fields() in about this form:
> >>
> >>     if (pkt->dts == AV_NOPTS_VALUE)
> >>     {
> >>         if(pkt->pts != AV_NOPTS_VALUE) {
> >>             // set DTS same as PTS
> >>             pkt->dts = pkt->pts;
> > 
> > this case either doesnt exist or is wrong depending on how you see it.
> > the demuxer sets both or neither.
> Humm this might need checking, at least ts demuxer only sets pts
> currently when only pts is available. Attached patch fixes this.

iam not mpegts maintainer but i belive the patch is correct.

> Doesn't Matroska set pts only too ?

my comment was intended for the H.222 ( == mpeg-ps/ts) / H.264 case
several other demuxers set just pts, though for them dts=pts is wrong
as well, the 
if(only pts) dts=pts rule comes from H.222 IIRC
also there are files that violate this rule and code dts!=pts with just
pts. We have code that tries to detect and handle this

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090119/384df35f/attachment.pgp>

More information about the ffmpeg-devel mailing list