locked
HEVC Encoding to Main 4:4:4 Profile RRS feed

  • Question

  • Is it possible with MediaFoundation and the SinkWriter to encode HEVC video with 4:4:4 chroma sampling instead of the default 4:2:0? I've tried setting the output MediaType Mpeg2Profile to 6 (eAVEncH265VProfile_Main_444_8) but the resulting video is always in 4:2:0. I also can't seem to get proper 0-255 color range in the resulting video. Source content is RGB32. I also tried with the H.264 encoder (and appropriate eAVEncH264VProfile_Main_444_8 profile) but get the same results. Thanks for the help!
    Thursday, May 31, 2018 4:05 PM

Answers

  • The card itself does have NV_ENC_CAPS_SUPPORT_YUV444_ENCODE capability, which you presumably look for. This is however as reported via SDK. Nvidia's Media Foundation Transform for encoding might be not up to date and implement a subset of hardware caps. I cannot confirm or state that and I myself actually never tried to encode HEVC via Ndivia MFT, but I did see that their MFT is having problems otherwise which made me think its update is not a priority.

    http://alax.info/blog/tag/directshow

    • Marked as answer by Guy Godin Thursday, May 31, 2018 11:38 PM
    Thursday, May 31, 2018 7:25 PM

All replies

  • As a framework API, Media Foundation manages a suitable encoder for you, and such encoder might have its own limitations. Fallback software H.265 encoder is limited to eAVEncH265VProfile_Main_420_8, which is perhaps what you are effectively seeing.

    Independent hardware vendor (IHV) encoders might have their own limitations and since IHVs are, generally, not real fast in exposing their full feature set through Media Foundation, 4:4:4 is not necessarily available there too, even if vendor specific SDK offers it in the same time.


    http://alax.info/blog/tag/directshow

    Thursday, May 31, 2018 5:07 PM
  • Hi Roman, thanks for the quick response. I am using a hardware encoder (I set MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS to 1 in the SinkWriter attributes along with a D3D manager and have an Nvidia GTX 1080 Ti which supports yuv444p encoding). So what you are saying is the Nvidia MFT doesn't use the requested color format and always uses 4:2:0? I should reach out to Nvidia to have this fixed/updated?
    Thursday, May 31, 2018 5:45 PM
  • The card itself does have NV_ENC_CAPS_SUPPORT_YUV444_ENCODE capability, which you presumably look for. This is however as reported via SDK. Nvidia's Media Foundation Transform for encoding might be not up to date and implement a subset of hardware caps. I cannot confirm or state that and I myself actually never tried to encode HEVC via Ndivia MFT, but I did see that their MFT is having problems otherwise which made me think its update is not a priority.

    http://alax.info/blog/tag/directshow

    • Marked as answer by Guy Godin Thursday, May 31, 2018 11:38 PM
    Thursday, May 31, 2018 7:25 PM