Showing results for 
Search instead for 
Did you mean: 
New Contributor III

Can H264 Encoder generates output frame for every input raw frame


I am using Media_SDK_2016.0.1 and sample version for encoding NV12 frames (basically desktop capture frames) into H264 format through HW encoder (API version 1.16). I set the AsyncDepth value to 1 and LA Depth to 0 in encoder init. Other settings are as following:

    m_Params.MVC_flags            = MVC_DISABLED;
    m_Params.numViews            = 1;
    m_Params.nAsyncDepth        = 1;
    m_Params.dFrameRate            = 30;
    m_Params.nTargetUsage        = MFX_TARGETUSAGE_BALANCED;
    m_Params.nPicStruct            = MFX_PICSTRUCT_PROGRESSIVE;
    m_Params.nRateControlMethod    = MFX_RATECONTROL_CBR;
    m_Params.nBitRate            = CalculateDefaultBitrate(m_Params.CodecId, m_Params.nTargetUsage, m_Params.nDstWidth, m_Params.nDstHeight, m_Params.dFrameRate);
    m_Params.nQPI                = 0;
    m_Params.nQPP                = 0;
    m_Params.nQPB                = 0;
    m_Params.nQuality            = 0;
    m_Params.nNumSlice            = 0;
    m_Params.nMaxSliceSize        = 0;
    m_Params.nLADepth            = 0;


Currently, I am observing that my first h264 enocded frame is getting generated after inputting 3 NV12 frames, while I want to get output for each n every input frame. So is this possible by making some setting or changes in encoder?



0 Kudos
1 Reply

Hi Ramashankar, 

I do not have your hardware information, but assuming you have latest hardware {" HW encoder (API version 1.16)"} . Then, let first start with simple steps. 

1) Update to latest driver for API 1.17 support, from:

2) To enable the Intel® Media SDK encoder for optimal low latency the following set of parameters should be used:

mfxVideoParam::AsyncDepth = 1 mfxInfoMFX::GopRefDist = 1 mfxInfoMFX::NumRefFrame = 1,please refer to this article "" Low Latency Encode and Decode, encode configuration section for details about these paramters. 

3) Also, for low latency mode, we have a tutorial simple_6_transcode_opaque_lowlat that shows parameters to set for low latency for both decode and encode. Please refer to encoder configuration in the tutorial and set similar settings for encoder in your application. 

Let me know your results after above updates.