NvEnc: YUV444 from ARGB format

I understand that with NvEnc, it converts a input format of RGB to a YUV format (NV12 i believe) before encoding, this is a convenience thing. But what about converting the RGB to a YUV444 format for encoding? Do i have to manually convert my RGB format to a YUV444 for encoding? Or is there a way to tell NvEnc to convert the RGB to a 444 format instead of a 420 format.

Also, is there an optimal YUV format i would want to convert to for input format? I know it supports NV12, YV12, and YUV420 (and YUV444, AYUV for 444 sampling). So which one is optimal? Are the internals of NvEnc also converting all of these formats to something the encode pipeline can use? Would converting to a specific format over another help performance so nvenc has to do a bit less work? I would assume because there is only 1 444 format, that YUV420 would be the best format to use?

There are other topics that ask this question, but none of them are answered (that I have found).

No one responded, so i guess ill just give a follow up for anyone having a similar question.

I have gone ahead with creating a bunch of shaders to do the conversion to YUV for me. That way i have complete control. I also still have no idea on what is the optimal format, and might do some benchmarking in the future to see if NvEnc does in fact take some time for certain formats to convert them to the optimal format.

Hi Jake,

I m also facing this issue. Could please share your solution for conversion from RGB to YUV444?

Im going to need a bit more detail on your exact issue to help you out.

But ill cover the basics here.
ARGB to YUV444 does work automatically in NvEnc. Just make sure to have the correct input format (for me I am using DXGI_FORMAT_R8G8B8A8_UNORM), and set encodeCodecConfig.hevcConfig.chromaFormatIDC to 3 and it works fine for me.

The colorspace issue is another thing you have to watch out for. To tell the encoder what colorspaces to use to convert from ARGB to YUV, you need to set the color parameters within encodeCodecConfig.hevcConfig.hevcVUIParameters.

1 Like

Thank you very much! :) Your answer solved my issue.

In case someone will search for Annex E of the ITU-T Specification to tune hevcVUIParameters/h264VUIParameters, you can find it here:
ITU-T Specification H.264

Page 424

Annex E is H.273 now.