<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas","serif";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Yes indeed I only do buffer->get_pts() after demuxing.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Bruce.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> gstreamer-devel [mailto:gstreamer-devel-bounces@lists.freedesktop.org]
<b>On Behalf Of </b>krzysztof.konopko@konagma.eu<br>
<b>Sent:</b> 09 May 2018 10:06<br>
<b>To:</b> Discussion of the development of and with GStreamer<br>
<b>Subject:</b> Re: MPEG TS PCR and PTS<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif"">Hi,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif""> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif"">To my understanding, `</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">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.</span><span style="font-family:"Verdana","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><span style="font-family:"Verdana","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">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.</span><span style="font-family:"Verdana","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><span style="font-family:"Verdana","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Kris</span><span style="font-family:"Verdana","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> </span><span style="font-family:"Verdana","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif"">On Fri, 2018-05-04 at 07:13 +0000, Adams, Bruce (KMLWG) wrote:<o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 4.0pt;margin-left:3.75pt;margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">     I am trying to work out how to get absolute time-stamps from an incoming MPEG transport stream.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Regards,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Bruce.<o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif""><br>
<br>
<a href="http://www.kantar.com/disclaimer.html">Kantar Disclaimer</a> <o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>gstreamer-devel mailing list<o:p></o:p></pre>
<pre><a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><o:p></o:p></pre>
<pre><a href="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=">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><o:p></o:p></pre>
</blockquote>
<div>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif""> <o:p></o:p></span></p>
</div>
</div>
</body>
</html>