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.

Audio Encoder returns MFX_ERR_INVALID_HANDLE

Charles_P_
Beginner
607 Views

When attempting to initialize the audio path encoder I get MFX_ERR_INVALID_HANDLE error.

Logic used:

mfxVersion SWversion = {0,1}, HWversion = {0,1}, version;

mfxSession Audiosession;

mfxStatus sts;

sts = MFXInit(MFX_IMPL_AUDIO | MFX_IMPL_SOFTWARE, &SWversion, &Audiosession);

if (MFX_ERR_NONE == sts){

MFXQueryVersion(Audiosession,&version);

printf("Audio version:%d.%d API Level: %d.%d\n",

SWversion.Major,SWversion.Minor,

version.Major, version.Minor);

mfxIMPL implTest = 0;

sts = MFXQueryIMPL(Audiosession, &implTest);

printf("audio impl %d %d\n",implTest, sts); }

mfxAudioParam par;

sts = MFXAudioENCODE_Query( Audiosession, 0, &par); //at this point the MFX_ERR_INVALID_HANDLE is returned

printf("get param %d\n",sts); 

0 Kudos
3 Replies
Harshdeep_B_Intel
607 Views

Hi,

mfxAudioParam par;

sts = MFXAudioENCODE_Query( Audiosession, 0, &par); //at this point the MFX_ERR_INVALID_HANDLE is returned

MFX_ERR_INVALID_HANDLE is one of the programming related error, which means its a Invalid session or MemID handle. When this error status is returned by SDK function, it generally expects a reset or close function to follow. 

If you refer to mediaSDk audio maual on Page 21, which shows the syntax for MFXAudioENCODE_Query:

mfxStatus MFXAudioENCODE_Query(mfxSession session, mfxAudioParam *in, mfxAudioParam *out);

In above case, I suggest correctly defining the "par" variable as pointer to mfxAudioParam stucture as output . If the in pointer is zero, the function returns the class configurability in the output mfxAudioParam structure. Hope this helps.

Thanks,

0 Kudos
Charles_P_
Beginner
607 Views

Thanks for coming back.

When tried changing to par parameter to a pointer, it did not change the results.

I ran with the tracer running and the analzer log indicated it could not find mfxplugin32_sw.dll. Could this be the cause? If so where I get/build it from.

Chuck

0 Kudos
Harshdeep_B_Intel
607 Views

Hi,

I think you missed attaching the log file, as size points to 0 bytes. Please re-upload the log file.

I understand you are building an Audio decoder where session searches for libmfxaudiosw32.dll (bin/Win32), not sure why it indicates it could not find mfxplugin32_sw.dll. Log file can provide more details. 

I suggest confirming adding mfxaudio header file, and libmfxaudiosw32.dll to the path of the application. Please check if following header files are added.

Include these files:
#include “mfxvideo.h” /* SDK functions in C */
#include “mfxvideo++.h” /* optional for C++ development */
#include “mfxplugin.h” /* plugin development */ -> Please confirm if you have added this to the path.
#include “mfxaudio.h” /* AUDIO functions – needed for audio plugins */
#include “mfxaudio++.h” /* optional for C++ development for audio plugins */
Link these libraries:
libmfx.lib /* The SDK static dispatcher library */
or
libmfx.a /* The SDK static dispatcher library */

Thanks,

0 Kudos
Reply