Skip to content

Instantly share code, notes, and snippets.

@XueshiQiao
Last active September 28, 2024 18:23
Show Gist options
  • 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