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

Handling of the emulation prevention byte in the H264 encoder

Daniel_E-B
Beginner
730 Views

Hi,

I'm using the H264 encoder to encode video and some SEI registered and unregistered data.

I would like to now if it is our reponsability (in the case of the insertion of a SEI unregistered timecode for instance) to generate the emulation prevention byte or if is done by the Media SDK's encoder.

Thanks!

0 Kudos
3 Replies
Petter_L_Intel
Employee
730 Views

Hi Daniel,

It is the responsibility of the application to insert custom SEI payloads. There is a chapter in the Media SDK Developers Guide document showcasing an example on how to insert SEI messages into encoded streams.

Regards,
Petter 

0 Kudos
Daniel_E-B
Beginner
730 Views

Hi Petter,

I'm aware that it is the application's responsability to insert the SEI payloads. In fact, I have read the Developpers Guide and done accordingly in my code. However, in the Developpers Guide there's no mention of the "emulation prevention byte".

The ITU-T H.264 specification recommends to add this byte of value 0x03 to a NAL unit in order to ensure that no sequence of consecutive bytes in the NAL unit contains a start code prefix.

For instance: if in my SEI payload I have a value equivalent to a start code prefix: 0x000001, the last byte should be changed to 0x03 so a potential decoder wouldn't mistake the presence of these bytes as the beginning of a new NAL unit.

Now my question:

Is it the application's responsabilty to add this byte in the payload of a NAL unit? Or does the Media SDK do a sort of check on the received payload to add the emulation byte?

Thanks!

0 Kudos
Petter_L_Intel
Employee
730 Views

Hi Daniel,

I just realized your question was never answered.  Sorry for the delay.  Media SDK will apply EPB automatically to SEI messages which are added by application as payload during encode.

Regards,
Petter

0 Kudos
Reply