Introduction
An .mpg or .mpeg file usually holds an MPEG-1 or MPEG-2
program stream: MPEG video and audio interleaved for storage on a reliable medium such
as a disc or a hard drive. MPEG-1 files were the video of Video CDs and early PC
multimedia, and MPEG-2 program streams are the basis of DVD video.
The .vob (video object) files in the VIDEO_TS folder of a
DVD are MPEG-2 program streams with DVD restrictions. They also carry DVD navigation
packets, AC-3 or other audio, and subtitles as images. Each VOB file is at most 1 GB, so
a film is split across several.
Structure
A program stream is a series of packs. Each pack starts with the pack start code
00 00 01 BA and the system clock, and holds one or more PES packets. Each
PES packet starts with 00 00 01 and a stream ID: E0 to
EF for video, C0 to DF for MPEG audio, and
BD for private stream 1, which DVDs use for AC-3 audio and subtitles. A
system header (00 00 01 BB) describes the streams, and the end code
00 00 01 B9 closes the stream.
0Pack header00 00 01 BAand the system clock12 or 14 bytes…System header00 00 01 BB, in the first packvaries…PES packets00 00 01, stream ID, then video or audiorepeated…further packs, then the end code00 00 01 B9repeated
Links
Software
- VLC media player (Windows, macOS, Linux, mobile)
- mpv (Windows, macOS, Linux)
- HandBrake, which converts DVDs and MPEG files (Windows, macOS, Linux)
- FFmpeg (Windows, macOS, Linux)
- MakeMKV, which copies DVD titles into MKV files (Windows, macOS, Linux)
Developers
- libavformat, C, FFmpeg’s container library
Reference
- ITU-T Recommendation H.222.0, MPEG-2 Systems, which defines the program stream