Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Ashim_P_
Beginner
53 Views

MFX_ERR_NOT_ENOUGH_BUFFER but MFXVideoENCODE_GetVideoParam returns same size

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
53 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?

Reply