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.

MFX_ERR_NOT_ENOUGH_BUFFER

Matthew_C_7
Beginner
853 Views

I am trying to figure out why this command gives a MFX_ERR_NOT_ENOUGH_BUFFER error:

sts = mfxENC->EncodeFrameAsync(NULL, YUVFrame, &mfxBS, &syncp);

YUVFrame has Y,U, and V pointing to buffers and the format is MFX_CHROMAFORMAT_YUV420 and MFX_FOURCC_NV12

mfxBS is the mfxBitstream and seems to have Data initialized and has a MaxLength of 375000

Thank you!

0 Kudos
2 Replies
Matthew_C_7
Beginner
853 Views

Couple other notes, the very first time, no error is thrown but it returns a data length of 0.

mfxBS has a DataLength of 22383 after that command is called, which doesn't seem close to the MaxLength of 375,000 and shows that it does seem to be doing something.

Related, why does that command return anything?  I thought that it was asynchronous, and essentially just spun off a thread and that SyncOperation would be the one returning the error codes.  Which does return an error of itself, MFX_ERR_NULL_PTR, which I assume its because syncp returned by EncodeFrameAsync is being returned as NULL.

 

 

0 Kudos
Petter_L_Intel
Employee
853 Views

Hi Matthew,

MFX_ERR_NOT_ENOUGH_BUFFER return code from EncodeFrameAsync means that the buffer you have allocated to store the compressed bit stream is not large enough to store the frame generated by the encoder.

Make sure you allocate enough memory to store expected maximum size of compressed frames. For examples on how to determine bit stream buffer size and allocation, please refer to the Media SDK "sample_encode" sample or the encode samples part of the Media SDK Tutorial.

Regards,
Petter

 

0 Kudos
Reply