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 many surfaces should I create?

BMart1
New Contributor II
579 Views

The simple_encode_d3d_async sample does

EncRequest.NumFrameSuggested = EncRequest.NumFrameSuggested + mfxEncParams.AsyncDepth;

to determine how many surfaces to create. But if you call QueryIOSurf with a larger AsyncDepth, it returns a larger NumFrameSuggested​, suggesting it already accounts for AsyncDepth internally. In my testing, the original value of NumFrameSuggested is insufficient and makes my program run out of surfaces. Adding a single surface seems to fix this.

How many surfaces should I create?
Bruno

0 Kudos
4 Replies
BMart1
New Contributor II
579 Views

BTW, with video memory surfaces QueryIOSurf returns one more and may be enough to avert trouble.

0 Kudos
Mark_L_Intel1
Moderator
579 Views

Thanks so much for the suggesting and testing,

Our tutorial code was created a long time ago, so the API behavior might already be changed. We are in a process to update it and I will record this suggestion also validate it when we update.

So I think your suggestion should be correct for now. 

Mark

0 Kudos
BMart1
New Contributor II
579 Views

Hi Mark,

I think not only documentation should be improved. It doesn't make sense to me that NumFrameSuggested ​varies between system memory and video memory. It could be a bug in the code.

Regards,
Bruno

0 Kudos
Mark_L_Intel1
Moderator
579 Views

Thanks so much,

We are developing new tutorial code and we will double check this during the development. Also please check our sample code for the correct usage since it is updated more frequently than the tutorial code.

Mark 

0 Kudos
Reply