Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
57 Views

MFXVideoDECODE_Init() returned MFX_ERR_NOT_INITIALIZED for opaque memory

Jump to solution

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

Accepted Solutions
Highlighted
57 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
Highlighted
58 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
Highlighted
New Contributor I
57 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
Highlighted
57 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
Highlighted
Beginner
57 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