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.

How to fix FPS in Intel H.264 encoder ?

icecream123
Beginner
530 Views
Hi All,

I try to set solid 30 fps in Intel H.264 Encoder:

mfxFrameInfo->FrameRateExtN = 30 and
mfxFrameInfo->FrameRateExtD = 1

But I could not have a solid encoder FPS as 30.

Do you have any good idea ?

Thanks
Best Regards,
0 Kudos
2 Replies
Eric_S_Intel
Employee
530 Views

Hi,

Can you explain the problem you are having with more detail? Theres not enough information here to understand the problem you are having.

- Is the encoder not initializing when you set those values?

- Can you print out the all the other values that you are trying to initialize the encoder with?

We would be happy to help once we understand what you are experiencing.
Thanks

Eric

0 Kudos
icecream123
Beginner
530 Views
Hi Eric,

As below fragments, I had try to assign the frame rate as 30 FPS, do I need more update ?

HRESULT CEncVideoFilter::CheckInputType(const CMediaType* mtIn)
{
...
mfxU32 nFrameRateExtN(0), nFrameRateExtD(0);

sts = ConvertFrameRate(m_pTimeManager->GetFrameRate(), &nFrameRateExtN, &nFrameRateExtD);
CHECK_NOT_EQUAL(sts, MFX_ERR_NONE, sts);

nFrameRateExtN = 30; // set FPS as 30
nFrameRateExtD = 1;
m_mfxParamsVideo.mfx.FrameInfo.FrameRateExtN = nFrameRateExtN;
m_mfxParamsVideo.mfx.FrameInfo.FrameRateExtD = nFrameRateExtD;
...
}

void CConfigPropPage::UpdateDialogControls( mfxU32 codecID
, int nPresetDlgCombobox
, int nTGUsageDlgCombobox
, int nBitrateItem
, int nBitrateSpinItem)
{
...
mfxU32 fcExtN(0), fcExtD(0);
ConvertFrameRate( (mfxF64)statistics.frame_rate / 100.0
, &fcExtN
, &fcExtD);

fcExtN = 30; // set FPS as 30
fcExtD = 1;

vParam.mfx.FrameInfo.FrameRateExtN = fcExtN;
vParam.mfx.FrameInfo.FrameRateExtD = fcExtD;
..
}

HRESULT CDecVideoFilter::CheckInputType(const CMediaType *mtIn)
{
...
if (nVideoInfoSize == mtIn->cbFormat || MFX_ERR_NONE != sts)
{
pmfx->FrameInfo.CropH = (mfxU16)vih2.bmiHeader.biHeight;
pmfx->FrameInfo.CropW = (mfxU16)vih2.bmiHeader.biWidth;

pmfx->FrameInfo.Width = (pmfx->FrameInfo.CropW + 15) &~ 15;
pmfx->FrameInfo.Height = (pmfx->FrameInfo.CropH + 31) &~ 31;

pmfx->FrameInfo.FourCC = MFX_FOURCC_NV12;
pmfx->FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
m_mfxParamsVideo.IOPattern = MFX_IOPATTERN_OUT_SYSTEM_MEMORY;

ConvertFrameRate(m_pTimeManager->GetFrameRate(),
&pmfx->FrameInfo.FrameRateExtN,
&pmfx->FrameInfo.FrameRateExtD);

}

pmfx->FrameInfo.FrameRateExtN = 30; // set FPS as 30
pmfx->FrameInfo.FrameRateExtD = 0;
...
}

Thanks
0 Kudos
Reply