NvUtils NvBufSurface to gstreamer

I previously used the method posted here in R 32.6.1 to get a NvBuffer from the nvbuf_utils library into gstreamer appsrc and I’m trying to figure out how to do something similar with NvUtils in R34.1.1. The method in that post doesn’t work in R34.1.1 since gstnvvconv.c now uses NvUtils instead of nvbuf_utils. The method provided the dmabuf fd and nv_buffer pointer to gstreamer. According to the conversion guide the dmabuf_fd and nv_buffer in nvbuf_utils correspond to bufferDesc and dataPtr in NvUtils. But this documentation says that bufferDesc is only valid for NVBUF_MEM_SURFACE_ARRAY and NVBUF_MEM_HANDLE type memory, while dataPtr is invalid for these types of memory, so it seems like I can’t provide both of them to gstreamer.
Is there a way to get a NvBufSurface into a gstreamer appsrc?

We will check how to do this on Jetpack5 with NvBufSurcace. The sample can only work in Jetpack 4 with NvBuffer.

Please try the attachment.

// generate input frame data
$ gst-launch-1.0 videotestsrc num-buffers=150 ! video/x-raw,width=1920,height=1080,format=RGBA ! filesink location=1080.yuv
// build sample
$ make
// run
$ ./appsrc_nvbufsurface
// check a.mkv for the effect

appsrc_nvbufsurface.zip (3.9 KB)

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