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

Insufficient buffers returned by MFXVideoDECODE_QueryIOSurf in software decoding

Jack_Chimasera
Beginner
841 Views
Hello
As there's no real control over the latency of the hardware decoder in 3.0beta2, I've switched out video conf application to a combination of hardware encoding, software decoding.
This gave rise to a new issue : the MFXVideoDECODE_QueryIOSurf function, called by the decoder (software) to decode the incoming stream (hardware) returns an insufficient number of buffers, causing the application to hang, looking for a free buffer to use.
Namely, it returns 1 buffer, when testing has shown that 9 are required for it to work properly (with much greater latency than with the software encoder, for some reason !)
in short, only this combination of hardware encoder and software decoder seems to have this issue (all settings are for lowest possible latency). Following is the code for the decoder.
Please inform me what else is needed to identify the issue (full source ? a recorded stream ?).

regards

Jack Chimasera

memset (&m_DecodedVideoParameters,0,sizeof (m_DecodedVideoParameters));
m_DecodedVideoParameters.mfx.CodecId=MFX_CODEC_AVC;
m_DecodedVideoParameters.AsyncDepth=1;
Status=MFXVideoDECODE_DecodeHeader (m_DecodingSession, m_InputBitStream,&m_DecodedVideoParameters);
m_DecodedVideoParameters.mfx.NumThread=1;
if (Status==MFX_ERR_NONE)
{
// initialize
m_DecodedVideoParameters.IOPattern = MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
m_DecodedVideoParameters.mfx.DecodedOrder = 0;

Status=MFXVideoDECODE_Init (m_DecodingSession,&m_DecodedVideoParameters);
if (CheckError (Status,L"MFXVideoDECODE_Init")) return;
if (Status==MFX_ERR_NONE)
{
// initialize the frames
mfxFrameAllocRequest AllocRequest;
Status=MFXVideoDECODE_QueryIOSurf (m_EncodingSession,&m_DecodedVideoParameters,&AllocRequest);
if (CheckError (Status,L"MFXVideoDECODE_QueryIOSurf")) return;
AllocRequest.NumFrameMin+=8;
AllocRequest.NumFrameSuggested+=8;
mfxFrameAllocResponse AllocResponse;
Status=m_SysmemAllocator->Alloc (m_SysmemAllocator->pthis,&AllocRequest,&AllocResponse);


0 Kudos
1 Solution
Nina_K_Intel
Employee
841 Views
Hello Jack,

I believe the problem is in passing m_EncodingSession to DECODE_QueryIOSurf which is the hw session as far as I understood. It's not consistent to call DECODE methods with different sessions.

Please try fixing this.

Regards,
Nina

View solution in original post

0 Kudos
2 Replies
Nina_K_Intel
Employee
842 Views
Hello Jack,

I believe the problem is in passing m_EncodingSession to DECODE_QueryIOSurf which is the hw session as far as I understood. It's not consistent to call DECODE methods with different sessions.

Please try fixing this.

Regards,
Nina
0 Kudos
Jack_Chimasera
Beginner
841 Views
You are obviously correct, how utterly embarassing...
0 Kudos
Reply