RTSP camera reconnect issue

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson)
• DeepStream Version - 6.0
• JetPack Version - 4.6.3
• TensorRT Version - 8.2
• Issue Type( questions, new requirements, bugs)

I am using RTSP camera , the app is running fine but sometimes camera disconnected due to network issues. During this time app trying to reconnect the camera once the network is back. But it is not able to connect just show below error-

WARNING from src_elem0: Could not read from resource.
Debug info: gstrtspsrc.c(5293): gst_rtspsrc_loop_udp (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstRTSPSrc:src_elem0:
Unhandled return value -7.
ERROR from src_elem0: Could not read from resource.
Debug info: gstrtspsrc.c(5361): gst_rtspsrc_loop_udp (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstRTSPSrc:src_elem0:
Could not receive message. (System error)
ERROR from src_elem0: Internal data stream error.
Debug info: gstrtspsrc.c(5653): gst_rtspsrc_loop (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstRTSPSrc:src_elem0:
streaming stopped, reason error (-5)
*** INFO: <reset_source_pipeline:1538>: Resetting source 0*
ERROR from src_elem0: Could not write to resource.
Debug info: gstrtspsrc.c(5997): gst_rtspsrc_try_send (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstRTSPSrc:src_elem0:
Could not send message. (System error)
ERROR from src_elem0: Could not write to resource.
Debug info: gstrtspsrc.c(8244): gst_rtspsrc_pause (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstRTSPSrc:src_elem0:
Could not send message. (System error)
WARNING from src_elem0: Could not read from resource.
Debug info: gstrtspsrc.c(5280): gst_rtspsrc_loop_udp (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstRTSPSrc:src_elem0:
The server closed the connection.
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261

I am not able to find it’s root cause why it is not able to reconnect back only one solution is to restart the app and it works fine,

please help me to solve the issue and also provide the workaround so it can auto terminate when the reconnects attempts exceeds. SO our script can auto restart the app automatically.

I have attached the pipeline-
source.txt (6.5 KB)

Something is wrong with the RTSP server, please check the RTSP server side.

Hi
I have checked the RTSP server , it is running fine .
The only issue is if camera disconnected from the app due to network then the app is not able to reconnect back the only solution is to restart the app.
if there is any rtsp server issue then it should not able to connect after the app restart also .

Please pay attention to the error, it is the RTSP server refused the connection. Please check with the RSTP server.

Ok , I will check.
Could you help me to stop the app when the reconnect attempts exceed so it can restart automatically.

You can stop the pipeline and restart the whole pipeline from beginning when you find out the RTSP server is ready.

Hi,

I can manually handle it, but I am using smart records where I have defined one parameter → rtsp-reconnect-attempts = 20. So, I want to know what happens when the reconnect attempts exceed 20. Does it shut down the app or pause it?

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

You need to call “NvDsSRStop()” and “NvDsSRDestroy()” explicitly to stop smart recording.
https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Smart_video.html

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