Sequence End Codes in VOB Video Explained
This article explores the specific function of Sequence End Codes (SECs) within DVD Video Object (VOB) files, examining how they act as critical markers for terminating MPEG-2 video streams. You will learn the technical definition of a sequence end code, how it instructs hardware and software decoders to handle buffer flushing, its significance in managing DVD cell and chapter transitions, and the playback anomalies that occur when these markers are corrupted or omitted.
What Is a Sequence End Code?
In the MPEG-2 video standard (ISO/IEC 13818-2), which forms the video
core of DVD VOB containers, a Sequence End Code is a 32-bit start code
represented in hexadecimal as 00 00 01 B7. It serves as an
explicit syntactic delimiter signaling that the current video sequence
has concluded and that no subsequent pictures belong to that specific
sequence header context.
Signaling Stream Termination
Inside a VOB file, video data is organized into cells, programs, and Video Object Units (VOBUs). When a video segment—such as an angle, chapter, menu loop, or entire title—comes to an end, the MPEG-2 video elementary stream must be formally closed. The sequence end code explicitly informs the video parser that the bitstream for that segment is complete, preventing the parser from searching for additional slice data or picture headers where none exist.
Decoder Buffer Management
One of the primary roles of the sequence end code is managing the Video Buffer Verifier (VBV). During playback, decoders maintain a strict buffer state to prevent underflows and overflows:
- Buffer Flushing: When the decoder encounters
00 00 01 B7, it knows to decode and output any remaining frames currently held in the reordering buffer (such as backward-predicted B-frames or reference P-frames). - State Reset: It resets the internal registers and
parsing parameters of the decoder, returning it to an idle or initial
state in preparation for the next sequence header
(
00 00 01 B3).
Facilitating Cell and Chapter Transitions
DVD playback relies on dynamic branching, multi-angle selections, and non-linear navigation between cells. Sequence end codes dictate how transitions between these segments behave:
- Non-Seamless Branching: In standard cuts, chapter stops, or jumps between different VOB IDs, a sequence end code terminates the segment. This ensures that changes in video attributes (such as an aspect ratio shift from 4:3 to 16:9 or a change in bitrate) can take place cleanly without video distortion.
- Distinction from Seamless Playback: For seamless multi-angle scenes or seamless branching, sequence end codes are deliberately omitted at intermediate cell boundaries. This prevents the decoder from resetting its clock reference (SCR/PTS) and buffers, ensuring an uninterrupted picture. Conversely, their inclusion marks a mandatory break where playback parameters can be re-evaluated.
Consequences of Missing Sequence End Codes
If a non-seamless VOB segment lacks a proper sequence end code at its termination point, playback failures commonly follow:
- Decoder Freezes: The decoder may hang while waiting for terminating data packets that do not exist.
- Visual Artifacts: Decoders may attempt to decode residual buffer data against the incoming sequence, resulting in brief macroblocking, green frames, or picture tearing.
- Audio/Video Desynchronization: Without an explicit end code to finalize the presentation timestamps (PTS) of the segment, the multiplexer and audio decoders may lose synchronization across subsequent navigation points.