Intel-Media-SDK / MediaSDK

The Intel® Media SDK
MIT License
935 stars 459 forks source link

Vp9 Encoder Initialization Error #2809

Closed kestrelm closed 3 years ago

kestrelm commented 3 years ago

Hello, I am trying to setup the MediaSDK encoder for VP9 encoding. My code fails with the error:

Unsupported feature/library load error. myPath\media_services\video\intelEncoder.cpp 98

Here is my initialization:

 std::memset(&mfxEncParams, 0, sizeof(mfxEncParams));
       mfxEncParams.mfx.CodecId = MFX_CODEC_VP9;
        mfxEncParams.mfx.TargetUsage = MFX_TARGETUSAGE_BALANCED;
        mfxEncParams.mfx.TargetKbps = m_base.bitRate();
        mfxEncParams.mfx.RateControlMethod = MFX_RATECONTROL_VBR;
        mfxEncParams.mfx.FrameInfo.FrameRateExtN = m_base.frameRate(); // Numerator
        mfxEncParams.mfx.FrameInfo.FrameRateExtD = 1; // Denominator
        mfxEncParams.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;
        mfxEncParams.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
        mfxEncParams.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;
        mfxEncParams.mfx.FrameInfo.CropX = 0;
        mfxEncParams.mfx.FrameInfo.CropY = 0;
        mfxEncParams.mfx.FrameInfo.CropW = m_base.width();
        mfxEncParams.mfx.FrameInfo.CropH = m_base.height();
        // Width must be a multiple of 16
        // Height must be a multiple of 16 in case of frame picture and a multiple of 32 in case of field picture
        mfxEncParams.mfx.FrameInfo.Width = MSDK_ALIGN16(m_base.width());
        mfxEncParams.mfx.FrameInfo.Height = 
            (MFX_PICSTRUCT_PROGRESSIVE == mfxEncParams.mfx.FrameInfo.PicStruct) ?
            MSDK_ALIGN16(m_base.width()) :
            MSDK_ALIGN32(m_base.height());
        mfxEncParams.IOPattern = MFX_IOPATTERN_IN_SYSTEM_MEMORY; // To switch to GPU memory if iGPU is available + compatible
        auto sts = m_encdr->Query(&mfxEncParams, &mfxEncParams);
        MSDK_IGNORE_MFX_STS(sts, MFX_WRN_INCOMPATIBLE_VIDEO_PARAM);
        MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); // Fails here, returns the error message

What parameters are valid for VP9 Encoding? This is on Windows 10.

Updates: More information, I ran the analysis tool and got this:

Graphics Devices:
        Name                                         Version             State
        NVIDIA GeForce GTX 1650 Ti                   27.21.14.6231       Offline
        Intel(R) UHD Graphics                        27.20.100.9168      Running / Full Power

System info:
        CPU:    Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
        OS:     Microsoft Windows 10 Home
        Arch:   64-bit

Installed Media SDK packages (be patient...processing takes some time):
        Intel(R) Media SDK 2021 R1 - HEVC SW Encoder
        Intel(R) Media SDK 2021 R1 - Documentation for HEVC
        Intel(R) Media SDK 2021 R1 - HEVC SW Decoder
        Intel(R) Media SDK 2021 R1 - Software Development Kit
        Intel(R) Media SDK 2021 R1 - Media Samples

Installed Media SDK DirectShow filters:

Installed Intel Media Foundation Transforms:
        Intel(R) Hardware M-JPEG Decoder MFT : XXXXXXXXXXXXXX
        Intel(R) Hardware M-JPEG Decoder MFT : XXXXXXXXXXXXXXX

How do I enable the VP9 Encoder on my platform?

Thanks!

dmitryermilov commented 3 years ago

Hi @kestrelm ,

CPU: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz

It's CometLake https://ark.intel.com/content/www/us/en/ark/products/201837/intel-core-i710750h-processor-12m-cache-up-to-5-00-ghz.html . However VP9 encoder is available in HW since IceLake.

kestrelm commented 3 years ago

Hello @dmitryermilov , So does this means I should have the VP9 Hardware encoder available? Because it does not show up on my system. Is there anything I am missing here?

Thanks!

dmitryermilov commented 3 years ago

Unfortunately no. CometLake is 9th (or 10th) generation of Intel Graphics, it doesn't have VP9e support. Support appears since IceLake which is 11th generation.

kestrelm commented 3 years ago

Ok thanks for the information.