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 is mfxFrameAllocRequest.NumFrameSuggested determined and how to use?

Diederick_H_
Beginner
411 Views

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
Harshdeep_B_Intel
411 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
Alexey_F_Intel
Employee
411 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
Reply