Synchronizing multiple RTP sources

Peter Maersk-Moller pmaersk at
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 !

But each receiver needs to have a pipeline like this:


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 ! \

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
   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.

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

> 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:
> 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 ·
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gstreamer-devel mailing list