Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Beginner
56 Views

Handling of the emulation prevention byte in the H264 encoder

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
Highlighted
Employee
56 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
Highlighted
Beginner
56 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
Highlighted
Employee
56 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