<div dir="ltr">HI Nicolas, <div>Thanks a lot for your Response. </div><div>If I have to recreate the rtspsrc element to recover, temporarily pause the pipeline and flush everything downstream. </div><div>Will the rtspsrc make a new connection with SDP negotiations? </div><div>Will that be faster connections than to restart the pipeline?</div><div><br></div><div>Just trying to figure out what is the recommended way. </div><div><br></div><div>Best Regards,</div><div>Guru</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 24, 2023 at 10:17 AM Nicolas Dufresne <<a href="mailto:nicolas@ndufresne.ca" target="_blank">nicolas@ndufresne.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div>Hi,</div><div><br></div><div>Le lundi 22 mai 2023 à 09:13 -0700, Guru Govindan via gstreamer-devel a écrit :</div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr">Hi,<br><div><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px">I am implementing a Gstreamer pipeline in rust to ingest rtsp feed from different cameras. I use the </span><code style="margin:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit;white-space:pre-wrap;color:rgb(35,38,41)">hlssink2</code><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px"> element to create manifest to view/store the video.</span><br></div><div><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px"><br></span></div><div><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px">For some of the cameras, the hlssink2's splitmux element receives a </span><code style="margin:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit;white-space:pre-wrap;color:rgb(35,38,41)">GST_EVENT_EOS</code><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px"> which results in the pipeline stopping.</span><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px"><br></span></div></div></blockquote><div><br></div><div>Indeed, its possible to get EOS from rtspsrc.</div><div><br></div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr"><div><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px"><br></span></div><div><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px">This happens even if I add a </span><code style="margin:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit;white-space:pre-wrap;color:rgb(35,38,41)">bus.add_watch</code><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px"> and capture the </span><code style="margin:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit;white-space:pre-wrap;color:rgb(35,38,41)">gst::MessageView::Eos(state_changed)</code><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px"> event.</span><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px"><br></span></div><div><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px"><br></span></div><div><p style="margin:0px 0px 1.1em;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(35,38,41)">Is there a way to programatically block the EOS message and keep the rtsp connection on?</p></div></div></blockquote><div>Before it becomes a message on the bus, the EOS will travel as an event from source to sink. While they pass through pads, they will set a state on the pad which can be hard to recover from in dynamic pipelines. The best way to get rid of them is to remove them as early as possible. You can do that with a GstPadProbe on the rtspsrc pad(s) and the <i><em><code>GST_PAD_PROBE_DROP return value. Note that you will have to remove and recreate the rtspsrc in order to recover.</code></em></i></div><div><br></div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr"><div><p style="margin:0px 0px 1.1em;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px;vertical-align:baseline;box-sizing:inherit;clear:both;color:rgb(35,38,41)">Here is an example pipeline for which I have a rust implementation.</p><pre style="margin-top:0px;margin-bottom:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto"><code style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;background-color:transparent;white-space:inherit">gst-launch-<span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;font-size:13px;vertical-align:baseline;box-sizing:inherit">1.0</span> hlssink2 name=ingest1 playlist-length=<span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;font-size:13px;vertical-align:baseline;box-sizing:inherit">5</span> max-files=<span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;font-size:13px;vertical-align:baseline;box-sizing:inherit">0</span> target-duration=<span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;font-size:13px;vertical-align:baseline;box-sizing:inherit">10</span> \
send-keyframe-requests=<span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;font-size:13px;vertical-align:baseline;box-sizing:inherit">true</span> playlist-location=/tmp/manifest.m3u8 location=/tmp/video/%t.ts \
rtspsrc latency=<span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;font-size:13px;vertical-align:baseline;box-sizing:inherit">100</span> location=<rtspurl> protocols=<span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;font-size:13px;vertical-align:baseline;box-sizing:inherit">0x00000004</span> name=basesrc basesrc. ! rtph264depay ! tee name=t \
t.! queue  ! ingest1.video</code></pre><pre style="margin-top:0px;margin-bottom:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto"><code style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;background-color:transparent;white-space:inherit"><br></code></pre><pre style="margin-top:0px;margin-bottom:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto"><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px;white-space:normal">I tried using errorignore and set the ignore-eos flag and convert-to=0. I used it right after rtspsrc element and right before hlssink2. However this seems to come from splitmuxsink inside hlssink2.</span><br></pre></div></div></blockquote><div><br></div><div>errorignore works the other way around, by ignore GstFlowReturn values as a result of pad push (chain) function.</div><div><br></div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr"><div><pre style="margin-top:0px;margin-bottom:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto"><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px;white-space:normal"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto"><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px;white-space:normal">Best Regards,</span></pre><pre style="margin-top:0px;margin-bottom:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto"><span style="color:rgb(35,38,41);font-family:-apple-system,"system-ui","Segoe UI Adjusted","Segoe UI","Liberation Sans",sans-serif;font-size:15px;white-space:normal">Guru</span></pre></div></div></blockquote><div><br></div><div>regards,</div><div>Nicolas</div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"></blockquote><div><br></div><div><span></span></div></div>
</div></blockquote></div>