<div dir="ltr"><div><div><div>Hi Sebastian.<br><br></div>Thanks for hints and tips. Will try both your rtsp example and a manual with just RTCP and rtpsession/rtpbin with the suggested parameters for version 1.5.2. Goal is sync and minimal delay. Perhaps both solutions will provide same delay.<br><br></div>Best regards<br></div>Peter MM <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 23, 2015 at 7:33 PM, Sebastian Dröge <span dir="ltr"><<a href="mailto:sebastian@centricular.com" target="_blank">sebastian@centricular.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Di, 2015-06-23 at 19:18 +0200, Peter Maersk-Moller wrote:<br>
> Hi Sebastian.<br>
><br>
> Please see comments in-line.<br>
><br>
> Sorry for being difficult. I'm probably missing an important point<br>
> here.<br>
><br>
> On Tue, Jun 23, 2015 at 12:27 PM, Sebastian Dröge <<br>
> <a href="mailto:sebastian@centricular.com">sebastian@centricular.com</a>> wrote:<br>
> > On Di, 2015-06-23 at 12:17 +0200, Peter Maersk-Moller wrote:<br>
> > > Hi Sebastian.<br>
> > > Thanks for the answer/example. So what I read from the example is<br>
> > > that nothing needs to be changed for the sender (liver source):<br>
> > No, you need to use "use-pipeline-clock" at least. And ensure that<br>
> > both<br>
> > pipelines (sender and receiver) are using the same clock. You can't<br>
> > do<br>
> > that with gst-launch!<br>
> I probably misunderstand. Are you telling me to use pipeline-clock in<br>
> the sender?<br>
> Isn't the pipeline-clock a clock that starts at 0 when the pipeline<br>
> starts?<br>
><br>
> Will that work when we have two independent senders, each on their<br>
> own system and we eventually want to play-out the two sender streams<br>
> synchronized but each stream in its own playout process? I'm probaly<br>
> missing the point here.<br>
<br>
</span>That's why you need to ensure to use the same clock on sender and<br>
receiver. Both should report the same times.<br>
<br>
This could be done with the GStreamer network clock, a GStreamer PTP or<br>
NTP clock. Or by using the GStreamer system clock (make sure to set it<br>
to wall clock time) and outside GStreamer ensuring that the system<br>
clocks are synchronized.<br>
<br>
<br>
Alternatively you can also not use ntp-clock-source=3 on sender *and*<br>
receiver (and leave it at 0), in which case you only need to ensure<br>
that the wall time clock on senders and receivers are reporting the<br>
same time. This can be less accurate though.<br>
I didn't really test the case where the pipeline clocks on sender and<br>
receiver are different, as it's much easier to ensure synchronization<br>
of the clock inside GStreamer than making sure the system time is<br>
properly synchronized. See the example applications I linked.<br>
<br>
<br>
(Don't use use-pipeline-clock anymore, it's deprecated in favour of ntp<br>
-clock-source)<br>
<span class=""><br>
>  > Assuming each source of RTP/RTCP streams are in agreement about<br>
> time<br>
> > > using ntpd to set/adjust the clock locally, should this pipeline<br>
> > play<br>
> > > the content synchronized not only with audio/video synchronized<br>
> > but<br>
> > > also synchronized for other similar pipelines?<br>
> > No, the important part here is that via RTCP some clock time<br>
> > exchange<br>
> > will happen and then the timestamps on the receiver side are<br>
> > exactly<br>
> > the same clock time as on the sender side.<br>
> Ok. But still confused. The two senders may have the same<br>
> understanding about time through ntp synchonized system time, but<br>
> they will usually have started at different times. But since they<br>
> have same system time, the timestamps together with each streams RTCP<br>
> sender report will provide each separate rtpbin in the playout end<br>
> with information about how timestamps relates to absolutely system<br>
> time and as a consequence of ntp, also the wall clock.<br>
<br>
</span>The GStreamer clocks would report the same times on sender and receiver<br>
if you make sure to use the same clock in both pipelines. What is<br>
different is the base time and thus the running time.<br>
<br>
The use of ntp-sync=true and buffer-mode=synced and ntp-sync-source=3<br>
would make sure that the different base times are calculated away again<br>
based on the NTP times from the RTCP SR.<br>
<span class=""><br>
> >  Related your later questions: codec and stuff does not matter,<br>
> > what<br>
> > matters are the timestamps (the buffer timestamps in clock time<br>
> > must be<br>
> > the same in the end! PTS or running time don't matter), the same<br>
> > clock<br>
> > and that all receivers use the same latency.<br>
> Got it. So two end-to-end-systems  (producer and playout) will<br>
> playout in sync, if system time on each producer is the same, because<br>
> the two systems end-to-end will have the same delay. At least that is<br>
> what I think you are writing. I assume that only work if one of them<br>
> does not have considerably longer network delay compared to the other<br>
> ?<br>
<br>
</span>Yes, see also my remark about gst_pipeline_set_latency(). You would<br>
there have to configure the biggest latency of all receivers (including<br>
network and decoder latency!).<br>
<span class=""><br>
>> A couple of things though:<br>
> > > ntp-time-source does not seem to be a settable parameter for<br>
> > rtpbin<br>
> > > for (Currently using GStreamer 1.4.5) when listing the module<br>
> > with<br>
> > > gst-inspect-1.0. So how do I set it through CLI using gst-launch<br>
> > -1.0?<br>
> > You need 1.5.1 or GIT master. And you can't use gst-launch for all<br>
> > of<br>
> > this, see above. Please write some proper code instead of using gst<br>
> > -launch, gst-launch is only a testing tool.<br>
> So you keep telling me :-) I think gst-launch is a very useful<br>
> application :-)))) for which I can only thank for too little.<br>
><br>
> Okay, tried to avoid it for years after looking at the documentation,<br>
> but there seems no other way around it. It's a little bit odd that<br>
> somebody has not already written a CLI GStreamer based app, that can<br>
> playout (to your choice of sink) through mutiple independent<br>
> pipelines synchronously.<br>
<br>
</span>I linked you to one in my previous mail :) That does exactly what we're<br>
talking about here all the time, and uses RTSP to exchange the stream<br>
parameters.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
--<br>
Sebastian Dröge, Centricular Ltd · <a href="http://www.centricular.com" rel="noreferrer" target="_blank">http://www.centricular.com</a><br>
</div></div><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br></div>