How to acquire NvBuffer from EGLStream and use for nvv4l2h264enc

Hi guys,
In this post https://forums.developer.nvidia.com/t/how-to-acquire-frames-out-of-eglstreamkhr-and-map-to-nvbuffer-for-use-in-nvvideoencoder/112794 a solution suggested for acquire nvbuffer(dmaBuffer) from EGLstream

It is impossible to map the buffer directly. Need one memcpy through CUDA.
You need to create NvBuffer and get CUDA pointer of destination by calling:

NvEGLImageFromFd();
cuGraphicsEGLRegisterImage();
cuGraphicsResourceGetMappedEglFrame();

,use CUDA consumer APIs to get CUDA pointer of source:

cuEGLStreamConsumerAcquireFrame();
cuGraphicsResourceGetMappedEglFrame();

, and copy source(CUDA consumer) to destination(NvBuffer). 

Is there any complete sample code with for example GL producer or CUDA producer and DMA consumer like what suggested above post.
Thanks so much.

Hi,
A possible solution is to create NvBuffer so that you can map it to EGLImage for CUDA processing. And use hardware encoder to encode to h264/h265 stream.

Let’s have further discussion in
EGLstream DMA Consumer solutions

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