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.

H.264 encoder never provides SPS and PPS

Mamil_A_
Beginner
671 Views

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'

0 Kudos
7 Replies
Mamil_A_
Beginner
671 Views

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

0 Kudos
Petter_L_Intel
Employee
671 Views

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 

0 Kudos
Mamil_A_
Beginner
671 Views

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

0 Kudos
Mamil_A_
Beginner
671 Views

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.

0 Kudos
Petter_L_Intel
Employee
671 Views

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 

0 Kudos
Mamil_A_
Beginner
671 Views

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

0 Kudos
Petter_L_Intel
Employee
671 Views

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 

0 Kudos
Reply