DTS vs PTS in VOB Video Packets Explained

In DVD VOB (Video Object) files, accurate video synchronization relies on two critical markers embedded within the stream: the Decoding Time Stamp (DTS) and the Presentation Time Stamp (PTS). While the PTS dictates the exact moment a decoded video frame must appear on the screen, the DTS specifies the precise moment the compressed frame data must be processed by the decoder. This article explains the technical differences between DTS and PTS within VOB packets, why bidirectional frame compression makes both timestamps necessary, and how hardware decoders use them to prevent playback stutter and visual artifacts.

The Fundamental Difference: Decode Order vs. Display Order

A VOB file is based on the MPEG-2 Program Stream format. Inside this format, video data is segmented into Packetized Elementary Stream (PES) packets. Each packet header can contain timing information to ensure the audio and video remain in sync:

In basic video streams where frames are displayed in the exact order they are decoded, DTS and PTS are identical. However, in modern compression schemes, the order in which frames are decoded frequently deviates from the order in which they must be displayed.

The Role of B-Frames in VOB Files

The divergence between DTS and PTS in VOB files is driven entirely by the use of bidirectional predictive frames, known as B-frames. MPEG-2 video relies on three primary frame types:

  1. I-Frames (Intra-coded): Standalone images that do not require any reference frames to decode.
  2. P-Frames (Predicted): Compressed images that reference previous I-frames or P-frames.
  3. B-Frames (Bidirectional): Highly compressed frames that require data from both a preceding reference frame and a future reference frame to decode properly.

Because a B-frame needs data from a future frame to be reconstructed, the decoder must receive and decode that future frame before it can decode and display the intermediate B-frame.

For example, consider a display sequence of frames: I1 - B2 - B3 - P4.

To render B2 and B3, the decoder must already have both I1 and P4 decoded and stored in memory. Consequently, the stream reorders the delivery of the packets so the transmission and decode order becomes: I1 - P4 - B2 - B3.

In this scenario:

Timestamp Handling in the VOB/PES Header

Inside the PES header of a VOB packet, flags indicate whether timestamps are present. Because carrying two 33-bit timestamps inside every single packet would introduce unnecessary overhead, MPEG-2 utilizes a conditional structure:

Buffer Management

Beyond establishing playback order, DTS is critical for MPEG-2 buffer management (the Video Buffer Verifier, or VBV). The DTS tells the decoder precisely when to pull data out of the buffer, preventing buffer underflows (where the decoder has no data to display) and buffer overflows (where incoming data exceeds available memory). Once the frame is decoded at the time indicated by the DTS, it sits in a frame store buffer until the clock reaches the PTS, at which point it is instantly pushed to the display.