Detect if RTSP stream stops

I am using a multistreaming pipeline based on Python test App 3 and I want to alert/Log whenever an rtsp stream stops. Right now, It automatically removes it from the pipeline, and the rest of the streams remain unaffected but I want to Log that information, How can I access that? I noticed that the streammux.get_static_pad(padname) is not None. Is there any way for detecting it?

@lakshay.chhabra How did you remove and start again the RTSP from the pipeline?

Suppose if I switch off the camera or my ISP blocks some port where my Camera port forwarding was set then the RTSP will stop.

I’m getting the same error, but my pipeline stops when some RTSP packages fail to delivery. I’m waiting for replies on your question. I just want to restart connection without stop the pipeline.

In your case you can just restart the pipeline. Just remove sys.exit() from try block and keep on calling the main function in an infinite loop. My issue is I wanna know which streams stopped.

1 Like

We can create a new thread and use TCP to detect it

+1,same probelm

1 Like

I don’t want to overcomplicate the system as the thread will run say every 30 secs for 20 streams will decrease FPS in the overall run, Also I want to unref the assigned values associated with that stream too.

Errors can be caught in bus_call.However, if you use uridecodebin, this component will automatically reconnect 3 times, and if the reconnection fails, an error will be reported.Then you can set a signal to dynamically delete or add sources (I set a global variable, this method is not good)

Hi, When the camera stops working, it just throws EOS in bus call and no info about which stream threw it. The reconnection error is not reported IDK why.

@lakshay.chhabra Please refer to deepstream-test3 sample application. You can use gst_nvmessage_parse_stream_eos() to get the stream_id of the EOS message.

@Fiona.Chen I m trying to implement this in python, there is no documentation of this function in PyGObject API Reference and even gst/gstmessage.c · 1.18.4 · GStreamer / gstreamer · GitLab

I can see, it is using gst_nvmessage. Can you please guide me towards the right documentation or the right syntax for implementation in python.

This is nvidia interface. No python binding. Please refer to DeepStream c/c++ sample code. Messaging API — Deepstream Deepstream Version: 5.1 documentation