NVIDIA Gstreamer nvvidconv question

Hi all,

I’m trying to use nvvidconv plugin in my application.
My application uses cuda process, so I need to control gpu memory buffer.

As I know, if I add ‘(memory:NVMM)’ in my gstreamer pipeline, it means the pipeline uses gpu memory.
So I received the data from nvvidconv gstreamerpipeline and passed it to cuda process.
But cuda process could not handle it properly.
Here is my pipeline example.

gst-launch-1.0 v4l2src device=/dev/video0 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1080” ! nvvidconv ! “video/x-raw(memory:NVMM), format=(string)BGRx” ! appsink

When I search about this issue in the forum and nvidia sample codes, the way to copy buffer from gpu to cpu is recommended like below.
But it takes about 40~50ms more than above gstreamer pipeline.

gst-launch-1.0 v4l2src device=/dev/video0 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1080” ! nvvidconv ! “video/x-raw(memory:NVMM), format=(string)BGRx” ! nvvidconv ! “video/x-raw” ! appsink

So my question is, how can I control NVMM memory buffer in my application without copy it to cpu?

Thans in advance.

Hi,
There is hardware limitation in using BGR format on Jetson platforms. Please refer to

You can try to run in maximum performance. Please look at
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Fpower_management_jetson_xavier.html%23wwpID0E0SB0HA

Hi @DaneLLL

Thank you for your kind reply.
I know it’s a limitation that VIC can’t convert BGR. But it’s not my concern.

I just want to know how can I handle the image data buffer in my app source if I use (memory:NVMM) without copy it to cpu.
For example, how can I handle if I use below gst pipeline in my app.

gst-launch-1.0 v4l2src device=/dev/video0 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1080” ! nvvidconv ! “video/x-raw(memory:NVMM), format=(string)BGRx” ! appsink

Thanks,
Dongjin Ha.

Hi,
Please refer to

Suggest you send RGBA to appsink since BGRx is not supported in CUDA.

Hi @DaneLLL

Thank you for your reply.
I’ll check your suggestions and get back to you soon.

Thanks,
Dongjin Ha.