Cropping input videos

I have the following simple code:

sources = [ "file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_qHD.mp4",

    number_sources = len(sources)
    for i, uri_name in enumerate(sources):"Creating source_bin {}".format(i))
        if uri_name.find("rtsp://") == 0 :
            is_live = True
        source_bin=DS_UTILS.create_source_bin(i, uri_name)
        if not source_bin:
            logging.error("Unable to create source bin")
        padname="sink_%u" %i
        sinkpad= streammux.get_request_pad(padname) 
        if not sinkpad:
            logging.error("Unable to create sink pad bin")
        if not srcpad:
            logging.error("Unable to create src pad bin")

        convA = DS_UTILS.create_gst_element("nvvideoconvert", "convA_{}".format(i)); pipeline.add(convA)

        x0,y0,w,h = 400, 180, 72, 360

        padI = convA.get_static_pad("sink")
        padO = convA.get_static_pad("src")

The idea is crop certain area inside video and work only over this area.
The problem is I am getting the following error:

Error: gst-stream-error-quark: memory type configured and i/p buffer mismatch ip_surf 0 muxer 3 (1): gstnvstreammux.c(616): gst_nvstreammux_chain (): /GstPipeline:pipeline0/GstNvStreamMux:StreamMuxer

However if I comment out the lines,

#x0,y0,w,h = 400, 180, 72, 360

then the code works although obviously I don’t do any cropping!!!.

Also, If I remove the RTSP source, then the code works fine and also perfom the cropping

Any help with that? I need to do a crop and optionally a DEWART transformation, but now I’m stuck on the crop part because of that issue.

Please provide complete information as applicable to your setup.

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

• GPU RTX 1650, DS61-dev container on Kubuntu 20.04 host
• DS6.1
• NVIDIA-SMI 515.48.07 Driver Version: 515.48.07

Can you set the “nvbuf-memory-type” property of nvvideoconvert as 3?

1 Like

Thank you so much, It is working right now !!!

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