When EncodeFrameAsync is completed and has mfxBitstream filled, does each mfxBitstream contain a complete H.264 NAL unit? Im guessing its not hence bitstream. If it doesnt put out a complete, does a way to exist to configure this SDK to put out a complete H264 Nal unit? Also, how often does the SPS and PPS get placed into the stream?
Complete NAL units are written to bitstream at the moment encoded data is available (syncoperation).
Media SDK may write several NAL units at one time such as AUD, SPS, PPS, SEI, H264 slice.There is no need to configure the SDK or explicitly ask it to output complete NAL units.
You can control the frequency of SPS/PPS via the "IdrInterval" parameter. If you set this parameter to "0" an SPS/PSS will be inserted before every I frame. For more details please refer to the reference manual.
You do not have to manually extract SPS/PPS. The Media SDK API provides a mechanism for extracting SPS/PPS after encoder initialization. Please refer to chapter 4.14 in "Intel_Media_Developers_Guide.pdf" (part of the SDK package) for details on how to do this.