DeepStream copy transform instead of inplace transform


I am using a modified version of gstdsexample plugin to process a set of input images. The goal of my plugin is to receive input images of size 1920x1080 and output a set of images of size 384x216 (that is, for every single input image there is a set of 25 smaller output images).

I have modified gstdsexample to implement copy-transform, that is, the plugin implements gst_dsexample_transform and disables gst_dsexample_transform_ip. When running the plugin on Jetson nano I receive segmentation fault error due to GPU vs CPU memory.

Since gst_dsexample_transform has two buffers: GstBuffer* inbuf, GstBuffer* outbuf. I am able to NvBufSurfaceMap inbuf for reading but I am not able NvBufSurfaceMap outbuf for writing (fault happens here).

I have attached a patched version of dsexample to show the problem on line 744. Please advice on how to use gst_dsexample_transform or on how to achieve same results if there is another solution. (10.9 KB)

I came across this post that seems to be similar but there is no satisfactory solution (at least not for my case): Copy on content of input buffer to output buffer

Thank you very much.

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson Nano)
**• DeepStream Version 5.1
**• JetPack Version (valid for Jetson only) 4.5.1

The dsexample plugin is implemented to have identical size in sink pad and source pad. For changing resolution, please utilize nvvideoconvert plugin.

Hi @DaneLLL, thank you for the suggestion. However, how does that solve my requirement of splitting every input image (frame) of 1920x1080 into 25 384x216? It seems like for every image (frame or GstBuffer) I need to put N other frames or GstBuffers. Pretty much my input image is a grid of NxM sources (or ROI that I need to extract and later run inference on). Any suggestion on how to achieve this? Thank you.

Maybe this will be helpful

1 Like

That works, thank you very much!!