Copying nvdecoder output to DXGI surface


I’d like to use the capability of Direct2D to draw a NV12 DXGI-backed image directly.

How to copy the output from NVDEC (through cuvidMapVideoFrame) to a DXGI surface ?

Obviously, cuGraphicsD3D11RegisterResource does not work. Is there an alternative interop mapping function for DXGI resource? (for use with cuMemcpy2D.)


I found the way: Create a NV12 Direct3D 11 texture. Query texture for IDXGISurface. Create a Direct2D image source with ID2DDeviceContext2::CreateImageSourceFromDxgi. Register the D3D11 texture with CUDA. Copy the decoder output to the Direct3D texture with cuMemcpy2DAsync (3-planes, see sample from NVDEC sdk.)

1 Like

Nice! Thank you for sharing!

And a very warm welcome to the NVIDIA developer forums @pascal.binggeli!