Rtsp reconnect question

Hardware Platform: Jetson AGX Orin
DeepStream Version: 6.4
JetPack Version: 6.0
TensorRT Version: 6.0
Issue Type: Questions

Error Log:

2024-05-17 15:39:07.539 | ERROR    | utils.utils:bus_call:81 - Warning from element: src, gst-resource-error-quark: Could not open resource for reading and writing. (7)

2024-05-17 15:39:07.540 | ERROR    | utils.utils:bus_call:82 - Warning details: ../gst/rtsp/gstrtspsrc.c(8130): gst_rtspsrc_retrieve_sdp (): /GstPipeline:pipeline0/GstBin:source-bin-10/GstDsNvUriSrcBin:uri-decode-bin/GstRTSPSrc:src:
Failed to connect. (Timeout while waiting for server response)

2024-05-17 15:43:47.810 | ERROR    | utils.utils:bus_call:81 - Warning from element: uri-decode-bin, gst-stream-error-quark: No data from source rtsp://admin:jxyw12345@192.168.10.25:554/cam/realmonitor?channel=1&subtype=0 since last 300 sec. Trying reconnection (1)

2024-05-17 15:43:47.811 | ERROR    | utils.utils:bus_call:82 - Warning details: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvdsbins/gstdsnvurisrcbin.cpp(1286): watch_source_status (): /GstPipeline:pipeline0/GstBin:source-bin-10/GstDsNvUriSrcBin:uri-decode-bin

Explanation and Query:
When using nvurisrcbin to process RTSP input streams and setting uri_decode_bin.set_property("rtsp-reconnect-interval", 300), if one of the input streams cannot be connected, a reconnection attempt is made. However, after this, the entire pipeline stops working. I want to know how to ensure that while waiting for the faulty RTSP input stream, the other input streams in the pipeline continue to run normally.

English Supplementary Explanation:
When using nvurisrcbin to handle RTSP input streams and setting uri_decode_bin.set_property("rtsp-reconnect-interval", 300), if one of the input streams fails to connect, a reconnection attempt is made. After this reconnection attempt, the entire pipeline stops working. I want to know how to ensure that while waiting for the faulty RTSP input stream, the other input streams in the pipeline continue to function normally.

Can you tell us which application you are using?

Multi-input stream modified based on deepstream-rtsp-in-rtsp-out

With DeepStream 7.0 GA and Orin AGX, I’ve tried with the deepstream_python_apps/apps/deepstream-test3 at master · NVIDIA-AI-IOT/deepstream_python_apps (github.com) sample with " uri_decode_bin.set_property(“rtsp-reconnect-interval”,25)" and " uri_decode_bin.set_property(“rtsp-reconnect-attempts”, 20)" settings. It works with rtsp reconnection. When there is one stream broken, the other works as normal.

Please upgrade to JetPack 6.0 GA and DeepStream 7.0 GA.

Thank you. During the operation of the program, if one stream is interrupted, another can still function properly; this process can be completed successfully.
My requirement is: before running the program, prepare two RTSP input streams, with one of them being problematic. Under such circumstances, running the program will lead to a situation where if one stream fails, the other cannot operate either. The pipeline becomes blocked, neither exiting nor operating normally.

For starting with broken RTSP case, it also works with DeepStream 7.0. Please upgrade to DeepStream 7.0 GA and try.

I have upgraded to version 7.0 and am using uri_decode_bin . I have set uri_decode_bin.set_property("rtsp-reconnect-interval", 25) and uri_decode_bin.set_property("rtsp-reconnect-attempts", 20) .
However, when I use two streams and one of them is abnormal, the pipeline still does not run properly.
The program did not exit but also did not run properly. It seems to be stuck in a blocked state.
My approach was to use a bad RTSP input stream and a good one before running the program, rather than using two normal input streams and then making one of them abnormal after the program starts.

Below is the program log using GST_DEBUG=*2

2024-05-23 17:31:05.003 | INFO     | __main__:main:155 - Starting pipeline 

Opening in BLOCKING MODE 
0:00:00.300153296 1360070     0x357960c0 WARN                    v4l2 gstv4l2object.c:4634:gst_v4l2_object_probe_caps:<encoder6:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
Opening in BLOCKING MODE 
0:00:00.327407644 1360070     0x357960c0 WARN                    v4l2 gstv4l2object.c:4634:gst_v4l2_object_probe_caps:<encoder5:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
Opening in BLOCKING MODE 
0:00:00.353556725 1360070     0x357960c0 WARN                    v4l2 gstv4l2object.c:4634:gst_v4l2_object_probe_caps:<encoder4:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
Opening in BLOCKING MODE 
0:00:00.378421398 1360070     0x357960c0 WARN                    v4l2 gstv4l2object.c:4634:gst_v4l2_object_probe_caps:<encoder3:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
Opening in BLOCKING MODE 
0:00:00.402353863 1360070     0x357960c0 WARN                    v4l2 gstv4l2object.c:4634:gst_v4l2_object_probe_caps:<encoder2:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
Opening in BLOCKING MODE 
0:00:00.426785216 1360070     0x357960c0 WARN                    v4l2 gstv4l2object.c:4634:gst_v4l2_object_probe_caps:<encoder1:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
Opening in BLOCKING MODE 
0:00:00.450712368 1360070     0x357960c0 WARN                    v4l2 gstv4l2object.c:4634:gst_v4l2_object_probe_caps:<encoder0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:00.529038392 1360070     0x362722a0 ERROR                default gstrtspconnection.c:1102:gst_rtsp_connection_connect_with_response_usec: failed to connect: Could not connect to localhost: Connection refused
0:00:00.529090233 1360070     0x362722a0 ERROR                rtspsrc gstrtspsrc.c:5238:gst_rtsp_conninfo_connect:<src> Could not connect to server. (Generic error)
0:00:00.529109849 1360070     0x362722a0 WARN                 rtspsrc gstrtspsrc.c:8130:gst_rtspsrc_retrieve_sdp:<src> error: Failed to connect. (Generic error)
0:00:00.529171162 1360070     0x362722a0 WARN                 rtspsrc gstrtspsrc.c:8216:gst_rtspsrc_open:<src> can't get sdp
0:00:00.529196251 1360070     0x362722a0 WARN                 rtspsrc gstrtspsrc.c:8877:gst_rtspsrc_play:<src> failed to open stream
0:00:00.529207195 1360070     0x362722a0 WARN                 rtspsrc gstrtspsrc.c:6227:gst_rtspsrc_loop:<src> we are not connected
0:00:25.524796670 1360070     0x357960c0 WARN             nvurisrcbin gstdsnvurisrcbin.cpp:1412:watch_source_status:<uri-decode-bin> warning: No data from source since last 25 sec. Trying reconnection
Resetting source -1, attempts: 1
2024-05-23 17:31:30.347 | WARNING  | utils.utils:bus_call:89 - Warning from element: uri-decode-bin, code: 1, domain: gst-stream-error-quark, msg: No data from source since last 25 sec. Trying reconnection

0:00:25.528483713 1360070     0x362722a0 ERROR                default gstrtspconnection.c:1102:gst_rtsp_connection_connect_with_response_usec: failed to connect: Could not connect to localhost: Connection refused
0:00:25.528560418 1360070     0x362722a0 ERROR                rtspsrc gstrtspsrc.c:5238:gst_rtsp_conninfo_connect:<src> Could not connect to server. (Generic error)
0:00:25.528601571 1360070     0x362722a0 WARN                 rtspsrc gstrtspsrc.c:8130:gst_rtspsrc_retrieve_sdp:<src> error: Failed to connect. (Generic error)
0:00:25.528683876 1360070     0x362722a0 WARN                 rtspsrc gstrtspsrc.c:8216:gst_rtspsrc_open:<src> can't get sdp
0:00:25.528714277 1360070     0x362722a0 WARN                 rtspsrc gstrtspsrc.c:8877:gst_rtspsrc_play:<src> failed to open stream
0:00:25.528742118 1360070     0x362722a0 WARN                 rtspsrc gstrtspsrc.c:6227:gst_rtspsrc_loop:<src> we are not connected
2024-05-23 17:31:30.348 | WARNING  | utils.utils:bus_call:91 - Warning detail: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvdsbins/gstdsnvurisrcbin.cpp(1412): watch_source_status (): /GstPipeline:pipeline0/GstBin:source-bin-06/GstDsNvUriSrcBin:uri-decode-bin

2024-05-23 17:31:30.350 | WARNING  | utils.utils:bus_call:89 - Warning from element: src, code: 7, domain: gst-resource-error-quark, msg: Could not open resource for reading and writing.

2024-05-23 17:31:30.351 | WARNING  | utils.utils:bus_call:91 - Warning detail: ../gst/rtsp/gstrtspsrc.c(8130): gst_rtspsrc_retrieve_sdp (): /GstPipeline:pipeline0/GstBin:source-bin-06/GstDsNvUriSrcBin:uri-decode-bin/GstRTSPSrc:src:
Failed to connect. (Generic error)

2024-05-23 17:31:30.351 | INFO     | utils.utils:send_request_by_code:127 - device_id: 51 

0:00:28.527948846 1360070     0x357960c0 WARN             nvurisrcbin gstdsnvurisrcbin.cpp:1412:watch_source_status:<uri-decode-bin> warning: No data from source since last 26 sec. Trying reconnection


The reconnection only works when the RTSP session is live. If there is any error with the connection, the bus call may be triggerred. Can you check whether the bus error is triggered in your case?

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

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