1

I am using nvencode api for video encoding. My capture card copies frames to pre allocated input buffers (NV_ENC_INPUT_PTR) using direct dma transfers (GpuDirect). the sequence looks like so:

nvEncodeApi->nvEncLockInputBuffer(_encoder, &lockInputBufferParams); // lock input buffer
DmaCopy(lockInputBufferParams.bufferDataPtr); // initiate dma transfer
nvEncodeApi->nvEncUnlockInputBuffer(_encoder, lockInputBufferParams.inputBuffer);

and later I initiate the encoding process.

This works fine, but in order to present the captured frame I need to copy it to a texture.

Is there a method to issue a copy form NV_ENC_INPUT_PTR inputBuffer to a Direct3d11 texture once it is unlocked?

Note: I know I can use Direct3D texture as an input buffer to nvencode and use Map/Unmap API. But my capture card can't seems to be able to perform DMA transfers directly to a mapped texture.

Elad Maimoni
  • 3,703
  • 3
  • 20
  • 37

1 Answers1

0

Cuda Map/Unmap API is interoperability between a Cuda Frame resource and a DirectX texture, for example. Everything resides inside the GPU.

So, I would say, do DmaCopy and then do Map/Unmap of the new resource to a directx texture.

mofo77
  • 1,447
  • 9
  • 17