I use IMSDK to decode video streams. I am facing an issue using the h264 decoder. I feed the decoder NAL by NAL, using the MFX_BITSTREAM_COMPLETE_FRAME flag : it is more convenient to us because our architecture produces a different buffer for each frame. The framework above my application just gives me SPS and PPS as first buffer. Actual payload, including first frame, comes after, and I would prefer not to wait that long since adding delay at this point would increase global latency. So, I call MFXVideoDECODE_DecodeHeader as soon as possible with just SPS and PPS bitstream to initialize the decoder.
Usually, this function returns MFX_ERR_NONE and it seems to be OK to initialize the decoder with such a short bitstream. However, sometimes, it returns -10 (MFX_ERR_MORE_DATA).
I made a test to test this case (zip file).
I tested on three different platforms :
1) A desktop PC, Intel Core i7 (http://ark.intel.com/products/65719/Intel-Core-i7-3770-Processor-8M-Cache-up-to-3_90-GHz), Graphics Driver 18.104.22.16871, Windows 8 64bit, IMSDK API HW 1.6 => MFXVideoDECODE_DecodeHeader returns 0
2) A Intel NUC DC3217IYE (http://www.intel.com/p/en_US/support/highlights/dsktpboards/dk-dc3217iye), Intel Core i3 (http://ark.intel.com/products/65697/Intel-Core-i3-3217U-Processor-), Graphics Driver 22.214.171.12457, Windows 7 Pro 32bit, IMSDK API HW 1.7 => MFXVideoDECODE_DecodeHeader returns 0
3) A laptop PC, Intel Core i5 (http://ark.intel.com/products/64903/Intel-Core-i5-3427U-Processor-3M-Cache-up-to-2_80-GHz), Graphics Driver 126.96.36.19967, Windows 8 64bit, IMSDK API HW 1.5 => MFXVideoDECODE_DecodeHeader returns -10
I do not understand at this point why the result of the header parsing function depends on hardware. Do you have any clue to get through decoder initialization without feeding it with the first frame ?
The behavior of DecodeHeader have changed in recent releases of the the Intel graphics driver and Media SDK. If you are using an old driver you may have to resort to padding the stream header with an I-frame NAL header to ensure correct behavior. This issue has been discussed in a few earlier forum posts, such as this one: http://software.intel.com/en-us/forums/topic/311640
I guess I did my research using wrong keywords.
Just a last question : do we have to insert relevant frame headers at the end of bitstream buffer using mpeg-2 and VC1 decoders too ?
Thanks a lot.