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
공지
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.

EncodeFrameAsync return MFX_ERR_MORE_DATA until 3rd frame feeded

derek_q_
초급자
2,462 조회수

Hi,

  I use ffmpeg with libmfx enabled for real time H264 encoding, the encoding frame rate is good, but there is about 400ms~500ms latency. 

  I finally found out that latency is causing by EncodeFrameAsync not return encoded frame immediately until the 7th frame feeded.

  I try to set the async_depth to 0(default is 4), then the latency drop to about 160ms ~ 260ms, and EncodeFrameAsync will output frames when 3rd frame feeded now.

  I wonder to know if there has way the let the EncodeFrameAsync output frame immediately when the first frame feeded, it will be great for real time H264 encoding.

0 포인트
4 응답
Anna_B_Intel
직원
2,462 조회수

Hi Derek,

Please try to set AsyncDepth to 1.

Best wishes,

Anna

0 포인트
wu_f_
초급자
2,462 조회수

hi,

I have try to set AsyncDepth to 1, but no use.  Is any other params to set?

0 포인트
bingol__evren
초보자
2,462 조회수

 

I am having exact the same issue. 

I am not trying to encode a file content .I am trying to encoder real time data. The EncodeFrameAsync call executes 4 times before it returns NO error.  
async_depth is set to 1;


I only have 1 surface as I do one frame at a time ? Any suggestions. 

This is what the setup looks like. 

Params_in.mfx.CodecId = MFX_CODEC_HEVC;
Params_in.mfx.TargetUsage = MFX_TARGETUSAGE_BALANCED;
Params_in.mfx.GopPicSize = 60;
//Params_in.mfx.TargetKbps = 8000;
Params_in.mfx.RateControlMethod = MFX_RATECONTROL_VBR;
 
Params_in.mfx.BufferSizeInKB = 129;
Params_in.mfx.TargetKbps = 129;
Params_in.mfx.FrameInfo.FrameRateExtN = 30;
Params_in.mfx.FrameInfo.FrameRateExtD = 1;
 
Params_in.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;
Params_in.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
Params_in.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;
Params_in.mfx.FrameInfo.CropX = 0;
Params_in.mfx.FrameInfo.CropY = 0;
 
Params_in.mfx.EncodedOrder = 0;
Params_in.mfx.CodecProfile = 0;
Params_in.mfx.CodecLevel = 0;
Params_in.mfx.NumSlice = 0;
Params_in.IOPattern = MFX_IOPATTERN_IN_SYSTEM_MEMORY;
Params_in.mfx.FrameInfo.Width = MSDK_ALIGN16(m_Width);
Params_in.mfx.FrameInfo.Height = (MFX_PICSTRUCT_PROGRESSIVE == Params_in.mfx.FrameInfo.PicStruct) ?
MSDK_ALIGN16(m_Height) : MSDK_ALIGN32(m_Height);
Params_in.mfx.FrameInfo.CropW = m_Width;
Params_in.mfx.FrameInfo.CropH = m_Height;
Params_in.AsyncDepth = 1;

 

 

Thanks


 

0 포인트
Dmitry_E_Intel
2,414 조회수
0 포인트
응답