Super Art Studio

Recent site activity

Home‎ > ‎Documents‎ > ‎

Xing VBR header

Xing VBR header
---------------

The Xing header is placed in the beginning of a frame, but actual position
may depend on wether mpeg 1/2/3 layer I/II/III and which bitrate was used.

For LSF (>= mpeg2) if the stream is mono, it starts at byte 9, else at byte 17.
In case of mpeg1, if the stream is mono, it starts at byte 17, else at byte 32.
(not counting the 4 byte header)

All values are stored in most significant bit first (big-endian) order.

4 bytes header tag ("Xing")
4 bytes header flags

If second bit of flags is set,
4 bytes number of frames

If third bit of flags is set,
4 bytes total stream size

If first bit of flags is set,
100*1 bytes 100 1-byte TOC entries

If forth bit of flags is set,
4 bytes vbr quality: 0 (best) .. 100 (worst)

Every TOC entry contains the size of the n-th frame. Calculating the position
of the 3rd frame should look as following: header_size + toc[0] + toc[1] + toc[2]