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