Synchronizing multiple RTP sources

Peter Maersk-Moller pmaersk at gmail.com
Mon Jun 22 15:00:53 PDT 2015


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?

Assume you have multiple independent systems with NTP each running the
following pipeline:

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.

On the server side we need something 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 \
    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

This ought to work. The server side should receive RTCP sender reports with
NTP wallclock to RTP timestamp mapping. One can hope decodebin gets this
information and use it when demuxing the TS, decode the two elemntary
streams and display the decoded images and plays the audio.

BUT on the receiving side we in this setups receive multiple streams and
run several processes with the above pipeline. How does one go about
synchronizing this?

I could try to run ALL RTP streams and all RTCP sender reports into same
rtpbin and as such run one single pipeline for all receiving streams. Would
that work?

However such a single pipeline solution would have a problem. If not all
sources are initially sending streams, I suspect the big pipeline with all
the streams would never go from PREROLL to PLAYING because some of the
pipeline elements would miss data for the streams not currently running.
And it may or may not stop, if some of the pipeline elements later miss
data. Is this a correct assumption?

Best regards
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150623/f0bfc2a7/attachment-0001.html>


More information about the gstreamer-devel mailing list