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.

MPEG2 decoder failed with MFX_IMPL_HARDWARE

chi_xu
Beginner
794 Views

Hi,

I am trying to use decoder to decode mpeg2 video stream.I use the sample_decode in MediaSamples_Linux_6.0.16043175.175.

First, i try to run the sample_decode like: ./sample_decode_drm mpeg2 -i test.mpg -o output.yuv -hw. It works well.

Then, i run the sample_decode's code to decode the stream.It works well when i set initPar.Implementation = MFX_IMPL_SOFTWARE.If i set initPar.Implementation = MFX_IMPL_HARDWARE,it returns on error at sts = m_pmfxDEC->Init(&m_mfxVideoParams) with error code -15.

Here is some informations about my system.

[xc@localhost x64]$ uname -r
3.10.0-229.1.2.39163.MSSr4.el7.centos.x86_64

[xc@localhost x64]$ ls -l /dev/dri/
total 0
crw-rw----+ 1 root video 226,   0 1月  14 17:08 card0
crw-------. 1 root video 226,  64 1月  14 17:08 controlD64
crw-rw----. 1 root video 226, 128 1月  14 17:08 renderD128

[xc@localhost x64]$ vainfo
libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.35 (libva 1.3.1)
vainfo: Driver version: 16.4.2.1.39163-ubit
vainfo: Supported profile and entrypoints
      VAProfileNone                   :    VAEntrypointVideoProc
      VAProfileNone                   :    <unknown entrypoint>
      VAProfileMPEG2Simple            :    VAEntrypointEncSlice
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointEncSlice
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileH264Baseline           :    VAEntrypointEncSlice
      VAProfileH264Baseline           :    <unknown entrypoint>
      VAProfileH264Baseline           :    <unknown entrypoint>
      VAProfileH264Main               :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointEncSlice
      VAProfileH264Main               :    <unknown entrypoint>
      VAProfileH264Main               :    <unknown entrypoint>
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileH264High               :    VAEntrypointEncSlice
      VAProfileH264High               :    <unknown entrypoint>
      VAProfileH264High               :    <unknown entrypoint>
      VAProfileVC1Simple              :    VAEntrypointVLD
      VAProfileVC1Main                :    VAEntrypointVLD
      VAProfileVC1Advanced            :    VAEntrypointVLD
      VAProfileJPEGBaseline           :    VAEntrypointVLD
      VAProfileJPEGBaseline           :    VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:    <unknown entrypoint>
      VAProfileH264ConstrainedBaseline:    <unknown entrypoint>
      VAProfileVP8Version0_3          :    VAEntrypointEncSlice
      VAProfileVP8Version0_3          :    VAEntrypointVLD
      VAProfileVP8Version0_3          :    <unknown entrypoint>

Thanks.

 

 

 

0 Kudos
5 Replies
Jiandong_Z_Intel
Employee
794 Views

Hi There,

Because sample_decode works well for, I think your MSS setup okay.

The error -15 you can find it in mfxdefs.h

MFX_ERR_INVALID_VIDEO_PARAM         = -15,  /* invalid video parameters */

Have you check your setting of m_mfxVideoParams ?

Have you notice following in your code ?

 // in case of HW accelerated decode frames must be allocated prior to decoder initialization
    sts = AllocFrames();
    MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);

 

Thanks,

Zachary

 

0 Kudos
chi_xu
Beginner
794 Views

Hi Zachary,

1.I think the setting of m_mfxVideoParams is right because i only set pParams->videoType = MFX_CODEC_MPEG2 and initPar.Implementation = MFX_IMPL_HARDWARE.It works well when i set initPar.Implementation = MFX_IMPL_SOFTWARE.

2.It has no error before the sts = m_pmfxDEC->Init(&m_mfxVideoParams).Here is part of the code.

    // create device and allocator
    sts = CreateAllocator();
    MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);

    // in case of HW accelerated decode frames must be allocated prior to decoder initialization
    sts = AllocFrames();
    MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);

    sts = m_pmfxDEC->Init(&m_mfxVideoParams);

    if (MFX_WRN_PARTIAL_ACCELERATION == sts)
    {
        msdk_printf(MSDK_STRING("WARNING: partial acceleration\n"));
        MSDK_IGNORE_MFX_STS(sts, MFX_WRN_PARTIAL_ACCELERATION);
    }
    MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);

Thanks.

0 Kudos
Jiandong_Z_Intel
Employee
794 Views

Hi,

Can you debug the programs and compare the different m_mfxVideoParams between your program and sample_decode when decode mpeg2 ?  Because sample_decode  works for you, so you can make it as your reference.

 

Thanks,

Zachary

 

0 Kudos
chi_xu
Beginner
794 Views

Hi Zachary,

I get some settings of m_mfxVideoParams and compare it with the sample_decode.They are all the same.

reserved[0] = 0, reserved[1] = 0, reserved[2] = 0, reserved3 = 0,
AsyncDepth = 4,Protected = 0, IOPattern = 32, NumExtParam = 0, reserved2 = 0,
INFOMFX: LowPower =0 , BRCParamMultiplier =0, CodeId = 843534413, CodecProfile = 64,
    CodecLevel = 8, NumThread = 0, DecodedOrder = 0, ExtendedPicStruct = 0,
    TimeStampCalc = 0, SliceGroupsPresent = 0, MaxDecFrameBuffering = 0, reserved2[0] = 0.

Is there some settings different between software and hardware?I don't know why it works well in software mode.

Thanks.

0 Kudos
Jiandong_Z_Intel
Employee
794 Views

Hi,

There are a table list which parameter should be set when do the decode in page 195 Intel Media SDK, Can you also check decode part of this table.

Another, there is MSDK /opt/intel/mediasdk/tools/tracer for trace MSDK parameter, you can reference README in /opt/intel/mediasdk/tools/tracer. use this tool you can compare the parameters between your parameter and MSDK sample_decode

 

Thanks,

Zachary

0 Kudos
Reply