Nvurisrcbin rtsp_reconnect_interval lose efficacy in the end

Please provide complete information as applicable to your setup.

Hardware Platform (Jetson / GPU) GPU
• DeepStream Version 6.2
• JetPack Version (valid for Jetson only)
• TensorRT Version TRT 8.5.2.2
• NVIDIA GPU Driver Version (valid for GPU only) 470.103.01
• Issue Type( questions, new requirements, bugs)

W0619 17:54:47.768914    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not read from resource., gpu_id = 0
W0619 17:54:47.769207    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Internal data stream error., gpu_id = 0
W0619 17:55:51.647127    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00: No data from source rtsp://172.16.19.25:34300/200020241210154010005335276V00000000_0 since last 64 sec. Trying reconnection, gpu_id = 0
W0619 17:55:51.647361    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not read from resource., gpu_id = 0
W0619 17:55:51.647384    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not read from resource., gpu_id = 0
W0619 17:55:51.647397    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not write to resource., gpu_id = 0
W0619 18:15:07.972021    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not read from resource., gpu_id = 0
W0619 18:15:07.972105    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Internal data stream error., gpu_id = 0
W0619 18:15:27.362668    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00: No data from source rtsp://172.16.19.25:34300/200020241210154010005335276V00000000_0 since last 20 sec. Trying reconnection, gpu_id = 0
W0619 18:15:27.362884    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not read from resource., gpu_id = 0
W0619 18:15:27.362906    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not read from resource., gpu_id = 0
W0619 18:15:27.362923    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not write to resource., gpu_id = 0
W0619 18:15:32.366194    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not open resource for reading., gpu_id = 0
W0619 18:15:32.366274    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Not found, gpu_id = 0
W0619 18:15:48.377202    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00: No data from source rtsp://172.16.19.25:34300/200020241210154010005335276V00000000_0 since last 21 sec. Trying reconnection, gpu_id = 0
W0619 18:55:17.320559    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not read from resource., gpu_id = 0
W0619 18:55:17.320690    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Internal data stream error., gpu_id = 0
W0619 18:56:31.887418    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00: No data from source rtsp://172.16.19.24:34300/200020241210154010005335276V00000000_0 since last 74 sec. Trying reconnection, gpu_id = 0
W0619 18:56:31.887635    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not read from resource., gpu_id = 0
W0619 18:56:31.887688    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not read from resource., gpu_id = 0
W0619 18:56:31.887723    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not write to resource., gpu_id = 0
W0620 00:07:29.672544    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not read from resource., gpu_id = 0
W0620 00:07:29.672617    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Internal data stream error., gpu_id = 0
W0620 00:08:19.590073    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00: No data from source rtsp://172.16.19.24:34300/200020241210154010005335276V00000000_0 since last 50 sec. Trying reconnection, gpu_id = 0
W0620 00:08:19.590234    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not read from resource., gpu_id = 0
W0620 00:08:19.590252    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not read from resource., gpu_id = 0
W0620 00:08:19.590263    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not write to resource., gpu_id = 0
W0620 00:08:24.593456    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not open resource for reading., gpu_id = 0
W0620 00:08:24.593518    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Not found, gpu_id = 0
W0620 00:09:11.614037    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00: No data from source rtsp://172.16.19.24:34300/200020241210154010005335276V00000000_0 since last 52 sec. Trying reconnection, gpu_id = 0
W0620 02:40:35.293730    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Could not read from resource., gpu_id = 0
W0620 02:40:35.293794    18 nvgstpipeline.cpp:1192] Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00/GstRTSPSrc:src: Internal data stream error., gpu_id = 0

I have a pipeline with ‘nvurisrcbin → nvstreammux → queue → nvpreprocess → queue → nvinfer ->queue → nvtracker → mysink’

The video stream may disconnect due to network issues, so I have set the rtsp_reconnect_interval=20 property to enable periodic reconnection attempts. However, in some cases, the RTSP URL itself changes, making reconnection attempts ineffective. To handle this, I count the number of “Trying reconnection” occurrences. If this number exceeds a predefined threshold, I remove the device and re-add it to the pipeline.

   case GST_MESSAGE_WARNING:
    {
        GError *error = nullptr;
        gchar *debug = nullptr;
        gchar *eleName = gst_object_get_path_string(msg->src);
        gst_message_parse_warning(msg, &error, &debug);
        if(!g_strrstr(error->message, "No Sources found")) {
            LOG(WARNING) << "Warning from " << eleName << ": " << error->message << ", gpu_id = " << obj->gpu_id;
        }
        else {
            VLOG(2) << "Warning from " << eleName << ": " << error->message << ", gpu_id = " << obj->gpu_id;
        }
//        if (debug != nullptr) {
//            LOG(WARNING) << "debug info: " << debug;
//        }

        // should get message "Trying reconnection"
        // should get message "Trying reconnection"
        // should get message "Trying reconnection"
        if(g_strrstr(error->message, "Trying reconnection")) {
            guint i = 0;
            for (i = 0; i < MAX_NUM_SRCS; i++) {
                if (obj->app_ctx.source_bin[i].srcBin == GST_ELEMENT(msg->src))
                    break;
            }
            if (i != MAX_NUM_SRCS) {
                // Error from one of RTSP source.
                SourceBin *subBin = &(obj->app_ctx.source_bin[i]);
                subBin->recconnect_time += 1;
                if(subBin->recconnect_time >= 1) {
                    LOG(INFO) << "The device disconnected: " << subBin->device_id << ", url: " << subBin->url;
                    Json::Value jsonRoot;
                    jsonRoot["devicecode"] = subBin->device_id;
                    jsonRoot["configtype"] = std::to_string(CaptureEngineParams::alarm_type);
                    jsonRoot["rtspURL"] = subBin->url;
                    jsonRoot["alarmtime"] = QDateTime::currentDateTime().toString("yyyy-MM-ddTHH:mm:ss.zzzZ").toStdString();
                    std::string jsonString = jsonRoot.toStyledString();
                    httpPost(CaptureEngineParams::disconnect_push_url, jsonString);

                    // reset
                    subBin->recconnect_time = 0;
                }
            }
        }

and I use “Trying reconnection” to count, because the rtsp address maybe change ,I have to remove source and add source again.

but when some days later , the source bin would not print "Warning from /GstPipeline:pipeline-0/GstDsNvUriSrcBin:source-bin-00: No data from source rtsp://172.16.19.24:34300/200020241210154010005335276V00000000_0 since last 52 sec. Trying reconnection, gpu_id = 0
"
but the pipeline is running ,because other source bin is running,

and about some hours later or some days later , all source bin would not print “Trying reconnection”,

WHY?


I use interface to delete source and add source, you can see there also no about “Trying reconnection” log.

What is your “rtsp-reconnect-attempts” value of nvurisrcbin?

there are not “rtsp-reconnect-attempts” property in deepstream 6.2 ,So I don’t know how the source code handles this logic — is there a maximum number of reconnection attempts?

Please upgrade to the latest DeepStream version. The nvurisrcbin is open source since DeepStream 7.0. And we also recommend you to use nvmulturisrcbin for the dynamic source add/remove cases. The /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-test5 can be used as the reference.

We have already built a relatively mature system. If we were to upgrade it now, it would take considerable effort and time to handle. Could you help us solve this issue first? We will proceed with the upgrade gradually afterward.

Since the DeepStream 6.2 is a very old version, we have made lots of change and bug fix since then. We can’t guarantee your problem is not related with some bug we have fixed.

The information you provided here is not enough to identify the issue. With the new DeepStream version, you can try with the DeepStream sample to reproduce the issue, then we can reproduce the same issue in our side. It is more useful for us to debug the issue.

Alternatively, could you tell me some of the internal logic of nvurisrcbin in DeepStream 6.2? For example, is there a default maximum number of reconnection attempts? Under what conditions will it stop trying to reconnect?

We only maintain the published source code.

Do these errors indicate a bug in the system?

No. These logs only shows there are some problem with the RTSP streams, but no clue to indicate what the root cause is.

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.