There are mainly two formats of H.264(H.265) stream, Annexb and AVCC(HVCC), in Annexb, we need to add emulation prevention bytes to escape start code, I want to know wheather emulation prevention bytes exist in AVCC(HVCC) formatted stream, I checked the ITU specification, but didn't find the answer.
do you need remove emulation prevention bytes of H.264 stream in AVCC or HVCC format?
287 views Asked by codesavesworld AtThere are 4 answers
On
AVCC does not need them. AVCC prefixes the content with a (usually 4) bytes length prefix, and what follows is the content. Emulation prevention bytes are needed because special patterns are used to delimit NALs and when such patterns occour in the NAL emulation prevenion bytes are inserted to avoid wrong NAL delimiting
On
Here is your cheat sheet:
Both formats have NALUs and 0x03 prevention bytes are a part of this data stream.
So - expanding nobody555's answer - yes you do need to unescape them.
On
There are many quantities in the standard that are encoded using the Exp-Golomb code which can lead, in a certain set of circumstances, to the appearance of the sequence 0x000001 anywhere in the payload if the video stream is processed as is without an additional container According to the standard, the payload size is the size between 2 occurrences of the sequence 0x000001 before adding the NAL header both H.264 and H.265 standards were required to prevent emulation start code sequence look https://www.itu.int/rec/T-REC-H.264-202108-I 7.3.1 NAL unit syntax
or enter link description here 7.3.1.1 General NAL unit syntax



An AVCC(HVCC) formatted stream still uses the
emulation prevention bytebecause it is part of theNAL unitsyntax and not something specific to Annex B, such asstart code prefix.