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)