Error with encoding sample

Hi guys,

I’m working on the NVIDIA Codec API and I am working on encoding. I have succeeded in decoding with the API, however, whenever I am trying to encode a file like .nv12 or .native file, it gives me the error of “Invalid value. Can’t convert to one of yuv420 yuv444”. I am pretty new to video manipulations. Can anyone help me understand this error? Thanks so much!

Hi situomeng,

are you using one of the samples? If so, can you paste the command line that you are using for encoding?

In general, this error will show up if the chromaFormatIDC variable is not set to 1 (for YUV420 input data) or 3 (for YUV444).

Best regards


Thanks for the reply. I am not sure how to set the chromaFormatIDC variable in the command line. However, I did notice that when I use -444, which specifies the yuv444 chroma, the error disappears with another error “NvEncoder::CreateEncoder : m_nvenc.nvEncInitializeEncoder(m_hEncoder, &m_initializeParams) returned error 15 at c:\users\administrator\desktop\codec_vs17\samples\nvcodec\nvencoder\nvencoder.cpp:273”.

The command line I’m using is just “AppEncD3D9.exe -i out.nv12 -o result.mp4” or “AppEncD3D9.exe -i out.nv12 -o result.mp4 -444”

Thanks again!