Media (Intel® oneAPI Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools from Intel. This includes Intel® oneAPI Video Processing Library and Intel® Media SDK.
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

h.264 always has B frames despite GopRefDist

New Contributor I

I am trying to encode h.264 Main or High profiles without B frames to try to mux an mp4 that will play in quicktime correctly. I am running a modified sdk sample that is generally working well. Encoding the baseline profile avoids B frames, however I would like to be able to use main or high profiles as well. 

The reference manual says that if GopRefDist = 1 then there will be no B frames, but that is not working for me. Neither hw nor sw encodes obey that flag.

In CEncodingPipeline::InitMfxEncParams, here are the settings I'm using:

m_mfxEncParams.mfx.GopOptFlag = MFX_GOP_STRICT; // | MFX_GOP_CLOSED;
m_mfxEncParams.mfx.GopPicSize = 30;
m_mfxEncParams.mfx.GopRefDist = 1; // Seems to not be honored at all. 

The GopPicSize parameter is enacted correctly, the output changes when I modify it. But GopRefDist seems to have no effect. The string GopRefDist doesn't appear anywhere else in my solution.

My driver is: Intel(R) HD Graphics 4000          

Is there some other setting I am missing?



0 Kudos
2 Replies
Hi Ryan, That is certainly odd. Setting GopRefDist should enforce encoding with no B-frames. Can you please share encoding log, captured using the Media SDK tracer tool? Regards, Petter
New Contributor I
Oops, I was setting m_mfxEncParams.mfx.TimeStampCalc not realizing it is in a union with the struct that has GopRefDist. So when I set TimeStampCalc it was resetting GopRefDist to 0. It is working now that I have fixed that bug.