H.264 encoder never provides SPS and PPS

H.264 encoder never provides SPS and PPS

I have the transcoding module which extracts the SPS/PPS information from the H.264 encoder by calling the encoder's GetVideoParam() method. Usually (or to say the least: on several machines) this call fills out the SPSBuffer / PPSBuffer members of mfxExtCodingOptionSPSPPS structure. 

On one particular machine, the outcome of this call is that SPSBuffer / PPSBuffer are set to NULL, and the return value ends up being MFX_ERR_NONE. Waiting for this condition to change and repeating the calls after the encoding goes on for a while does not change the things at all - I never get back the desired SPS/PPS values.

Since I am embedding the encoded H.264 stream into a container format(s) of choice, I need to form the decoder configuration record, for which the SPS/PPS blobs are needed. 

Wonder if there is a workaround for this problem ?

More data about the 'troubled' system:

- Lenovo W520

- CPU is Intel(R) Core(TM) i7-2720QM CPU @ 2.20GHz 

- Device Manager lists under the 'Display Adapters' section: 'Intel(R) HD Graphics Family' + 'NVIDIA Quadro 1000M'

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

To clarify the things even more:

I've been using the code snippet posted by Eric Sardella (Mon, 02/06/2012 - 13:17) on the following topic:

http://software.intel.com/en-us/forums/topic/311784

Hi Mamil,

It's hard to say what may be going on without more information.

Could you share a Media SDK trace log for both the successful and the not successful case?

Also, please share the output from the Media SDK system analyzer tool for the system on which you encounter the issue.

By the way. The procedure for how to retrieve SPS/PPS is also described in the Media SDK Developers Guide.

Regards,
Petter 

mediasdk_tracer for some reason creates empty analyzer.log files. I've verified that the logman.exe utility mentioned in the readme document is in path and can be accessed from the command prompt (besides, the KBytes Written shows '128' immediately). 

Any advice as to what I am possibly missing from my log tracing procedure ?

Thanks

Mamil

Fortunately, I was able to get the trace on the 'troubled' machine (and not on any other - probably missing the right configuration for logman.exe utility). The log is in the attachment, hopefully it will provide the precious insight into the core of the problem.

Attachments: 

AttachmentSize
Downloadapplication/octet-stream analyzer.log1.44 MB

Hi Mamil,

from the log I can see that the Media SDK HW DLL used is from a quite old driver. Could you please update to most recent one for your system from https://downloadcenter.intel.com/default.aspx

Also, can you please make sure you allocate enough buffer space and set the SPSBufSize and PPSBufSize values to the size of your buffer. A few hundred bytes should be plenty.

Regards,
Petter 

While waiting for answer, I've taken a closer look at the log. The detail which attracted my attention is the string 'Vendor ID conflict'. 

In fact, on the 'troubled' physical machine there are three options in BIOS regarding the video display adapter: 

- 'integrated' (i.e. Intel Integrated HD Adapter)

- 'discrete' (i.e. NVidia Quadro 1000M)

- 'NVidia Optimus' (i.e. layer in between making the decision of what to run and how based on the current battery situation).

What I've found is the following:

- NVidia Optimus scenario features the problem. 

- 'discrete' option works fine, as intended, as on any other machine

- 'integrated' option, however, does not work. Trying MFX_IMPL_VIA_D3D9 made it work. 

The questions I have now are:

- shouldn't the MFX_IMPL_AUTO_ANY be safe choice for any combination of hardware ? 

- how the Media SDK infrastructure cooperates with NVidia Optimus technology (i.e. is there MFX_IMPL... option that is known to work ?)

- is there an algorithm that could suggest the optimum choice of MFX_IMPL value based on the underlying system graphics capabilities ?

Thanks

Mamil

From the log you shared (the encode case) it is clear that HW acceleration is used via Media SDK. This means the Intel HD Graphics device was active and successfully identified.

MFX_IMPL_AUTO_ANY is sufficient for selecting the HW device on which Intel HD Graphics reside. I'm surprised to hear that explicit MFX_IMPL_VIA_D3D9 config made a difference.   

Note that if the discrete card is the only exclusively activated device Media SDK will fall back on SW implementation if MFX_IMPL_AUTO_ANY is used.

Media SDK or the Intel HD Graphics driver has no notion of the 'NVidia Optimus' layer. That layer handles dynamic selection of active device.

Regards,
Petter 

Leave a Comment

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