Deepstream nvurisrcbin reconnect problem

I’m using deepstream on 4 cameras connected locally using RTSP. Since I use python I’m using nvurisrcbin to define rtsp-reconnect-attempts. I set it to -1 (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.). Somehow my code gets stuck in a loop printing “Resetting source -1, attempts:1” and always keep getting attempts 1. What could be the problem?
I tried the same code on my camera locally and when I disconnect the camera it start counting normally (attempts 1, attempts 2, attempts 3…) until it connects again. My specific use case it that my Jetson orin nano and cameras are connected locally to the same network but on a remote location. Does anyone have any idea what could be the problem or a way to fix it? My goal is to get camera connected automatically when it somehow loses connection (I think).
I’m using deepstream with primary model and secondary model in a pipeline (both yolo11 models i.e., .engine files after int8 calibration)
Here are the jetson orin nano specifications:
Cuda: 12.8.93
cuDNN: 9.8.0
TensorRT: 10.7.0.23
Deepstream: 7.1
Jetpack 6.2


  1. nvurisrcbin is opensource. From the code, attempts will increase after each reconnection. I suppose “attemps: 1” is becuase the plugin reconnected again after reconnecting successfully. How many rtsp sources did you test?
  2. could you provide the complete log 1.log by the following cmd.
export GST_DEBUG=3,nvurisrcbin:6 && "the command-line of your application" >1.log 2>1.log
  1. can you reproduce this issue with deepstream_test_3.py? only incluing rtsp-reconenct-interval and rtsp-reconnect-attemps modifications.
  1. I have 4 cameras, i.e. sources
  2. I runned command export GST_DEBUG=3 “the command-line of your application” >1.log 2>1.log (forgot nvurisrcbin:6) and got:
    101:07:00.037270488 2561996 0xffff40006340 WARN v4l2videodec gstv4l2videodec.c:1326:gst_v4l2_video_dec_loop: Decoder is producing too many buffers
    101:07:13.084187381 2561996 0xaaaad56d3a40 WARN nvurisrcbin gstdsnvurisrcbin.cpp:1529:watch_source_status: warning: No data from source since last 15 sec. Trying reconnection
    101:07:13.084725674 2561996 0xffff40007850 WARN default gstrtspconnection.c:1362:writev_bytes: Operation was cancelled
    101:07:13.084783436 2561996 0xffff40007850 WARN rtspsrc gstrtspsrc.c:6607:gst_rtspsrc_try_send: error: Could not send message. (Received end-of-file)
    101:07:13.084853391 2561996 0xffff40007850 WARN rtspsrc gstrtspsrc.c:9034:gst_rtspsrc_pause: error: Could not send message. (Received end-of-file)
    101:07:13.184723119 2561996 0xaaaad56d3a40 WARN rtspsrc gstrtspsrc.c:6196:gst_rtspsrc_loop_send_cmd_and_wait: Timed out waiting for TEARDOWN to be processed.
    101:07:13.184976985 2561996 0xffff40007850 WARN rtspsrc gstrtspsrc.c:6526:gst_rtsp_src_receive_response: receive interrupted
    101:07:13.185027867 2561996 0xffff40007850 WARN rtspsrc gstrtspsrc.c:6624:gst_rtspsrc_try_send: receive interrupted
    101:07:13.185053340 2561996 0xffff40007850 WARN rtspsrc gstrtspsrc.c:8349:gst_rtspsrc_close: TEARDOWN interrupted
    Resetting source -1, attempts: 1
    101:07:16.086070258 2561996 0xaaaad56d3a40 WARN nvurisrcbin gstdsnvurisrcbin.cpp:1529:watch_source_status: warning: No data from source since last 18 sec. Trying reconnection
    101:07:16.086895026 2561996 0xffff40003530 WARN default gstrtspconnection.c:1362:writev_bytes: Operation was cancelled
    101:07:16.086958292 2561996 0xffff40003530 WARN rtspsrc gstrtspsrc.c:6607:gst_rtspsrc_try_send: error: Could not send message. (Received end-of-file)
    101:07:16.087029783 2561996 0xffff40003530 WARN rtspsrc gstrtspsrc.c:9034:gst_rtspsrc_pause: error: Could not send message. (Received end-of-file)
    101:07:16.186936889 2561996 0xaaaad56d3a40 WARN rtspsrc gstrtspsrc.c:6196:gst_rtspsrc_loop_send_cmd_and_wait: Timed out waiting for TEARDOWN to be processed.
    101:07:16.187466222 2561996 0xffff40003530 WARN rtspsrc gstrtspsrc.c:6526:gst_rtsp_src_receive_response: receive interrupted
    101:07:16.187502799 2561996 0xffff40003530 WARN rtspsrc gstrtspsrc.c:6624:gst_rtspsrc_try_send: receive interrupted
    101:07:16.187518832 2561996 0xffff40003530 WARN rtspsrc gstrtspsrc.c:8349:gst_rtspsrc_close: TEARDOWN interrupted
    Resetting source -1, attempts: 1
    101:07:30.095004858 2561996 0xffff40006fd0 ERROR default gstrtspconnection.c:1102:gst_rtsp_connection_connect_with_response_usec: failed to connect: Operation was cancelled
    101:07:30.095086877 2561996 0xffff40006fd0 ERROR rtspsrc gstrtspsrc.c:5238:gst_rtsp_conninfo_connect: Could not connect to server. (Operation interrupted)
    101:07:30.095111806 2561996 0xffff40006fd0 WARN rtspsrc gstrtspsrc.c:8133:gst_rtspsrc_retrieve_sdp: connect interrupted
    101:07:30.095153407 2561996 0xffff40006fd0 WARN rtspsrc gstrtspsrc.c:8216:gst_rtspsrc_open: can’t get sdp
    Resetting source -1, attempts: 2
    101:07:33.095539616 2561996 0xffff4000b150 ERROR default gstrtspconnection.c:1102:gst_rtsp_connection_connect_with_response_usec: failed to connect: Operation was cancelled
    101:07:33.095625827 2561996 0xffff4000b150 ERROR rtspsrc gstrtspsrc.c:5238:gst_rtsp_conninfo_connect: Could not connect to server. (Operation interrupted)
    101:07:33.095648932 2561996 0xffff4000b150 WARN rtspsrc gstrtspsrc.c:8133:gst_rtspsrc_retrieve_sdp: connect interrupted
    101:07:33.095676805 2561996 0xffff4000b150 WARN rtspsrc gstrtspsrc.c:8216:gst_rtspsrc_open: can’t get sdp
    101:07:33.095708167 2561996 0xffff4000b150 WARN rtspsrc gstrtspsrc.c:8877:gst_rtspsrc_play: failed to open stream
    Resetting source -1, attempts: 2
    Opening in BLOCKING MODE
    101:07:46.055609897 2561996 0xffff40005f10 WARN v4l2 gstv4l2object.c:4682:gst_v4l2_object_probe_caps:nvv4l2decoder36:src Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
    NvMMLiteOpen : Block : BlockType = 261
    NvMMLiteBlockCreate : Block : BlockType = 261
    101:07:46.107816897 2561996 0xffff40006fd0 WARN default gstrtspconnection.c:1362:writev_bytes: Operation was cancelled
    101:07:46.107891716 2561996 0xffff40006fd0 WARN rtspsrc gstrtspsrc.c:6607:gst_rtspsrc_try_send: error: Could not send message. (Received end-of-file)
    101:07:46.107953319 2561996 0xffff40006fd0 WARN rtspsrc gstrtspsrc.c:9034:gst_rtspsrc_pause: error: Could not send message. (Received end-of-file)
    101:07:46.158695847 2561996 0xffff40005f10 WARN v4l2 gstv4l2object.c:4682:gst_v4l2_object_probe_caps:nvv4l2decoder36:src Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
    101:07:46.159851764 2561996 0xffff400056b0 WARN bin gstbin.c:2762:gst_bin_do_latency_func: did not really configure latency of 0:00:00.000000000
    101:07:46.160937309 2561996 0xffff40005f10 WARN v4l2videodec gstv4l2videodec.c:2297:gst_v4l2_video_dec_decide_allocation: Duration invalid, not setting latency
    101:07:46.179774258 2561996 0xffff40005f10 WARN v4l2bufferpool gstv4l2bufferpool.c:1130:gst_v4l2_buffer_pool_start:nvv4l2decoder36:pool:src Uncertain or not enough buffers, enabling copy threshold
    101:07:46.207860779 2561996 0xaaaad56d3a40 WARN rtspsrc gstrtspsrc.c:6196:gst_rtspsrc_loop_send_cmd_and_wait: Timed out waiting for TEARDOWN to be processed.
    101:07:46.208934228 2561996 0xffff40006fd0 WARN rtspsrc gstrtspsrc.c:6526:gst_rtsp_src_receive_response: receive interrupted
    101:07:46.208989046 2561996 0xffff40006fd0 WARN rtspsrc gstrtspsrc.c:6624:gst_rtspsrc_try_send: receive interrupted
    101:07:46.209024824 2561996 0xffff40006fd0 WARN rtspsrc gstrtspsrc.c:8349:gst_rtspsrc_close: TEARDOWN interrupted
    Resetting source -1, attempts: 1
    Opening in BLOCKING MODE
    101:07:46.491470348 2561996 0xffff40005f10 WARN v4l2 gstv4l2object.c:4682:gst_v4l2_object_probe_caps:nvv4l2decoder37:src Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
    NvMMLiteOpen : Block : BlockType = 261
    NvMMLiteBlockCreate : Block : BlockType = 261
    101:07:46.597183695 2561996 0xffff40005f10 WARN v4l2 gstv4l2object.c:4682:gst_v4l2_object_probe_caps:nvv4l2decoder37:src Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
    101:07:46.599527754 2561996 0xffff40005f10 WARN v4l2videodec gstv4l2videodec.c:2297:gst_v4l2_video_dec_decide_allocation: Duration invalid, not setting latency
    101:07:46.643199322 2561996 0xffff40005f10 WARN v4l2bufferpool gstv4l2bufferpool.c:1130:gst_v4l2_buffer_pool_start:nvv4l2decoder37:pool:src Uncertain or not enough buffers, enabling copy threshold
    101:07:46.661556092 2561996 0xffff40006340 WARN v4l2bufferpool gstv4l2bufferpool.c:1607:gst_v4l2_buffer_pool_dqbuf:nvv4l2decoder37:pool:src Driver should never set v4l2_buffer.field to ANY
    Opening in BLOCKING MODE
    101:07:49.236303710 2561996 0xffff40006ba0 WARN v4l2 gstv4l2object.c:4682:gst_v4l2_object_probe_caps:nvv4l2decoder38:src Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
    NvMMLiteOpen : Block : BlockType = 261
    NvMMLiteBlockCreate : Block : BlockType = 261
    101:07:49.301718516 2561996 0xffff4000b150 WARN default gstrtspconnection.c:1362:writev_bytes: Operation was cancelled
    101:07:49.301779958 2561996 0xffff4000b150 WARN rtspsrc gstrtspsrc.c:6607:gst_rtspsrc_try_send: error: Could not send message. (Received end-of-file)
    101:07:49.301827224 2561996 0xffff4000b150 WARN rtspsrc gstrtspsrc.c:9034:gst_rtspsrc_pause: error: Could not send message. (Received end-of-file)
    101:07:49.339764268 2561996 0xffff40006ba0 WARN v4l2 gstv4l2object.c:4682:gst_v4l2_object_probe_caps:nvv4l2decoder38:src Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
    Resetting source -1, attempts: 1
    101:07:52.009668735 2561996 0xfffec000b7d0 WARN default gstrtspconnection.c:1362:writev_bytes: Operation was cancelled
    101:07:57.913414681 2561996 0xfffec000b7d0 WARN default gstrtspconnection.c:1362:writev_bytes: Operation was cancelled
    101:08:01.543795742 2561996 0xfffec000b7d0 WARN default gstrtspconnection.c:1362:writev_bytes: Operation was cancelled
    101:08:04.175434179 2561996 0xfffec000b7d0 WARN default gstrtspconnection.c:1362:writev_bytes: Operation was cancelled
    101:08:05.309404992 2561996 0xffff400056b0 WARN default gstrtspconnection.c:1362:writev_bytes: Operation was cancelled
    101:08:05.309467234 2561996 0xffff400056b0 WARN rtspsrc gstrtspsrc.c:6607:gst_rtspsrc_try_send: error: Could not send message. (Received end-of-file)
    101:08:05.309521220 2561996 0xffff400056b0 WARN rtspsrc gstrtspsrc.c:9034:gst_rtspsrc_pause: error: Could not send message. (Received end-of-file)
    101:08:05.409443850 2561996 0xaaaad56d3a40 WARN rtspsrc gstrtspsrc.c:6196:gst_rtspsrc_loop_send_cmd_and_wait: Timed out waiting for TEARDOWN to be processed.
    101:08:05.409824985 2561996 0xffff400056b0 WARN rtspsrc gstrtspsrc.c:6526:gst_rtsp_src_receive_response: receive interrupted
    101:08:05.409886843 2561996 0xffff400056b0 WARN rtspsrc gstrtspsrc.c:6624:gst_rtspsrc_try_send: receive interrupted
    101:08:05.409924188 2561996 0xffff400056b0 WARN rtspsrc gstrtspsrc.c:8349:gst_rtspsrc_close: TEARDOWN interrupted
    Resetting source -1, attempts: 1
    101:08:06.941271704 2561996 0xffff4937c480 WARN default gstrtspconnection.c:1362:writev_bytes: Operation was cancelled
    101:08:11.864529684 2561996 0xffff4937c480 WARN default gstrtspconnection.c:1362:writev_bytes: Operation was cancelled
    101:08:17.147360366 2561996 0xffff4937c480 WARN default gstrtspconnection.c:1362:writev_bytes: Operation was cancelled
    101:08:21.317702699 2561996 0xffff4000b150 WARN default gstrtspconnection.c:1362:writev_bytes: Operation was cancelled
    101:08:21.317778446 2561996 0xffff4000b150 WARN rtspsrc gstrtspsrc.c:6607:gst_rtspsrc_try_send: error: Could not send message. (Received end-of-file)
    101:08:21.317850033 2561996 0xffff4000b150 WARN rtspsrc gstrtspsrc.c:9034:gst_rtspsrc_pause: error: Could not send message. (Received end-of-file)
    101:08:21.417728342 2561996 0xaaaad56d3a40 WARN rtspsrc gstrtspsrc.c:6196:gst_rtspsrc_loop_send_cmd_and_wait: Timed out waiting for TEARDOWN to be processed.
    101:08:21.440422368 2561996 0xffff4000b150 WARN rtspsrc gstrtspsrc.c:6526:gst_rtsp_src_receive_response: receive interrupted
    101:08:21.440532612 2561996 0xffff4000b150 WARN rtspsrc gstrtspsrc.c:6624:gst_rtspsrc_try_send: receive interrupted

and keeps going…

  1. deepstream_test_3.py uses uridecodebin not nvurisrcbin

Thanks for the sharing!

  1. from the log “Resetting source -1, attempts: 2”, attempts is not always from 1.
  2. could you run the application with "export GST_DEBUG=3,nvurisrcbin:6?wondering the printing of nvurisrcbin plugin. you can redirect the log to the a file, then compress the file wth ‘zip’ tool.
  3. deepstream-test3 supports nvurisrcbin when using “–file-loop”.

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.