[libbluray-devel] PTS and DTS of Blu-Ray titles made of multiple files

Andrea3000 andrea3000 at email.it
Fri Nov 11 16:31:29 CET 2011


John Stebbins <stebbins at ...> writes:

> Clips always have a PCR at the beginning.  So if FFmpeg is handling 
> PCR discontinuities correctly, there really shouldn't be anything you
> need to do.  However, I wouldn't be surprised at all if FFmpeg doesn't
> handle them correctly.  I've never been very impressed with how 
> FFmpeg handles timestamp processing.  That's one of the reasons
> we keep our own TS demux in HandBrake.
>

I was wrong, FFmpeg doesn't seem to parse PCR field at all when using
regular MPEG-TS demuxer. It reads PCR only when it uses raw MPEG-TS
demuxer. But that demuxer doesn't provide proper packet parsing that
is needed to properly decode every frame. Or at least I'm not able to use it..

I think I need to implement this on my own, at ffmpeg level or at level
of my app.
But I have to study this MPEG-TS header structure a lot more because
I still don't have a clear understanding of all the necessary pieces.

One thing that I'm really not able to figure out is how I can handle
seek properly. I mean, when I seek foreward, I
don't know from which clip I am extracting packets after seek.
If it were a stream without discontinuity, it's simply a matter of
realigning to the new PTS and DTS values which are greater than the
previous ones and are proportional to the playback time.
But with this type of stream, if I realign to the new PTS and DTS values
I loose the playback time because new clip has its own PTS and DTS which
start over and therefore I loose the actual position in the entire title.
Does also PCR reset itself upon switching clip or it remains monotone?
How can I always have an indicator of the relative position in the
movie as long as PTS and DTS are no more suitable for this?
Have I to use the number of bytes of the actual position compared to
the total number of bytes of the entire title? This seems a dirty hack..






More information about the libbluray-devel mailing list