How VOB Files Identify AC-3 and Subpictures via 0xBD
DVD Video Object (VOB) files rely on the MPEG-2 Program Stream
specification, which reserves the stream ID 0xBD for
private, non-standard data known as private_stream_1.
Because standard MPEG-2 only inherently defines MPEG audio and video
streams, DVD authors multiplex secondary audio formats—such as AC-3
(Dolby Digital) and DTS—alongside bitmap-based subpicture subtitles into
this single 0xBD identifier. To separate and decode these
distinct data types, DVD decoders evaluate a proprietary sub-stream
header embedded directly at the start of the PES (Packetized Elementary
Stream) payload.
In a standard MPEG-2 PES packet, a 4-byte start code prefix
(0x000001) is immediately followed by a 1-byte Stream ID.
When this ID equals 0xBD, the demultiplexer recognizes that
the packet contains private data. However, the standard MPEG-2 header
does not define what kind of data follows. To solve this, the DVD-Video
specification mandates that the first byte of the PES packet payload
acts as a Sub-Stream ID. Demuxers read this byte to
identify the elementary stream type and track index.
The sub-stream ID byte uses specific numeric ranges to classify the data:
- AC-3 (Dolby Digital) Audio: Uses the hex range
0x80to0x87. This accommodates up to eight distinct AC-3 audio tracks (Track 0 is0x80, Track 1 is0x81, through to Track 7 at0x87). - Subpicture Streams: Uses the hex range
0x20to0x3F. This accommodates up to 32 independent subtitle and menu overlay tracks (Subpicture 0 is0x20, Subpicture 1 is0x21, through to Subpicture 31 at0x3F). - DTS Audio: Uses the hex range
0x88to0x8F. - Linear PCM Audio: Uses the hex range
0xA0to0xA7.
Beyond the 1-byte sub-stream ID, the DVD format includes specific private header structures depending on whether the payload is audio or subpicture data:
For AC-3 audio packets, the sub-stream ID is typically followed by three additional management bytes before the actual AC-3 audio frames begin:
- Number of Frame Headers (1 byte): Indicates how many AC-3 sync frames start in this packet.
- First Access Unit Pointer (2 bytes): An offset
pointing to the byte position where the first complete AC-3 audio sync
word (
0x0B77) begins, allowing the decoder to find frame boundaries even if an audio frame was split across multiple PES packets.
For Subpicture packets, the 1-byte sub-stream ID
(0x20–0x3F) is immediately followed directly
by the subpicture data unit (SPU). A subpicture unit contains a 4-byte
header consisting of the total SPU size (2 bytes) and the offset to the
subpicture display control sequence table (2 bytes), followed by the
run-length encoded bitmap pixel data.
By reading the MPEG-2 PES Stream ID 0xBD and immediately
inspecting the subsequent sub-stream ID byte, a VOB demultiplexer can
route incoming packets to either the AC-3 audio decoder or the
subpicture rendering engine.