<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
On 24.09.2021 13.05, Sebastian Dröge wrote:<br>
<blockquote type="cite"
cite="mid:5c0c564e35775588031695d85c259a88528b6738.camel@centricular.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div>On Fri, 2021-09-24 at 12:59 +0200, Marianna Smidth Buschle
via gstreamer-devel wrote:</div>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px
#729fcf solid;padding-left:1ex">
<div>I have a use case where I have N live sources (v4l2src)
from which I can <br>
</div>
<div>select to be the output.<br>
</div>
<div><br>
</div>
<div>I also need to be able to make a replay (seek from a
filesrc).<br>
</div>
<div><br>
</div>
<div>My question is how to properly handle the mixing of the
live and <br>
</div>
<div>non-live sources since the timestamps don't match.<br>
</div>
<div><br>
</div>
<div>The filesrc starts from zero (or the seeking point) and the
live sources <br>
</div>
<div>have a running-time based on the clock.</div>
</blockquote>
<div><br>
</div>
<div>This is actually simpler than what you wrote. What you would
do is to call gst_pad_set_offset() on the source pad of the
non-live streams that you want to connect to the mixer.</div>
<div>That would then make sure to update the running time
accordingly.</div>
</blockquote>
<p>Can I do that directly on the filesrc (the MPEG-TS) stream?</p>
<p>Or should it be on the tsdemux pads, or later on the audio/video
decoder pads?<br>
</p>
<blockquote type="cite"
cite="mid:5c0c564e35775588031695d85c259a88528b6738.camel@centricular.com">
<div><br>
</div>
<div>The offset would in the simplest case be the current running
time when connecting the non-live stream.</div>
<div>You can get that from the current pipeline clock's time minus
the current pipeline's base time.</div>
<div><br>
</div>
<div>Alternatively you might want to add some more time to that to
schedule the non-live stream into the future, or do more
complicated calculations to schedule the start of the stream to
a specific time.</div>
<div><br>
</div>
<div><br>
</div>
<div>Note that after a (flushing) seek the running time starts
again at 0, so you might need to re-offset here after a seek.</div>
<div><br>
</div>
<div><span>
<pre>--
</pre>
<div data-evo-paragraph="" class="" style="width: 71ch;"
data-evo-signature-plain-text-mode="">Sebastian Dröge,
Centricular Ltd · <a href="http://www.centricular.com"
moz-do-not-send="true">https://www.centricular.com</a></div>
<div data-evo-paragraph="" class="" style="width: 71ch;"><br>
</div>
</span></div>
</blockquote>
<pre class="moz-signature" cols="72">--
Best regards / Med venlig hilsen
“Marianna Smidth Buschle”</pre>
</body>
</html>