MPEG TS PCR and PTS

Adams, Bruce (KMLWG) Bruce.Adams at KantarMedia.com
Wed May 9 10:03:30 UTC 2018


Hi,

Yes indeed I only do buffer->get_pts() after demuxing.
Correctly assigning material to events is a good example. If I get an event saying “Foobar” is on at 9pm how can I determine from the (demuxed) TS when 9pm is in terms of the buffer mini objects I’m processing?
For testing I wish to playback a TS from a file as fast as possible rather than real-time. So all the time information must be in the TS somewhere. My guess is to use the TDT to get an absolute time-stamp and relate either the gstreamer PTS or the mpeg PCR & PTS to it somehow.

For a little more background I’m effectively monitoring live TS streams for events of interest detected by processing the audio (or video). I need to determine the absolute time of these events to associate them with events on other streams. The same code should work on a recorded TS as well.

At the moment it looks like I have to use the system clock for a live stream and provide a start time for a recorded TS. It seems like there ought to be an alternative way as the TS should know when it was recorded if, for example, it includes a TDT.

Regards,

Bruce.


From: gstreamer-devel [mailto:gstreamer-devel-bounces at lists.freedesktop.org] On Behalf Of krzysztof.konopko at konagma.eu
Sent: 09 May 2018 10:06
To: Discussion of the development of and with GStreamer
Subject: Re: MPEG TS PCR and PTS

Hi,

To my understanding, `buffer->get_pts()` makes little sense in case of MPEG-TS as each GStreamer buffer will typically hold a number of TS packets which in turn can be part of different PES packets and elementary streams and relate to different access units (frames). So I do not find it particularly useful to indicate with GStreamer PTS when to "present" such ambiguous chunk of stream before demuxing it.

Also to my understanding information like TOT/TDT is more useful when presenting programme events (EIT) for example in a guide and to synchronise intended start date and time of the events with the local time (for presentation or recording purposes). I can't see how it could be useful to relate it to the actual media time where it's not really useful to care about absolute values especially when timestamps can wrap.

Kris

On Fri, 2018-05-04 at 07:13 +0000, Adams, Bruce (KMLWG) wrote:
Hi,
     I am trying to work out how to get absolute time-stamps from an incoming MPEG transport stream.
The basics seem to be that we get a presentation time-stamp via buffer->get_pts(). This is relative to the program clock reference PCR which is dictated by one of the elementary streams – typically the video. How do I get that base time out of gstreamer?
I note that if I use a tsparse element it can decode TOT and TDT sections for DVB inputs. However, I also notice that one of my inputs is a TSIP input which does not include these sections.
How can I tell if an  absolute time reference is available and when it is what is the epoch? Is it the standard unix epoch 1970-01-01T00:00:00Z?

Regards,

Bruce.


Kantar Disclaimer<http://www.kantar.com/disclaimer.html>

_______________________________________________

gstreamer-devel mailing list

gstreamer-devel at lists.freedesktop.org<mailto:gstreamer-devel at lists.freedesktop.org>

https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel<https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_gstreamer-2Ddevel&d=DwMFaQ&c=zdK58V2JKULZdB8nuBRpog&r=8VGOHR75e9VH5R2ry5VaPdkvUX6ll39esPT0cMlxEuA&m=Ap5BFPSzFHbHfSn4C4KVzBqfLpMpz_IPJGBz3wlvlk0&s=js5xzDojZ1uwum3WCMLmCBFm-6tYehT8F6YUiEZstZI&e=>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180509/7113546b/attachment-0001.html>


More information about the gstreamer-devel mailing list