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.

Cannot initiate MFXAudioENCODE

elsparro
Beginner
529 Views

Hi,

I can not initiate the encoder from MediaSDK2014AudioPack.

I run on CentOS 7.1, CPU E3-1285L v4

Init function fail with errorcode -3

Any points in the right direction is appriciated.

Best Regards

/elsparro

Here is my test code:

#include <mfxaudio++.h>
#include <mfxaudio.h>
#include <cstdio>
#include <cstring>

int main(int argc, char** argv)
{
        mfxStatus ret = MFX_ERR_NONE;
        mfxIMPL impl = MFX_IMPL_SOFTWARE | MFX_IMPL_AUDIO;
        mfxVersion ver = { 0, 1 };

        MFXAudioSession session;

        ret = session.Init(impl, &ver);
        if (ret != MFX_ERR_NONE) {
                ::fprintf(stderr, "cannot initiate session, ret: %d\n", ret);
                return -1;
        }

        ret = session.QueryIMPL(&impl);
        if (ret != MFX_ERR_NONE) {
                ::fprintf(stderr, "cannot query implementation\n");
                return -1;
        }

        ret = session.QueryVersion(&ver);
        if (ret != MFX_ERR_NONE) {
                ::fprintf(stderr, "cannot query version\n");
                return -1;
        }

        ::fprintf(stderr, "Intel Media SDK Audio Implementation: %d, Version: %d.%d\n",
                  impl, ver.Major, ver.Minor);

        MFXAudioENCODE enc(session);

        mfxAudioParam param;
        ::memset(&param, 0, sizeof(param));
        param.mfx.CodecId = MFX_CODEC_MP3;
        param.mfx.Bitrate = 128000;
        param.mfx.SampleFrequency = 48000;
        param.mfx.NumChannel = 2;
        param.mfx.BitPerSample = 16;

        ret = enc.Query(&param, &param);
        if (ret != MFX_ERR_NONE) {
                ::fprintf(stderr, "cannot query encoder params, ret: %d\n", ret);
                return -1;
        }

        mfxAudioAllocRequest req;
        ret = enc.QueryIOSize(&param, &req);
        if (ret != MFX_ERR_NONE) {
                ::fprintf(stderr, "cannot query iosize, ret: %d\n", ret);
                return -1;
        }

        ret = enc.Init(&param);
        if (ret != MFX_ERR_NONE) {
                ::fprintf(stderr, "cannot initiate encoder, ret: %d\n", ret);
                return -1;
        }

        return 0;
}

Compiled with: g++ -o audio_session audio_session.cpp -I/opt/intel/mediasdk/include -L/opt/intel/mediasdk/lib/lin_x64 -lmfx -ldl

0 Kudos
2 Replies
Jiandong_Z_Intel
Employee
529 Views

Hi There,

MediaSDK2014 is not the most new version.

can you download and install Intel® Media Server Studio 2016 from https://software.intel.com/en-us/intel-media-server-studio/try-buy ?

Let me see if the same issue happened under the most new MSS.

 

Best Regards,

Zachary

 

0 Kudos
elsparro
Beginner
529 Views

Hi,

Nope, still dont work, get the exact same output, error -3 and even the same version 1.8.

I removed all files from the 2014 SDK and installed 2016 evaluation.

I also checked with strace that the right libmfxaudiosw.so was loaded.

Another question, I bought the 2014 audio packs as a standalone package form an intel reseller, is it possible to buy the 2016 audio pack version to work with the 2016 SDK essential?

Best Regards

/elsparro

0 Kudos
Reply