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

John Stebbins stebbins at jetheaddev.com
Thu Nov 10 18:43:29 CET 2011


On 11/10/2011 02:46 AM, Andrea3000 wrote:
> John Stebbins <stebbins at ...> writes:
>
>> No, libbluray doesn't provide any offset for clips.  In general *any* 
>> transport stream can have discontinuities.  There are PCRs and 
>> discontinuity indicators in the TS header adaptation field to assist in 
>> dealing with them.  If your code isn't already processing these and 
>> calculating your own offsets for these conditions, then you  will not be 
>> able to handle the normal run-of-the-mill transport stream.  If you 
>> have the mechanism in place to handle these discontinuities, then it 
>> should just be a matter of flagging a discontinuity at a clip boundary 
>> and let the existing logic figure out proper offsets.
>>
> Oh well. I have to confess that I'm really new to programming, expecially 
> to video decoding/encoding stuff and I have still to learn a lot of things.
> I didn't know of this PCR field inside TS header as well as that transport 
> stream can naturally have discontinuites inside the same file. I'll try to 
> figure it out by googling a bit.
>
> For what is about my program, I use FFmpeg API to parse raw packet 
> and from what I have googled so far, it seems that neither AVPacket 
> structure nor AVFrame structure contain PCR field. It is contained into 
> MpegTSContext structure but it seems to be only an internal structure 
> because it is not available in ffmpeg headers.
> It also seems that FFmpeg use PCR field internally to adjust PTS and DTS
> of the stream and this may explain why I have never had problem with
> TS, as I mainly play this type of format. But I'm really not sure of
> this PTS/DTS adjustment. 
>
> I will ask a specific question about PCR in FFmpeg mailing list and I will 
> eventually modify FFmpeg source in order to output PCR.
>

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.

-- 
John      GnuPG fingerprint: D0EC B3DB C372 D1F1 0B01  83F0 49F1 D7B2 60D4 D0F7


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.videolan.org/pipermail/libbluray-devel/attachments/20111110/613403e1/attachment.pgp>


More information about the libbluray-devel mailing list