Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.
3058 Discussions

MFXVideoENCODE_Query() always returns MFX_ERR_UNSUPPORTED

Timur_B_
Beginner
1,082 Views

Hi,

I need a help with MFXVideoENCODE_Query() from Intel Media SDK. I wrote code posted below and unfortunately it doesn't work. MFXVideoENCODE_Query() always returns error MFX_ERR_UNSUPPORTED. I played with parameters, but each time failed.

At the same time, I'm able to encode video with these parameters using HW HEVC encoder on my Skylake. So, only MFXVideoENCODE_Query() doesn't work correctly for me.

I tried do the same for AVC codec and also tried to call MFXVideoENCODE_Query() after MFXVideoUSER_Load(), but in both cases I constantly get the same error.

I'm running on Windows 7 64bit. Video driver version is 10.18.15.4279 / 24.08.2015.

Thanks in advance!

    mfxVideoParam mfx_settings_in = { 0 }, mfx_settings_out = { 0 };
    mfx_settings_in.mfx.CodecId          = MFX_CODEC_HEVC;
    mfx_settings_in.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN;
    mfx_settings_in.mfx.CodecLevel = MFX_LEVEL_UNKNOWN;
    mfx_settings_in.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;
    mfx_settings_in.IOPattern            = MFX_IOPATTERN_IN_SYSTEM_MEMORY;
    mfx_settings_in.mfx.TargetUsage = MFX_TARGETUSAGE_BEST_SPEED;
    mfx_settings_in.mfx.TargetKbps = 1000;
    mfx_settings_in.mfx.RateControlMethod = MFX_RATECONTROL_VBR;
    mfx_settings_in.mfx.FrameInfo.FrameRateExtN = 30;
    mfx_settings_in.mfx.FrameInfo.FrameRateExtD = 1;
    mfx_settings_in.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;
    mfx_settings_in.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
    mfx_settings_in.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;
    mfx_settings_in.mfx.FrameInfo.CropX = 0;
    mfx_settings_in.mfx.FrameInfo.CropY = 0;
    mfx_settings_in.mfx.FrameInfo.CropW = 1280;
    mfx_settings_in.mfx.FrameInfo.CropH = 720;
    mfx_settings_in.mfx.FrameInfo.Width = ALIGN32(1280);
    mfx_settings_in.mfx.FrameInfo.Height = ALIGN32(720);

    mfxStatus status;
    mfxVersion version = { 0, 1 };
    mfxSession session;
    status = MFXInit(MFX_IMPL_HARDWARE, &version, &session);
    status = MFXVideoENCODE_Query(session, &mfx_settings_in, &mfx_settings_out);
 

Regards,

Timur

0 Kudos
3 Replies
Bjoern_B_Intel
Employee
1,082 Views

Hi Timur,

I will look into this. Can you please share the platform details by running the system analyzer coming with the media product?

You will find the tool here: “C:\Program Files\Intel\Intel(R) Media Server Studio 2015 R7\Software Development Kit\tools\mediasdk_sys_analyzer\mediasdk_system_analyzer_64.exe”

Best,

Bjoern

0 Kudos
Timur_B_
Beginner
1,082 Views

Hi Bjoern,

First of all thanks for your quick response!

I already solved this issue myself. In the beginning I just read the manual for MFXVideoENCODE_Query fluently and I didn't pay attention that CodecId must be filled for output parameter, not for input as I did. After I fixed this small thing and also added call to MFXVideoUSER_Load before MFXVideoENCODE_Query, it began work normally.

Now my code looks like this:

	mfxVideoParam mfx_settings_in, mfx_settings_out = { 0 };
	mfx_settings_out.mfx.CodecId = MFX_CODEC_HEVC;
	mfx_settings_out.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;
	mfx_settings_in = mfx_settings_out;

	mfxVersion version = { 0, 1 };
	if (MFXInit(MFX_IMPL_AUTO, &version, &session) >= MFX_ERR_NONE) {
		if (MFXVideoUSER_Load(session, &uid, version.Major) >= MFX_ERR_NONE) {
			MFXVideoENCODE_Query(session, &mfx_settings_in, &mfx_settings_out);
			MFXVideoUSER_UnLoad(session, &uid);
		}
		MFXClose(session);
	} 

So, I'm happy!

However, I would say that behavior of MFXVideoENCODE_Query is unexpected for me. I would expect that I need to fill input structure including mandatory CodecId and leave output structure uninitialized, because I don't care about output and expect that MFXVideoENCODE_Query will verify / validate input and copy results to output structure. It make sense to fix that in future releases, I think.

Best regards,

Timur

0 Kudos
Bjoern_B_Intel
Employee
1,082 Views

Hi Timur,

Great that the code works now. I will take care of your feature request.

Best,

Bjoern Bruecher

0 Kudos
Reply