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.
3075 Discussions

MFXVideoDECODE_Init() returned MFX_ERR_NOT_INITIALIZED for opaque memory

Robby_S
New Contributor I
1,486 Views

Greetings, I am having problems to get my code to work using the opaque memory. My code works with either the system memory or the video memory.

The setup is like this:

    Decoder + VPP + Encoder

where the Decoder decodes a 1920x1088 H.264 bit-stream, VPP resizes the raw video into 640x480 resolution, and the Encoder encodes the raw video into another H.264 bit-stream.

in the system memory mode, all the frame surfaces are allocated in the system memory, using the default frame allocator. Likewise, in the video memory mode, all the frame surfaces are allocated in the video memory, using the frame allocator provided by VA API. In both cases, each allocated frame surface is managed by an mfxFrameSurface1, which is allocated separately. My code works OK in both the system memory and video memory modes.

However, it does not work at all in the opaque memory mode, in which case I don't allocate any frame surfaces at all. I create two separate arrays of mfxFrameSurface1 pointers. Assign the starting address of the 1st array to the decoder's mfxExtOpaqueSurfaceAlloc, and assign the starting address of the 2nd array to the encoder's mfxExtOpaqueSurfaceAlloc.

Then I set the decoder's ExtParam to point to its mfxExtOpaqueSurfaceAlloc, and the encoder's to its own.

I can't think of anything else I need to configure, but the call to MFXVideoDECODE_Init() always returns error -8 (MFX_ERR_NOT_INITIALIZED). I've attached the MFX tracer log file. Could some MSDK experts review it, and tell me what is missing?

Thanks!

Robby

0 Kudos
1 Solution
Jiandong_Z_Intel
Employee
1,486 Views

Hi Robby,

From the trace log. You are using Linux, right ? Are you using CentOS 7.1 ?

Have you referred simple_5_transcode_opaque in MSDK tutorials ? It's a sample for transcode with Opaque Memory.

For error code -8 (MFX_ERR_NOT_INITIALIZED), Maybe function vaInitialize is not called in your applications. can you check this ?

The function vaInitialize is  called in function CreateVAEnvDRM in mediasdk-tutorials-0.0.3/common/common_vaapi.cpp

Help this can help.

 

Best Regards,

Zachary

 

 

View solution in original post

0 Kudos
4 Replies
Jiandong_Z_Intel
Employee
1,487 Views

Hi Robby,

From the trace log. You are using Linux, right ? Are you using CentOS 7.1 ?

Have you referred simple_5_transcode_opaque in MSDK tutorials ? It's a sample for transcode with Opaque Memory.

For error code -8 (MFX_ERR_NOT_INITIALIZED), Maybe function vaInitialize is not called in your applications. can you check this ?

The function vaInitialize is  called in function CreateVAEnvDRM in mediasdk-tutorials-0.0.3/common/common_vaapi.cpp

Help this can help.

 

Best Regards,

Zachary

 

 

0 Kudos
Robby_S
New Contributor I
1,486 Views

Thanks Jiandong. It was indeed an issue with the initialization of the session's MFX_HANDLE_VA_DISPLAY handle. Now the opaque memory is working.

-Robby

0 Kudos
Jiandong_Z_Intel
Employee
1,486 Views

Hi Robby,

Great to know the opaque memory worked for you. I am closing this threads.

You can do a new post if you have other questions.

 

Thanks,

Zachary

0 Kudos
Jamie_W_
Beginner
1,486 Views

I'm also having a problem with MFXVideoDECODE_Init returning MFX_ERR_NOT_INITIALIZED.

According to the documentation this shouldn't be a possible return value https://software.intel.com/en-us/node/628433#MFXVideoDECODE_Init1

Why would MFX_ERR_NOT_INITIALIZED be returned?

I'm porting a Media SDK application to Linux that ran fine on Windows. Using 2016 SDK on Ubuntu 14.10

Our encode code works fine.

Thanks

0 Kudos
Reply