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

MFX_ERR_NOT_ENOUGH_BUFFER but MFXVideoENCODE_GetVideoParam returns same size

Ashim_P_
Beginner
606 Views

MFXVideoENCODE_EncodeFrameAsync is returning MFX_ERR_NOT_ENOUGH_BUFFER. But querying video parameters using following code returns the same size again as was returned by MFXVideoENCODE_Init.

    mfxStatus status;
    mfxVideoParam param;

    memset(&param, 0, sizeof(mfxVideoParam));

    status = MFXVideoENCODE_GetVideoParam(priv->session, &param);
    if (status != MFX_ERR_NONE)
    {
        return;
    }

   printf("new size = %d\n", param.mfx.BufferSizeInKB) --> This returns the same size as was returned after init of encoder.

and hence call to MFXVideoENCODE_EncodeFrameAsync is always failing after few frames when this happens.

I am using version 1.16

0 Kudos
1 Reply
Jeffrey_M_Intel1
Employee
606 Views

This error means that the buffer size is too small for the output bitstream from the encoder. 

Did you convert from kilobytes to bytes, i.e.

mfxBS.MaxLength = par.mfx.BufferSizeInKB * 1000?

Also, as long as the buffer is significantly larger than the largest frame generated you can use your own buffer size.  Does this error go away if you increase buffer size to a few MB?

Can you replicate this behavior with the samples or tutorials?

0 Kudos
Reply