How VOB Multiplexers Maintain 2048-Byte Pack Sizes
In DVD-Video authoring, all data is organized into Video Objects (VOBs) comprising strict, fixed-size 2048-byte sectors called packs. Because elementary video, audio, and subtitle streams naturally produce variable-length data, the multiplexer must reconcile these fluctuations without violating the physical sector requirements of DVD media. This article explains how multiplexers use payload fragmentation, PES header adjustments, and structured stuffing mechanisms to enforce exact 2048-byte boundaries across all content streams.
The Structure of a 2048-Byte VOB Pack
Every VOB pack matches the 2048-byte sector size of a standard DVD disc. A standard pack consists of three main segments:
- Pack Header (14 bytes): Contains synchronization markers, the System Clock Reference (SCR), the multiplex rate, and optional pack-level stuffing bytes.
- System Header (Optional, variable size): Present primarily at the start of a Video Object Unit (VOBU) to declare stream characteristics and maximum data rates.
- Packetized Elementary Stream (PES) Packet: Contains the actual stream payload (MPEG-2 video, AC-3/DTS audio, LPCM, or sub-pictures) along with stream IDs, Presentation Time Stamps (PTS), and Decoding Time Stamps (DTS).
Because the header sizes are strictly defined or calculable in advance, the multiplexer calculates the exact remaining byte budget available for stream data before allocating payload bytes.
Dynamic Payload Fragmentation
Elementary streams do not need to fit cleanly into a single pack. Video frames (especially MPEG-2 I-frames) routinely exceed 2048 bytes, while audio frames and sub-pictures are often much smaller.
The multiplexer breaks elementary stream access units into arbitrary slices. If a video frame requires 15,000 bytes, the multiplexer fragments that frame across multiple consecutive packs. Each pack receives a piece of the payload that perfectly fills the remaining space after accounting for pack and PES headers. The receiving decoder reassembles these fragments back into complete access units based on the stream timing and sequence headers.
Stuffing and Padding Mechanisms
Variable bitrates mean the multiplexer frequently encounters scenarios where the remaining data in an access unit is smaller than the available pack space. Rather than emitting an under-sized pack, the multiplexer deploys three distinct mechanisms to absorb leftover bytes:
- Pack Header Stuffing (1 to 7 bytes): The standard MPEG-2 pack header allows up to 7 stuffing bytes directly inside the pack header itself. Multiplexers use this for micro-adjustments when the shortfall is minimal.
- PES Header Stuffing (1 to 16 bytes): The PES header
includes a header data length field that allows arbitrary stuffing bytes
(
0xFF) preceding the payload. This provides another layer of fine-grained alignment. - Padding Packets (Large byte counts): When the
remaining payload data leaves a large gap (typically more than 16 to 20
bytes), the multiplexer inserts a dedicated MPEG padding packet (Stream
ID
0xBE). A padding packet has its own header and is filled with dummy bytes (0xFF) to consume all unused space up to the 2048th byte. In instances where an elementary stream ends or buffer constraints prevent transmitting real data, an entire pack can consist of a pack header followed solely by a padding packet.
Buffer Management and Scheduling
The multiplexer models the DVD player’s hardware buffers—such as the Video Buffer Verifier (VBV) and audio buffers—in real time. The decision to cut a packet, insert a padding pack, or switch to an audio pack is driven by these buffer levels.
By calculating the exact byte overhead of headers and stuffing before writing to the file, the multiplexer ensures that every stream packet is scheduled to prevent buffer underflow or overflow, while consistently outputting data in uniform 2048-byte blocks.