Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
20 Views

How is mfxFrameAllocRequest.NumFrameSuggested determined and how to use?

Hi, 

I'm using the Intel Media SDK to encode H264 video. When I use MFXVideoENCODE_QueryIOSurf() to retrieve the number of suggested video frames, the resulting mfxFrameAllocRequest.NumFrameSuggested is 1. I'm encoding at 60fps and although it works in most cases, though sometimes I receive a MFX_WRN_IN_EXECUTION result from MFXVideoCORE_SyncOperation. I can solve this by allocating more surfaces. Though how do I determine how many surfaces I need to allocated when the NumFrameSuggested is not enough?

Thanks
Diederick

0 Kudos
2 Replies
Highlighted
20 Views

Hi Diederick,

In this case, you can manage and delegate memory management to the application. Please take a look at "Memory Allocation and External allocators" section in MSDK manual. Also, confirm if you are using latest graphics driver available at https://downloadcenter.intel.com/. Hope this was the information you were looking for. 

Thanks,

 

0 Kudos
Highlighted
Employee
20 Views

Hi Diederick!

MSDK recommends you minimal required working surfaces number to execute your designated pipeline successfully without hangs. If your pipeline involve decoder – it requires to keep reference frames and reconstructed frames in reorder buffer to satisfy Profile@Level requirements to DPB. Same for encoder – it needs keep reconstructed references and original pictures. Asynchronous pipeline requires extra surfaces to perform multiple operations simultaneously. When you have allocated less than minimal you may hit to bad situation when pipeline to be short in surfaces. So this MSDK functionality to provide you a hint which amount to start from.

It is really up to you to increase allocation count as many as you wish – up to memory limit.

I guess your encoding in high resolution at high bitrate for I frames only – so it is quite slow and you face warning in execution. You are challenging hardware performance bounds with your workload. Adding more working surfaces help you solving speed disbalance of I/O and coding parts

JFYI, here is manual https://software.intel.com/sites/default/files/mediasdk-man.pdf

Thanks, Alexey

0 Kudos