h264 problem in GetVideoParam

h264 problem in GetVideoParam


I'm trying to test the h264 encoder with ffmpeg muxer using the latest Media SDK 2013R2  in software mode and cannot get it to work, the encoding process is ok but the file created cannot be played.

First thing, the GetVideoParam function returns MFX_ERR_NONE but the buffers contents are not filled and bufffers size value not change:

            mfxU8 SPSBuffer[MAXSPSPPSBUFFERSIZE];
            mfxU8 PPSBuffer[MAXSPSPPSBUFFERSIZE];
            mfxExtCodingOptionSPSPPS m_extSPSPPS;
            m_extSPSPPS.Header.BufferId = MFX_EXTBUFF_CODING_OPTION_SPSPPS;
            m_extSPSPPS.Header.BufferSz = sizeof(mfxExtCodingOptionSPSPPS);
            m_extSPSPPS.PPSBuffer        = PPSBuffer;
            m_extSPSPPS.SPSBuffer        = SPSBuffer;
            m_extSPSPPS.PPSBufSize        = MAXSPSPPSBUFFERSIZE;
            m_extSPSPPS.SPSBufSize        = MAXSPSPPSBUFFERSIZE;
            mfxEncParams.ExtParam = new mfxExtBuffer *[1];
            mfxEncParams.ExtParam[0] = (mfxExtBuffer*)&m_extSPSPPS;
            mfxEncParams.NumExtParam = 1;
            // Retrieve encoder parameters incl. sequence header
            sts = mfxENC.GetVideoParam(&mfxEncParams);
--------------------- >
        returns sts= MFX_ERR_NONE
        m_extSPSPPS.SPSBuffer          contents untouched
        m_extSPSPPS.PPSBuffer        contents untouched

could be that the problem?

thanks in advance

Attached all the code.

Downloadtext/plain code.txt5.58 KB
5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.


I quickly tried SW processing using the Media SDK ffmpeg tutorial sample using Media SDK 2013 R2 and it fetching SPS/PPS worked just fine. But, to be honest, that integration tutorial sample and some of the other tutorial samples have not been extensively tested using Media SDK SW codecs. Main focus is on HW accelerated usages.There may be issues lurking.

Are you getting any error or warning status codes returned from the Media SDK API calls?

And it looks like your extended buffer initialization may be wrong. Try the following instead.
mfxExtBuffer* encExtParams[1];
encExtParams[0] = (mfxExtBuffer *)&extSPSPPS;
mfxEncParams.ExtParam = &encExtParams[0];
mfxEncParams.NumExtParam = 1;



thanks for the answer, It's working now, solved by copying libmfxsw32.dll from 2013 sdk to program folder.

Searching from where it could be loading the dll apart from sdk install path, I found it was loading an old libmfxsw32.dll from 2010 in C:\Windows\SysWOW64 probably installed by some bad software.




How is m_extSPSPPS.PPSBuffer contents gets initialized.

On observing the example it seems that it is missing.



Hello Ran - This is a very old thread and much has improved in MSDK since. Could you kindly start a new thread with detailed question based on the suggested format please? - https://software.intel.com/en-us/forums/intel-media-sdk/topic/531083

We can take a look at it then.

Leave a Comment

Please sign in to add a comment. Not a member? Join today