YUV4:4:4 HEVC Encoding in D3D12

Hi,

Is is possible to YUV:4:4 HEVC encoding in D3D12?
I’ve been trying all day and NvEncInitializeEncoder() always returns just NV_ENC_ERR_INVALID_PARAM.

It seems NvEncInitializeEncoder() only accepts the following buffer formats,

  • NV_ENC_BUFFER_FORMAT_NV12
  • NV_ENC_BUFFER_FORMAT_YUV420_10BIT
  • NV_ENC_BUFFER_FORMAT_ARGB
  • NV_ENC_BUFFER_FORMAT_ABGR
  • NV_ENC_BUFFER_FORMAT_ABGR10

This looks like YUV444 is not supported in D3D12.
If so, is YUV444 supported with CUDA instead?
Anyway, I want a workable sample code for YUV444 encoding.

Thank you,

My environment:
Windows 10 19043.1348
GeForce GTX 1080
driver version 496.76
CODEC SDK 11.1.5

Hello @masaaki240.m_nv2 ! Welcome to the NVIDIA developer forums!

You are correct, the formats you listed are the only supported ones for D3D12. Unfortunately YUV444 is not part of that.

And yes, if you use CUDA there is support for YUV444. You can find sample code for CUDA device video encoding in our video codec sdk github repository.

Detailed information on High Bit Depth encoding can be found in the programming guide.

May I ask how exactly you were creating/allocating your YUV444 surface? For DirectX there is no dedicated “YUV444” format in DXGI either in DX11 or DX12.
It would be great if you would share the exact API call with any parameters or flags used.

Thank you!