A few questions about the startcode of NALU

148 views Asked by At

I am a beginner to study MPEG4, and there are some definitions that confuse me.

  1. It is said if a NALU slice is the first slice of a frame, then the startcode of NALU is 4 bytes "\x00\x00\x00\x01", otherwise it is 3 bytes "\x00\x00\x01". I want to know is that mandatory? I find it seems always 4 bytes used in Android MPEG4Writer.

  2. Is it possible that a NALU slice ends with "\x00", if so, how can we determine this "\x00" belongs to the preceding NALU or the following NALU?

1

There are 1 answers

0
szatmary On BEST ANSWER
  1. No. 3 byte start codes are not required. But can be used to save a little space.

  2. No. Every NALU has a stop bit. So the last byte is guaranteed to never be 0.