Syncing two live streams
Andrew Silby
asilby at yahoo.com
Tue Jun 12 22:43:43 UTC 2018
Hi Scott,
Try something like this:
Have a look at the examples here:
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-rtpbin.html
Or try something like this:
Computer 1
gst-launch-1.0 rtpbin name=rtpbin rtp-profile=avpf rtcp-sync-send-time=false
videotestsrc is-live=true ! video/x-raw,width=1280,height=720,framerate=20/1
! queue ! clockoverlay ! videoconvert ! vp8enc !
video/x-vp8,width=1280,height=720,framerate=20/1 ! queue ! rtpvp8pay !
rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink host=127.0.0.1
port=10000 rtpbin.send_rtcp_src_0 ! udpsink host=127.0.0.1 port=10001
sync=false async=false udpsrc port=10002 ! rtpbin.recv_rtcp_sink_0
Computer 2
gst-launch-1.0 rtpbin name=rtpbin rtp-profile=avpf rtcp-sync-send-time=false
videotestsrc is-live=true ! video/x-raw,width=1280,height=720,framerate=20/1
! queue ! clockoverlay ! videoconvert ! vp8enc !
video/x-vp8,width=1280,height=720,framerate=20/1 ! queue ! rtpvp8pay !
rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink host=127.0.0.1
port=10003 rtpbin.send_rtcp_src_0 ! udpsink host=127.0.0.1 port=10004
sync=false async=false udpsrc port=10005 ! rtpbin.recv_rtcp_sink_0
Computer 3
gst-launch-1.0 rtpbin name=rtpbin2 rtp-profile=avpf compositor
name=convert sink_0::xpos=0 sink_0::ypos=0 sink_0::zorder=0
sink_1::xpos=640 sink_1::ypos=360 sink_1::zorder=1 ! videoscale !
video/x-raw,width=1280,height=720,framerate=20/1 ! videoconvert ! queue
max-size-buffers=0 max-size-bytes=0 max-size-time=0 ! autovideosink udpsrc
caps="application/x-rtp,media=(string)video, clock-rate=(int)90000,
encoding-name=(string)VP8, payload=96" port=10000 ! rtpbin2.recv_rtp_sink_0
rtpbin2. ! rtpvp8depay ! vp8dec ! videorate ! queue max-size-buffers=0
max-size-bytes=0 max-size-time=0 !
video/x-raw,width=1280,height=720,framerate=20/1 ! videoconvert !
convert.sink_0 udpsrc port=10001 ! rtpbin2.recv_rtcp_sink_0
rtpbin2.send_rtcp_src_0 ! udpsink host=127.0.0.1 port=10002 sync=false
async=false udpsrc caps="application/x-rtp,media=(string)video,
clock-rate=(int)90000, encoding-name=(string)VP8, payload=96" port=10003 !
rtpbin2.recv_rtp_sink_1 rtpbin2. ! rtpvp8depay ! vp8dec ! videorate ! queue
max-size-buffers=0 max-size-bytes=0 max-size-time=0 !
video/x-raw,width=1280,height=720,framerate=20/1 ! videoconvert !
convert.sink_1 udpsrc port=10004 ! rtpbin2.recv_rtcp_sink_1
rtpbin2.send_rtcp_src_1 ! udpsink host=127.0.0.1 port=10005 sync=false
async=false
You can add in audio as well in a similar way. I do exactly what you're
describing below at the rtpbin framework is excellent.
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list