Media (Intel® oneAPI 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
3028 Discussions

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)

   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

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