Stream Disconnects In Deepstream Pipeline

I am trying to create a pipeline for my use-case using deepstream Python binding. Pipeline is complete and running well. I have taken reference from nvdsanalytics. My pipeline is using streammux for multiple streams, but the problem is some time may be due to network issues some stream disconnect and don’t reconnect. To start them I have to restart the complete pipeline and all other streams have to start again.

Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
• DeepStream Version
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)
• The pipeline being used

My pipeline can run on jetson as well as on GPU. As of now we are using jetson nano, NX,AGX and T4. Deepstream version for nano is 6.0.1 for others is 6.2. Tensorrt is 8. I just want to know how I can handle disconnection of streams without restarting complete pipeline

please refer to How to use this "gst_element_send_nvevent_new_stream_reset" to reconnect rtsp stream in python
the C rtsp-reconnect mechanism can works fine, currently you might port it to python version.

I checked the answer but that blog suggests it is in C++ can you suggest something in Python.

there are whole reconnectiong logics in c code, you need to port it to python code.
please refer to tsp_reconnect_attempts and rtsp-reconnect-interval
and rtspsrc_monitor_probe_func, you need to add a probe function to get buffer 's time, then add a watch_source_status to check if rtsp source is disconnected based on buffer’s time.

please can you give me the link i can’t find the rtsp_reconnect_attempts and rtsp-reconnect-interval

they are in deepstream sdk. please find them in opt\nvidia\deepstream\deepstream-6.2\sources\apps\apps-common\src\deepstream_source_bin.c.

here is another solution, you can use nvurisrcbin plugin, which supports rtsp reconnection. here is a sample:
gst-launch-1.0 -v nvurisrcbin uri=rtsp://127.0.0.1:8554/test rtsp-reconnect-interval=5 ! nv3dsink

okay i will give it a try and will tell if it works

It worked thanks so much. Just use nvurisrcbin in place of urdecodebin and set uri_decode_bin.set_property(“rtsp-reconnect-interval”,1) where 1 is interval to reconnect stream.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.