0

H264 bitstreams has a three-byte or four-byte start code, 0x000001 or 0x00000001.

what are the difference between 0x000001 (3Bytes) and 0x00000001(4Bytes)?

thank you !

smart
  • 1
  • Does this answer your question? [How is a h264 idea bitstream organized? / header start codes](https://stackoverflow.com/questions/2732028/how-is-a-h264-idea-bitstream-organized-header-start-codes) – kvantour Jul 02 '20 at 09:48
  • This might also be of assistance: https://www.itu.int/rec/T-REC-H.264-201906-I/en – kvantour Jul 02 '20 at 09:51

1 Answers1

1

3 byte take less space, so are preferable, but not do not include enough information to detect byte alignment. If you join a stream of bits in the middle of a byte, you can find 4 byte start codes by looking for 31 zero bits followed by a 1 bit. The first bit after the 1, is the start of a byte. 31 consecutive zeros is not possible to occur in a well constructed NALU.

This is why the 4 byte variation is generally only used before NALUs suitable for random access, such as AUD, SPS, PPS, and IDR.

This feature is not commonly used however, because networking protocols often handle the byte alignment, and broadcast protocols usually have a container, like TS, that have a similar method.

szatmary
  • 29,969
  • 8
  • 44
  • 57