How 90 kHz Clock Governs PTS in VOB Files
In DVD VOB (Video Object) files, maintaining accurate audio and video synchronization depends entirely on Presentation Time Stamps (PTS) calculated against a fixed 90 kHz clock frequency. This article explains the origin of the 90 kHz timebase derived from MPEG-2 standards, illustrates how it cleanly maps to common broadcast frame rates, and details the mechanics decoders use to translate these clock ticks into flawless presentation timing and lip-sync.
Origin in the MPEG-2 Standard
A VOB file is fundamentally an MPEG-2 Program Stream container. Under the MPEG-2 specification (ISO/IEC 13818-1), timing relies on a master System Time Clock (STC) running at a high-frequency base of 27 MHz. To make timestamping lightweight and manageable within packet headers, this master clock is divided by 300 to create a 90 kHz sub-clock specifically dedicated to presentation and decoding timestamps:
\[\frac{27\text{ MHz}}{300} = 90\text{ kHz (90,000 ticks per second)}\]
Every tick of the 90 kHz clock represents exactly \(1/90,000\)th of a second (approximately 11.11 microseconds).
Mathematical Alignment with Frame Rates
The 90 kHz frequency was intentionally selected by standards bodies because 90,000 is divisible by the frame rates common to television and cinema standards. This integer divisibility eliminates rounding errors that would otherwise accumulate and cause audio-video drift:
- 24 fps (Film): \(90,000 \div 24 = 3,750\) ticks per frame
- 25 fps (PAL Video): \(90,000 \div 25 = 3,600\) ticks per frame
- 30 fps (Component Video): \(90,000 \div 30 = 3,000\) ticks per frame
- 29.97 fps (NTSC Video): \(90,000 \div (30,000 / 1001) = 3,003\) ticks per frame
Because these intervals resolve to exact integers, each successive video frame simply increments the PTS by a fixed number of clock units.
How PTS Functions in the VOB Stream
Inside a VOB file, raw elementary streams (MPEG-2 video, AC-3 audio, DTS audio, and sub-pictures) are sliced into Packetized Elementary Stream (PES) packets. Within the header of a PES packet, a PTS can be embedded as a 33-bit binary integer.
When an MPEG-2 demuxer and decoder processes a VOB file, the following sequence occurs:
- Clock Synchronization: The decoder synchronizes its internal System Clock Reference (SCR) to the master timeline using periodic SCR markers in the stream pack headers.
- Buffer and Decode: Compressed data is loaded into decoding buffers. If a frame has a separate Decode Time Stamp (DTS), such as with bidirectional B-frames, it is decoded first.
- Target Presentation: The decoder monitors the running 90 kHz clock. When the local STC reaches the numerical value encoded in a packet's PTS, the associated video frame is rendered to the display, or the decoded PCM audio block is delivered to the digital-to-analog converter.
Audio-Video Synchronization and Drift Prevention
Audio packets also carry 90 kHz PTS values despite audio sample rates typically being 48 kHz in DVD production. The decoder computes the presentation instant for audio packets using the same 90 kHz counter. By evaluating the difference between the audio PTS and video PTS against the running system clock, the playback engine can detect sync disparities down to a fraction of a millisecond. If processing latency causes video to lag, the decoder can drop non-reference frames or repeat fields until the video PTS realigns with the audio PTS.
The 33-Bit Counter Limit
Because PTS values are represented using a 33-bit unsigned integer, the maximum value before overflow is \(2^{33} - 1\) (8,589,934,591 ticks). At 90,000 ticks per second, this allows a continuous playback timeline of:
\[\frac{2^{33}}{90,000 \times 3,600} \approx 26.5 \text{ hours}\]
This capacity comfortably exceeds the maximum storage capacity of any DVD-Video media, ensuring that timestamp wraparound does not occur during normal single-title playback.