<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div>Heya !<br><br></div>In order to do "1-to-N" video streaming, I'm currently using nginx with the rtmp module on a dedicated server.<br></div>But the need to reduce the video delay between the host and the viewer began to arise. The current delay is around 5 seconds, and I'd like it to be under 1 second.<br><br></div>To reduce the delay, I'd like to stream over udp/rtp thanks to rtsp.<br><br></div>I had a look at the examples of gst-rtsp-server. Thanks to them:<br></div>- I succeeded to deliver a video to several clients (test-readme, test-launch and test-mp4)<br></div>- I succeeded to receive a video from OBS [1] (using custom ffmpeg output)<br></div>- I succeeded to record into a file on the server the stream emitted from OBS<br><br></div>Unfortunately, I don't know how to "connect" the "record" pipeline to the "play" pipelines.<br></div>I tried using fdsink/fdsrc, or tcpserversink with localhost, without success.<br><br></div>How would you do such thing; use gst-rtsp-server to receive a stream (RECORD) and dispatch them through clients (PLAY) ?<br><br></div>Here's my base code around which I'm working, nothing fancy though:<br>--------------------------------<br>#!/usr/bin/python3<br><br>import sys<br>import gi<br>gi.require_version('Gst', '1.0')<br>gi.require_version('GstRtspServer', '1.0')<br>from gi.repository import GObject, Gst, GstRtspServer<br><br>if __name__ == "__main__":<br>    GObject.threads_init()<br>    loop = GObject.MainLoop()<br>    Gst.init(None)<br><br>    server = GstRtspServer.RTSPServer()<br>    server.set_service('8554')<br><br>    factory = GstRtspServer.RTSPMediaFactory()<br>    factory.set_launch("( decodebin name=depay0 ! fakesink decodebin name=depay1 ! fakesink )")<br>    factory.set_shared(True)<br>    factory.set_transport_mode(GstRtspServer.RTSPTransportMode.RECORD)<br><br>    server.get_mount_points().add_factory("/input", factory)<br><br>    server.attach(None)<br>    print("stream ready at rtsp://<a href="http://51.254.33.165:8554/input">51.254.33.165:8554/input</a>")<br><br>    loop.run()<br>--------------------------------<div><div><div><div><div><div><br></div><div>Thank you for your help,<br></div><div>Cordially,<br></div><div>Adrien<br></div><div><br>[1] <a href="https://obsproject.com/">https://obsproject.com/</a><br></div></div></div></div></div></div></div>