Synchronizing multiple RTP sources

Peter Maersk-Moller pmaersk at gmail.com
Tue Jun 23 03:17:20 PDT 2015


Hi Sebastian.

Thanks for the answer/example. So what I read from the example is that
nothing needs to be changed for the sender (liver source):

gst-launch-1.0 -v -e \
    uvch264src SOME_SETTINGS ! h264parse ! queue ! \
         mpegtsmux name=muxer ! queue ! rtpmp2tpay ! \
        .send_rtp_sink rtpsession name=session .send_rtp_src ! \
        udpsink host=$host port=$rtp_port session.send_rtcp_src !\
        udpsink host=$host port=$rtcp_port sync=false async=false \
    alsasrc device=$alsadev do-timestamp=true ! \
    audio/x-raw,rate=44100,channels=1 ! \
    audioconvert ! queue ! avenc_aac compliance=-2 ! aacparse ! queue !
muxer.

But each receiver needs to have a pipeline like this:

caps='application/x-rtp,media=video,clock-rate=90000,encoding-name=MP2T,payload=33'

gst-launch-1.0 -v -e rtpbin name=rtpbin latency=40 ntp-time-source=3
buffer-mode=synced ntp-sync=true \
    udpsrc port=$rtp_port caps="caps" ! \
    rtpbin.recv_rtp_sink_0 rtpbin. ! \
    decodebin name=decoder ! queue ! \
    SOMEVIDEOSINK sync=true decoder. ! queue ! \
    SOMEAUDIOSINK sync=true udpsrc port=$rtcp_port ! \
    rtpbin.recv_rtcp_sink_0

Assuming each source of RTP/RTCP streams are in agreement about time using
ntpd to set/adjust the clock locally, should this pipeline play the content
synchronized not only with audio/video synchronized but also synchronized
for other similar pipelines?

A couple of things though:

   1. ntp-time-source does not seem to be a settable parameter for rtpbin
   for (Currently using GStreamer 1.4.5) when listing the module with
   gst-inspect-1.0. So how do I set it through CLI using gst-launch-1.0?
   2. The latency (PLAYBACK_DELAY_MS) in the example is set to 40ms which I
   guess is used to set the latency of the built-in rtpjitterbuffer. Is this
   correct? If yes, is this the parameter to control the same overall fixed
   delay for all instances of pipelines in this context that needs to be
   synchronized?
   3. Will two pipelines with the same configuration, but with different
   codec for the stream produce identical synchronized delay in the playout? I
   can live with the need for identical codes, but of course it will be nice.

I guees the overall principle of synchronizing playout of multiple sources,
each in its own process, that the playout takes place with a fixed delay
using ntp timestamps which is then a fixed identical delay for all
processes compared to wallclock. Is that right?

Best regards and thanks for the info.
Peter


On Tue, Jun 23, 2015 at 9:28 AM, Sebastian Dröge <sebastian at centricular.com>
wrote:

> On Di, 2015-06-23 at 00:00 +0200, Peter Maersk-Moller wrote:
> > Hi
> >
> > Would it be possible with GStreamer to playout mutiple RTP sources
> > synchronized if the playout for each source takes place in its own
> > process?
>
> Short answer: yes.
>
> See the example applications here:
>
> http://cgit.freedesktop.org/gstreamer/gst-rtsp-server/tree/examples/test-netclock-client.c
>
> http://cgit.freedesktop.org/gstreamer/gst-rtsp-server/tree/examples/test-netclock.c
>
> Instead of sharing a network clock, you could also share a GStreamer
> NTP or PTP clock, or alternatively set the system clock with wall clock
> time on the pipelines and synchronize the system clocks outside
> GStreamer.
>
>
> These examples are doing RTSP, but only to make the setup of the rtpbin
> simpler. What matters is those properties that are set on rtpbin and
> proper selection of the pipeline clock.
>
> --
> Sebastian Dröge, Centricular Ltd · http://www.centricular.com
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150623/08aa2c3b/attachment.html>


More information about the gstreamer-devel mailing list