How SCR in VOB Headers Establishes Decoder Timing
The System Clock Reference (SCR) found in a DVD Video Object (VOB) header is the master synchronization timestamp that calibrates a decoder’s internal clock to match the encoder's clock. In DVD-Video, VOB files are structured as MPEG-2 Program Streams consisting of discrete packs, each beginning with a pack header containing an SCR. By periodically delivering the encoder’s time base, the SCR prevents buffer underflow or overflow and ensures that elementary streams—such as video, audio, and subtitles—remain synchronized across the playback timeline.
The Role of the Pack Header and SCR Structure
A VOB file is partitioned into 2,048-byte packs. The pack header marks the beginning of each pack and contains the SCR field. The SCR represents the precise theoretical arrival time of the last byte of the pack header into the decoder’s input buffer.
The SCR value is a 42-bit timestamp derived from a 27 MHz reference clock. It is split into two components:
- SCR Base (33 bits): Measured at a frequency of 90 kHz, providing backward compatibility with standard presentation timers.
- SCR Extension (9 bits): Operates at the full 27 MHz frequency, providing high-precision fractional timing between the 90 kHz increments.
Calibrating the Decoder’s System Time Clock (STC)
Hardware and software decoders possess an internal free-running clock called the System Time Clock (STC). Because independent hardware oscillators drift over time due to temperature fluctuations and component tolerances, the decoder’s STC cannot run autonomously without falling out of sync with the stream.
When the decoder encounters the first pack of a VOB stream:
- It reads the initial SCR and directly loads this value into its STC.
- As subsequent packs arrive, the decoder compares incoming SCR values against the current STC value.
- A Phase-Locked Loop (PLL) or software tracking loop continuously adjusts the STC frequency, slowing it down or speeding it up to eliminate drift relative to the incoming SCR values.
Regulating Buffer Management
Decoders rely on input buffers to smooth out variable bitrate (VBR) data streams before decoding. If data arrives too quickly, the decoder's buffer overflows and drops packets; if data arrives too slowly, the buffer underflows, causing playback to freeze.
The SCR manages this delivery flow. The multiplexer calculates SCR values to dictate exactly when each pack should enter the system target decoder. The decoder uses the arrival timeline defined by the SCR to extract elementary stream packets (PES packets) at the intended rate, maintaining steady buffer occupancy.
Interplay with PTS and DTS
The SCR acts strictly as a delivery and clock-synchronization mechanism; it does not determine when an individual audio frame or video picture is decoded or rendered. That role belongs to Decoding Time Stamps (DTS) and Presentation Time Stamps (PTS) embedded within the Packetized Elementary Stream (PES) headers.
Once the STC is synchronized via the SCR:
- The decoder monitors the advancing STC.
- When the STC reaches the value stored in a frame's DTS, that compressed frame is sent to the decoder pipeline.
- When the STC reaches the value stored in a frame's PTS, the uncompressed image or audio sample is presented to the user.
By anchoring the STC to the physical stream timing, the SCR ensures that both audio and video PTS/DTS values refer to a stable, shared time base, maintaining continuous lip-sync throughout playback.