How can I use "rtsp-reconnect-attempt" in the uri-decode-bin in the deepstream python app?

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) GPU
• DeepStream Version 6.4
• JetPack Version (valid for Jetson only)
• TensorRT Version 8.6.1
• NVIDIA GPU Driver Version (valid for GPU only) 535

So I was facing some stability issues on the rtsp end, due to which the rtsp tends to disconnect sometimes for for time frame ranging between 10 secs-2 mins. To counter this issue I used the nvurisrcbin in my python app. Please find the code snippet below

    uri_decode_bin=Gst.ElementFactory.make("nvurisrcbin", "uri-decode-bin")
    uri_decode_bin.set_property("rtsp-reconnect-interval",60)

This tends to work well, but with this I’m facing two issues, first being that, if the rtsp gets back up in 10 secs then I’m losing the important data and if takes more than 60 secs, then the pipeline ends. Is there any to way tackle this issue. I saw the rtsp-reconnect-attempts property in the source group documentation for the deepstream-app.

Property:
rtsp-reconnect-attempts

Meaning:
Maximum number of times a reconnection is attempted. Setting it to -1 means reconnection will be attempted infinitely. Valid when type of source is 4 and rtsp-reconnect-interval-sec is a non-zero positive value.

Type:
Integer, ≥-1

Example:
rtsp-reconnect-attempts=2

Is there any way to implement this in python pipeline as there is no specific documentation related to this available.

gst-inspect-1.0 nvurisrcbin|grep rtsp
  rtsp-reconnect-attempts: Set rtsp reconnect attempt value
  rtsp-reconnect-interval: Timeout in seconds to wait since last data was received from an RTSP source before forcing a reconnection. 0=disable timeout

As the log shown above, nvurisrcbin supports rtsp-reconnect-attempts. you can set the property in Python code.

Getting this error when used the following code in the python pipeline:

Code:

    uri_decode_bin=Gst.ElementFactory.make("nvurisrcbin", "uri-decode-bin")
    uri_decode_bin.set_property("rtsp-reconnect-interval",10)
    uri_decode_bin.set_property("rtsp-reconnect-attempts",6)

Error:

Traceback (most recent call last):
  File "/home/ubuntu/eci/deepstream_app/deepstream_app/test1/deepstream-nvdsanalytics/app2/deepstream_prominance.py", line 728, in <module>
    sys.exit(main(config))
  File "/home/ubuntu/eci/deepstream_app/deepstream_app/test1/deepstream-nvdsanalytics/app2/deepstream_prominance.py", line 386, in main
    source_bin=create_source_bin(i, uri_name)
  File "/home/ubuntu/eci/deepstream_app/deepstream_app/test1/deepstream-nvdsanalytics/app2/deepstream_prominance.py", line 317, in create_source_bin
    uri_decode_bin.set_property("rtsp-reconnect-attempts",6)
TypeError: object of type `GstDsNvUriSrcBin' does not have property `rtsp-reconnect-attempts'

Also I got this response on running the following command:

gst-inspect-1.0 nvurisrcbin|grep rtsp

  rtsp-reconnect-interval: Timeout in seconds to wait since last data was received from an RTSP source before forcing a reconnection. 0=disable timeout
  smart-rec-container : Container format of recorded video. MP4 and MKV containers are supported. Sources must be of type source-type-rtsp
  smart-record        : Enable Smart Record and choose the type of events to respond to. Sources must be of type source-type-rtsp
  type                : Set the type of source. Use source-type-rtsp to use smart record features
                           (2): rtsp             - Customize for RTSP, supports smart recording
  uri                 : URI of the file or rtsp source

DeepStream7.0 supports this feature.

Got it fanzh. Let me setup Deepstream 7.0 and check this out.

Sorry for the late reply, Is this still an DeepStream issue to support? Thanks!

The issue was solved with Deepstream 7.0
Thank you

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