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