How to control RTSP videorate

Please provide complete information as applicable to your setup.

• Hardware Platform GPU)
**• DeepStream Version 6.0
• TensorRT Version 8
• NVIDIA GPU Driver Version (valid for GPU only) 470
• Issue Type questions

Hi there,
I’m trying to control the videorate of multi RTSP input before they are feed into streammux, so to reduce consumption of GPU.
I’ve tried use the videorate plugin, but confusedly, the videorate doesn’t change at all.

I don’t know where I do wrong. Please give me some hints.

thx.

for i in range(number_sources):
        print("Creating source_bin ",i," \n ")
        uri_name=args[i+1]
        if uri_name.find("rtsp://") == 0 :
            is_live = True
        source_bin=create_source_bin(i, uri_name)
        if not source_bin:
            sys.stderr.write("Unable to create source bin \n")
        pipeline.add(source_bin)

        video_convertor_name = "nvvidconv_%u"%i
        print("Creating nvvidconv ",i ," \n ")
        # Create nvvidcon.
        video_convertor_name = Gst.ElementFactory.make("nvvideoconvert", video_convertor_name)
        if not video_convertor_name:
            sys.stderr.write(" Unable to create nvvidconv",i," \n")
        # video_convertor_name.set_property("average-period", 40)
        pipeline.add(video_convertor_name)

        videorate_name = "videorate_%u"%i
        print("Creating videorate ",i ," \n ")
        # Create videorate.
        videorate_name = Gst.ElementFactory.make("videorate", videorate_name)
        if not videorate_name:
            sys.stderr.write(" Unable to create videorate \n")
        videorate_name.set_property("drop-only", 1)
        pipeline.add(videorate_name)

        source_bin.link(video_convertor_name)
        video_convertor_name.link(videorate_name)
        padname="sink_%u" %i
        sinkpad= streammux.get_request_pad(padname) 
        if not sinkpad:
            sys.stderr.write("Unable to create sink pad bin \n")
        srcpad=videorate_name.get_static_pad("src")
        if not srcpad:
            sys.stderr.write("Unable to create src pad bin \n")
        srcpad.link(sinkpad)

Please refer to videorate (gstreamer.freedesktop.org) for the usage of videorate.

thx for quick reply.

As I said, I’ve tried videorate and it seems not work at all. I’ve also modify my code in reference to this. Unfortunately, it doesn’t work either.

I’m considering maybe the problem is the output format of source_bin(i.e. uri decoder) can not be compatible with videorate plugin as video plugin requires

video/x-raw(ANY):

video/x-bayer(ANY):

image/jpeg(ANY):

image/png(ANY):

Okey, I found the issue is that I’m using fakesink.

If I change to egl sink, the video rate dose work. But, why it doesn’t work with fakesink?
And as my goal is using this app backstage, I don’t need eglsink.

Is there a way to achieve this?

thx a lot

I figured this out that fakesink doesn’t support videorate control. Once use fakesink as sink, pipeline feed data into it as quickly as possible.
Use fakevideosink to solve this problem.

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