Media (Intel® oneAPI Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools from Intel. This includes Intel® oneAPI Video Processing Library and Intel® Media SDK.

H.264 NAL unit and SPS/PPS


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?

Thank you,


0 Kudos
2 Replies
Does my question make sense? The issue is trying to get the intel h264 encoded output into an RTP/RTSP SDK. Currently I manually pull out the SPS and PPS from this SDK and feed into the RTSP SDK, but their SDK will auto parse this out if this info is already in the stream. Also,if I can get this encoder to output a complete H264 Nal unit, it will save a ton of CPU work as the RTSP SDK would no longer need to parse the bytestream.
Hi Vincent,

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.