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.

D3D11 Errors

Carl_P_
Beginner
1,610 Views

Hi,

I am receiving strange d3d11 errors when decoding an h264 files with (MFX_IMPL_HARDWARE | MFX_IMPL_VIA_D3D11) together with my surface allocator. Decoder is set to low latency mode: AsyncDepth = 1

I am running Intel Media SDK 2016 R2

 

The first call to MFXVideoDECODE_DecodeFrameAsync always generates the following:

---> D3D11 ERROR: ID3D11DeviceContext::VideoDecoderExtension: NULL parameter specified, failing! [ EXECUTION ERROR #3145789: DECODEREXTENSION_NULLPARAM]
    
the rest of the calls do not and after a while the decoder has decoded each frame. MFXVideoDECODE_GetDecodeStat() reports no errors here only valid decoded frames.

If I change the source file from a MFX_PROFILE_AVC_BASELINE to one with a higher profile (MFX_PROFILE_AVC_HIGH) the output looks like this:

---> D3D11 ERROR: ID3D11DeviceContext::VideoDecoderExtension: NULL parameter specified, failing! [ EXECUTION ERROR #3145789: DECODEREXTENSION_NULLPARAM]
---> D3D11 ERROR: ID3D11DeviceContext::CreateVideoDecoderOutputView: Invalid array element specified! [ STATE_CREATION ERROR #3145915: CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAY]
---> D3D11 ERROR: ID3D11DeviceContext::CreateVideoDecoderOutputView: Invalid array element specified! [ STATE_CREATION ERROR #3145915: CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAY]
---> D3D11 ERROR: ID3D11DeviceContext::CreateVideoDecoderOutputView: Invalid array element specified! [ STATE_CREATION ERROR #3145915: CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAY]

---> (7204) 1 frames decoded, 0 frames skipped, 0 errors, 4 frames cached

---> D3D11 ERROR: ID3D11DeviceContext::CreateVideoDecoderOutputView: Invalid array element specified! [ STATE_CREATION ERROR #3145915: CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAY]
---> (7204) 2 frames decoded, 0 frames skipped, 0 errors, 4 frames cached

---> D3D11 ERROR: ID3D11DeviceContext::CreateVideoDecoderOutputView: Invalid array element specified! [ STATE_CREATION ERROR #3145915: CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAY]

...

---> (7204) 475 frames decoded, 0 frames skipped, 3 errors, 1 frames cached

Am I doing something wrong here or is this normal?

// My Texture2D creation

D3D11_TEXTURE2D_DESC desc;
desc.Format         = DXGI_FORMAT_NV12;
desc.Width          = request->Info.Width;
desc.Height         = request->Info.Height;
desc.MipLevels      = 1;
desc.ArraySize      = static_cast<u32>(request->NumFrameSuggested);
desc.SampleDesc     = { 1, 0 };
desc.Usage          = D3D11_USAGE_DEFAULT;
desc.CPUAccessFlags = 0;
desc.BindFlags      = D3D11_BIND_DECODER;
desc.MiscFlags      = D3D11_RESOURCE_MISC_SHARED;

ComPtr<ID3D11Texture2D> tex2D
device->CreateTexture2D( &desc, nullptr, set(tex2D) )

// My D3D11 Device creation
const D3D_FEATURE_LEVEL featureLevelsRequested[] =
{
    D3D_FEATURE_LEVEL_11_1,
    D3D_FEATURE_LEVEL_11_0,
    D3D_FEATURE_LEVEL_10_1,
    D3D_FEATURE_LEVEL_10_0,
    D3D_FEATURE_LEVEL_9_3,
    D3D_FEATURE_LEVEL_9_2,
    D3D_FEATURE_LEVEL_9_1
};

::D3D11CreateDevice(
    get(adapter),
    D3D_DRIVER_TYPE_UNKNOWN,
    nullptr,
    D3D11_CREATE_DEVICE_VIDEO_SUPPORT,
    featureLevelsRequested,
    (u32)ElementCount(featureLevelsRequested),
    D3D11_SDK_VERSION,
    set(device),
    &actualLevel,
    set(ctx)
    );

MFXVideoDECODE_SetHandle(session, MFX_HANDLE_D3D11_DEVICE, static_cast<mfxHDL>(device));

 

0 Kudos
8 Replies
Jiandong_Z_Intel
Employee
1,609 Views

Hi There,

Can you share log from system_analyzer tool located at (mediasdk/tools/analyzer) ? This will help provide us your system details. 

Does MSDK sample_decode work for you ?

 

Thanks,

Zachary

 

0 Kudos
Carl_P_
Beginner
1,609 Views

Hi

Here's my system log.

508692

0 Kudos
Carl_P_
Beginner
1,609 Views

I am using Visual Studio 2015 update 2 and I have recompiled the libmfx dispatcher with this new toolset, to be able to link my project.

// Carl

 

0 Kudos
Jiandong_Z_Intel
Employee
1,609 Views

Hi Carl,

Can you verify if MSDK sample_decode with -d3d11 work for you ?

$ sample_decode.exe h264 -i amp.h264 -o amp.yuv -hw -d3d11
Decoding Sample Version 6.0.0.49


Input video     AVC
Output format   YUV420
Resolution      1280x720
Crop X,Y,W,H    0,0,0,0
Frame rate      30.00
Memory type             d3d11
MediaSDK impl           hw_d3d11
MediaSDK version        1.17

Decoding started
Frame number:  635, fps: 26.248, fread_fps: 0.000, fwrite_fps: 26.859

 

Thanks,

Zachary

0 Kudos
Carl_P_
Beginner
1,609 Views

Hi Zachary,

That works : 

sample_decode.exe h264 -i track1.h264 -o track1.yuv -hw -d3d11

pretending that stream is 30fps one
pretending that aspect ratio is 1:1
Decoding Sample Version 6.0.0.142


Input video     AVC
Output format   NV12
Input:
  Resolution    1280x720
  Crop X,Y,W,H  0,0,0,0
Output:
  Resolution    1280x720
Frame rate      30.00
Memory type             d3d11
MediaSDK impl           hw_d3d11
MediaSDK version        1.17

Decoding started
Frame number:  436, fps: 53.307, fread_fps: 0.000, fwrite_fps: 59.234

I can't see if there is D3D11 errors, I guess the samples are not compiled with D3D11_CREATE_DEVICE_DEBUG

// Carl

0 Kudos
Jiandong_Z_Intel
Employee
1,609 Views

Hi Carl,

Regarding D3D11 device, you can refer to <MSDK sample>\sample_common\src\d3d11_device.cpp,

How did you used D3D11_CREATE_DEVICE_DEBUG ? I find it defined in 

 C:\Program Files (x86)\Windows Kits\8.0\Include\um\d3d11.h(14203):        D3D11_CREATE_DEVICE_DEBUG    = 0x2,

and it is not "Preprocessor Definitions".

You can also try to reproduce the issue you met in MSDK sample_decode.

 

Thanks,

Zachary

 

0 Kudos
Carl_P_
Beginner
1,609 Views

Hi,

Your SDK sample also generates the 

D3D11 ERROR: ID3D11DeviceContext::VideoDecoderExtension: NULL parameter specified, failing! [ EXECUTION ERROR #3145789: DECODEREXTENSION_NULLPARAM]

on the first call to the DecodeFrameAsync() (only if I add the D3D11_CREATE_DEVICE_DEBUG flag to your device creation)

Your sample does not generates the other errors.

I need some clarification regarding the surface allocator

  • In my case, HW accelerated decode, does the frames have to be allocated prior to decoder initialization, ::MFXVideoDECODE_Init(session, par)?
  • And I guess I need to invoke ::MFXVideoCORE_SetFrameAllocator(session, allocator) ? When?
  • The ArraySize param on D3D11_TEXTURE2D_DESC, should it be set to one or request->NumFrameSuggested?

// Carl 

0 Kudos
Jiandong_Z_Intel
Employee
1,609 Views

Hi Carl,

Can you upload your changset or patches of sample_decode for reproduce this issue on you end ?

Regarding surface allocator, you can refer to sample_common\src\d3d11_allocator.cpp and mfxStatus CDecodingPipeline::CreateAllocator()

 

in mfxStatus CDecodingPipeline::Init(sInputParams *pParams), you can see -

    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);

 

Thanks,

Zachary

0 Kudos
Reply