Synchronization of multiple senders using rtpBin

Sebastian Dröge sebastian at centricular.com
Wed Nov 4 10:18:24 PST 2015


On Mi, 2015-11-04 at 07:41 -0800, andrew2412 wrote:
> Dear GST-devs,
> 
> I am using gstreamer pipelines to send packets with encoded audio and
> to receive those packets, decode and play/save the audio on the
> receiver. My case differs from other similar applications, because I
> have many senders and only one receiver. I'd like to have streams
> from all senders synchronised, so I use RTPbin with property
> rtpjitterbuffer-mode set to "4" - synced receiver and sender clocks.
> System clocks on all devices are synchronized outside the gstreamer
> just before streaming (no clock update during the streaming).
> 
> Problem: I have observed that streams from different senders are
> shifted in time by at least several microseconds. Exact number of ms
> changes with time of recording - at the beginning the difference is
> very low, and after a couple of minutes I see that the difference
> gets bigger. Also, when turning the streaming app on and off again,
> the initial difference seems to be random.  My test signal is
> metronom, so I can compare streams in an easier way.
> 
> Can you please give me some advice on how to minimise the time
> difference between streams from multiple senders?
> Second thing, I have a concern that the RTPJitterBuffer in RTPbin
> element does not use NTP time from RTCP SR packets  - is that so?

I was talking about this at the GStreamer conference this year, maybe
you'd like to start with watching that :)
https://gstconf.ubicast.tv/videos/synchronised-multi-room-media-playback-and-distributed-live-media-processing-and-mixing-with-gstreamer/

In any case, basically what you need to do is:
1) use the same (!) clock as pipeline clock on all senders and the
receiver, e.g. an NTP or PTP clock
2) use ntp-time-source=3 (clock-time) on the rtpbin on the senders and
the receiver. Then the SR NTP times are based on the pipeline clock
time
3) use rtcp-sync-send-time=false on the rtpbin on the senders. Then
all senders will put times based on the capture times into the SR,
not the send time. You care about when the frame was captured, not
when it was sent
4) use buffer-mode=4 (synced) on the rtpbin on the receiver
5) use ntp-sync=true on the rtpbin on the receiver, then it will sync
things based on the NTP time of the SRs

You need GIT 1.6.0 for all this except for 3), for that one you need
GIT master unfortunately.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20151104/bef2e33e/attachment-0001.sig>


More information about the gstreamer-devel mailing list