How can I copy nvEncode input buffer to a Direct3d11 Texture?

I am using nvencode 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);

// here 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 from the 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.

Hi,

You cannot copy NV_ENC_INPUT_PTR inputBuffer to a Direct3d11 texture. The only option here is to somehow feed Direct3D texture as an input buffer to nvencode and have some mechanism to copy the data to the Direct3D texture that you intend to feed to NVENC.

Thanks,
Ryan Park