NVIDIA/NvPipe

Is there an interface to encode D3D11 textures as there is for GL?

Holo-Krzysztof opened this issue · 3 comments

Basically what the title says. It'd be easier for us to use since, if I'm not mistaken, wouldn't be directly exposed to CUDA.

Hi, thanks for asking! Currently, there is no D3D11 interface for NvPipe, sorry!

However, you can check out the NvEncoderD3D11 in Video Codec SDK.

So you could either try modifying NvPipe to use NvEncoderD3D11 instead of NvEncoderCuda, or just use the NvCodec classes directly in your application.

Hope that helps!
Tim

Actually, I was planning to add such an interface, not sure if this will work, but otherwise, I'll provide a PR.

@Holo-Krzysztof I exposed a D3D11 interface in our fork.

Feel free to give it a try.

I didn't do any benchmarking yet, so I'm not sure what the overhead is.

I did struggle with some race condition crashes, because we render on a different thread than the encoder thread, and I can't find any documentation about D3D11 <-> CUDA interop when it comes to multi-threading.

Wrapping our render calls between ID3D11Multithread::Enter and ID3D11Multithread::Leave seems to fix the random crashes, but I am not sure if this is the only fix that is needed.