Skip to content

Instantly share code, notes, and snippets.

@XueshiQiao
Last active February 26, 2023 15:44
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save XueshiQiao/d68bea4a5406dd648664ce66933aeed9 to your computer and use it in GitHub Desktop.
Save XueshiQiao/d68bea4a5406dd648664ce66933aeed9 to your computer and use it in GitHub Desktop.
H.264 Annex B format and AVCC format

AnnexB format:

([start code] NALU) | ( [start code] NALU) |

AVCC format:

([extradata]) | ([length] NALU) | ([length] NALU) |

In annexb, [start code] may be 0x000001 or 0x00000001.

In avcc, the bytes of [length] depends on NALULengthSizeMinusOne in avcc extradata, the value of [length] depends on the size of following NALU and in both annexb and avcc format, the NALUs are no different.

Ref: StackOverflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment