<div dir="ltr">I may be implementing proxysink/src incorrectly but i am having issues. It seems as though proxysrc is either queuing up buffers or there is a timestamping issue. Any help would be greatly appreciated. <div><br></div><div><pre style="white-space:pre-wrap;color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255);font-family:"DejaVu Sans Mono""><font size="1"><span style="color:rgb(128,128,128);font-style:italic">#!/usr/bin/python3<br></span><span style="color:rgb(0,0,128);font-weight:bold">import </span><font color="#000000">gi<br>gi.require_version(</font><span style="color:rgb(0,128,128);font-weight:bold">'Gst'</span><font color="#000000">, </font><span style="color:rgb(0,128,128);font-weight:bold">'1.0'</span><font color="#000000">)<br>gi.require_version(</font><span style="color:rgb(0,128,128);font-weight:bold">'GstRtspServer'</span><font color="#000000">, </font><span style="color:rgb(0,128,128);font-weight:bold">'1.0'</span><font color="#000000">)<br></font><span style="color:rgb(0,0,128);font-weight:bold">from </span><font color="#000000">gi.repository </font><span style="color:rgb(0,0,128);font-weight:bold">import </span><font color="#000000">Gst, GstRtspServer, GObject<br></font><span style="color:rgb(0,128,128);font-weight:bold"><br></span><span style="color:rgb(0,0,128);font-weight:bold">class </span><font color="#000000">RTSP_Factory(GstRtspServer.RTSPMediaFactory):<br>    </font><span style="color:rgb(0,0,128);font-weight:bold">def </span><span style="color:rgb(178,0,178)">__init__</span><font color="#000000">(</font><span style="color:rgb(148,85,141)">self</span><font color="#000000">, pipeline, clock):<br>        </font><span style="color:rgb(148,85,141)">self</span><font color="#000000">.clock=clock<br>        </font><span style="color:rgb(148,85,141)">self</span><font color="#000000">.pipeline = pipeline<br>        GstRtspServer.RTSPMediaFactory.</font><span style="color:rgb(178,0,178)">__init__</span><font color="#000000">(</font><span style="color:rgb(148,85,141)">self</span><font color="#000000">)<br><br>    </font><span style="color:rgb(0,0,128);font-weight:bold">def </span><font color="#000000">do_create_element(</font><span style="color:rgb(148,85,141)">self</span><font color="#000000">, </font><span style="color:rgb(128,128,128)">url</span><font color="#000000">):<br>        </font><span style="color:rgb(148,85,141)">self</span><font color="#000000">.pipeline.set_start_time(Gst.CLOCK_TIME_NONE)<br>        </font><span style="color:rgb(0,0,128);font-weight:bold">return </span><span style="color:rgb(148,85,141)">self</span><font color="#000000">.pipeline<br><br>    </font><span style="color:rgb(0,0,128);font-weight:bold">def </span><font color="#000000">do_configure(</font><span style="color:rgb(148,85,141)">self</span><font color="#000000">, media):<br>        media.set_shared(</font><span style="color:rgb(0,0,128);font-weight:bold">True</span><font color="#000000">)<br><br>Gst.init()<br>GObject.threads_init()<br>loop = GObject.MainLoop()<br>Gst.debug_set_active(</font><span style="color:rgb(0,0,128);font-weight:bold">True</span><font color="#000000">)<br>Gst.debug_set_default_threshold(</font><font color="#0000ff">4</font><font color="#000000">)<br></font><font color="#000000"><br><br>mainpipeline = Gst.parse_launch(</font><span style="color:rgb(0,128,128);font-weight:bold">"nvcamerasrc "<br></span><span style="color:rgb(0,128,128);font-weight:bold">                                "! video/x-raw(memory:NVMM), width=(int)2592, height=(int)1458, format=(string)I420, framerate=(fraction)30/1 "<br></span><span style="color:rgb(0,128,128);font-weight:bold">                                "! omxh264enc bitrate=4000000 profile=2 control-rate=2 insert-sps-pps=true insert-aud=true insert-vui=true iframeinterval=20 "<br></span><span style="color:rgb(0,128,128);font-weight:bold">                                "! video/x-h264, stream-format=byte-stream, profile=(string)main "<br></span><span style="color:rgb(0,128,128);font-weight:bold">                                "! tee ! proxysink name=psink"</span><font color="#000000">)<br><br>rtsppipeline = Gst.parse_launch(</font><span style="color:rgb(0,128,128);font-weight:bold">"proxysrc name=psrc is-live=true ! queue name=rq max-size-buffers=3 ! h264parse ! rtph264pay name=pay0 pt=96 config-interval=1"</span><font color="#000000">)<br></font><font color="#000000"><br><br>sysclock = Gst.SystemClock.obtain()<br><br>psink = mainpipeline.get_by_name(</font><span style="color:rgb(0,128,128);font-weight:bold">"psink"</span><font color="#000000">)<br>psrc = rtsppipeline.get_by_name(</font><span style="color:rgb(0,128,128);font-weight:bold">"psrc"</span><font color="#000000">)<br><br>psrc.set_property(</font><span style="color:rgb(0,128,128);font-weight:bold">"proxysink"</span><font color="#000000">, psink)<br><br>mainpipeline.use_clock(sysclock)<br>rtsppipeline.use_clock(sysclock)<br>mainpipeline.set_base_time(</font><span style="color:rgb(0,0,255)">0</span><font color="#000000">)<br>rtsppipeline.set_base_time(</font><span style="color:rgb(0,0,255)">0</span><font color="#000000">)<br></font><span style="color:rgb(128,128,128);font-style:italic">#mainpipeline.set_start_time(Gst.CLOCK_TIME_NONE)<br></span><font color="#000000">rtsppipeline.set_start_time(Gst.CLOCK_TIME_NONE)<br><br>server = GstRtspServer.RTSPServer()<br>mounts = server.get_mount_points()<br>factory = RTSP_Factory(rtsppipeline, sysclock)<br><br>mounts.add_factory(</font><span style="color:rgb(0,128,128);font-weight:bold">"/test"</span><font color="#000000">, factory)<br>server.attach(</font><span style="color:rgb(0,0,128);font-weight:bold">None</span><font color="#000000">)<br><br>mainpipeline.set_state(Gst.State.PLAYING)<br>loop.run()</font></font></pre><br><div>Regards,</div><div>Chris</div><div><br></div><div><br></div></div></div>