Camera FPS drops to 0 after sometime

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson
• DeepStream Version 7.0
• JetPack Version (valid for Jetson only) 6.0
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

I am using a deepstream-imagedata-multistream sample application on rtsp cameras and I was getting the pixelated frame issue which was fixed by these two methods

def decodebin_child_added(child_proxy, Object, name, user_data):
    print("Decodebin child added:", name, "\n")
    if name.find("decodebin") != -1:
        Object.connect("child-added", decodebin_child_added, user_data)

    if "source" in name:
        Object.set_property('latency',0)
        Object.set_property("drop-on-latency", True)

Here I have set the latency to 0

Another way that I used was to replace the uridecodebin element with these ones


def on_pad_added(element, element_src_pad, data):
    print("In cb_newpad\n")
    caps = element_src_pad.get_current_caps()
    str = caps.get_structure(0)
    name = str.get_name()
    depay_elem = data

    media = str.get_string("media")
    is_video = media == 'video'
    if 'x-rtp' in name and is_video is True:
        print('Start binding RTSP')
        sinkpad = depay_elem.get_static_pad("sink")
        state = element_src_pad.link(sinkpad)
        if state != Gst.PadLinkReturn.OK:
            print('Unable to link depay loader to rtsp src')
        else:
            print('Binding RTSP successfully')
    else:
        print('Cannot be bound,get_name=', name, ' , media=', media)


for idx, camera in enumerate(self.cameras_list):
            logger.info(f"Creating source_bin {idx} \n")
            uri_name = camera.camera_uri
            if "rtsp://" in uri_name:
                is_live = True
            # source_bin = create_source_bin(uri_name, idx)
            # if not source_bin:
            #     logger.error("Unable to create source bin \n")
            #     raise Exception("Unable to create source bin")
            # self.pipeline.add(source_bin)

            source = Gst.ElementFactory.make("rtspsrc", f"rtspsrc{idx}")
            source.set_property("latency", 0)  #
            source.set_property("protocols", "tcp")
            source.set_property("location", uri_name)
            
            depay = Gst.ElementFactory.make("rtph264depay", f"depay{idx}")
            source.connect('pad-added', on_pad_added, depay)
            h264parser = Gst.ElementFactory.make("h264parse", f"h264parse{idx}")
            decoder = Gst.ElementFactory.make("nvv4l2decoder", f"decoder{idx}")
            self.pipeline.add(source)
            self.pipeline.add(depay)
            self.pipeline.add(h264parser)
            self.pipeline.add(decoder)

            source.link(depay)
            depay.link(h264parser)
            h264parser.link(decoder)

            padname = "sink_%u" % idx
            sinkpad = streammux.get_request_pad(padname)
            if not sinkpad:
                logger.error("Unable to create sink pad bin \n")
                raise Exception("Unable to create sink pad bin")
            srcpad = decoder.get_static_pad("src")
            if not srcpad:
                logger.error("Unable to create src pad bin \n")
                raise Exception("Unable to create src pad bin")
            srcpad.link(sinkpad)

If I set the latency value other than 0. I am getting pixelated frames in all cases.
As I am running the pipeline on 16 cameras with 0 latency, after sometime (5 to 10 mins), the FPS of camera starts dropping to 0 and at the end only 2 camera are working.

Have you measured the loading of your board with “tegrastats” when you run your case?

Is there any way to reconnect the camera after camera disconnection

09-10-2024 04:29:20 RAM 10173/15656MB (lfb 67x4MB) SWAP 15/7828MB (cached 0MB) CPU [39%@1497,27%@1497,31%@1497,26%@1497,50%@1497,37%@1497,32%@1497,31%@1497] GR3D_FREQ 99% cv0@48.031C cpu@51.437C soc2@48.375C soc0@49.937C cv1@48.468C gpu@50.25C tj@51.437C soc1@51.375C cv2@48.25C VDD_IN 12032mW/11582mW VDD_CPU_GPU_CV 2907mW/2693mW VDD_SOC 4044mW/3933mW

These are the tegrastats

Yes. We have rtsp reconnection c/c++ sample in deepstream-app

The GPU loading is 99%, the pipeline will drop the frames when the frames can’t reach to the sink in time.

Is there any way to use the re connection in python binding?

You may try to use nvurisrcbin Gst-nvurisrcbin — DeepStream documentation 6.4 documentation as the source of your pipeline

Thanks, I am using it and it is working

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