The basics
What is an MPEG file?
MPEG is the name of the Moving Picture Experts Group, the ISO/IEC committee behind MP3, MP4 and much of digital video. A file called .mpg or .mpeg is usually an MPEG program stream: video compressed with MPEG-1 or MPEG-2 and audio (usually MP2), multiplexed together in the container defined by MPEG-1 and MPEG-2 Systems. It's the format of Video CDs and, with some extensions, DVDs, and it was the default output of many camcorders, TV capture cards and early digital cameras.
Unlike MP4, there's no index and no file header: an MPEG file is a stream of small packs, each with its own timing, written one after another. That was designed for discs and broadcast, where a player starts reading wherever it is, but it makes seeking slower and less precise than in MP4.
Not the same as MP4
An .mpg file is not an MP4. MP4 (MPEG-4 Part 14) is a later, box-based container from the same committee, usually with H.264 video. MPEG files hold the older MPEG-1 or MPEG-2 codecs, which need roughly twice the bit rate of H.264 for similar quality.
Anatomy
What's inside an MPEG file
A program stream is a sequence of packs. Each pack starts with 00 00 01 BA and a clock reference, followed by one or more PES packets that carry pieces of the video or audio. Everything in the stream, down to the pictures inside the video, begins with a 3-byte start code 00 00 01 and an ID byte. Here are the first bytes of a 1-second MPEG-2 file we made for this page with FFmpeg, laid out like a DVD stream. It isn't offered for download.
tiny.mpg: MPEG-2 program stream, 1 second, 720×480, MP2 audio
offset bytes part
0 00 00 01 BA pack start code
4 44 00 04 00 04 01 SCR 0: the stream clock starts
10 01 89 C3 F8 mux rate 25,200 × 50 bytes/s
14 00 00 01 BB 00 0C 80 C4 E1 04 21 FF system header
26 E0 E0 E5 C0 C0 20 streams: video E0, audio C0
32 00 00 01 E0 07 DA PES packet, stream E0, 2,010 bytes
38 80 C1 0E flags: PTS and DTS present
41 31 00 03 77 07 PTS 48,003 = 0.533 s (show)
46 11 00 03 5F 91 DTS 45,000 = 0.500 s (decode)
55 00 00 01 B3 2D 01 E0 14 … sequence header: 720 × 480, 29.97 fps
67 00 00 01 B5 14 8A … extension: Main Profile, Main Level
77 00 00 01 B8 00 08 00 40 GOP header
85 00 00 01 00 00 0F FF F8 picture 1: an I-frame
2048 00 00 01 BA 44 00 04 04 94 01 … pack 2: SCR 146 (1.6 ms later)
2062 00 00 01 C0 07 EC 80 81 09 … PES packet, stream C0: MP2 audio
4096 00 00 01 BA … pack 3
4110 00 00 01 E0 … more video
… 314 packs of 2,048 bytes in all
643039 00 00 01 BE 00 1B FF FF … padding packet fills the last pack
643072 end of file- 1
00 00 01 BAThe pack start code
Every pack begins with it, and so does the file. A reader that lands in the middle of a stream, or a damaged file, scans forward to the next
00 00 01 BAand carries on. That's why an MPEG file can be cut at almost any pack boundary and still play. - 2
44 00 04 00 04 01The system clock reference
The SCR: a timestamp on a 90 kHz clock (plus a 27 MHz extension) saying when this pack should arrive at the decoder. The leading bits
01mark an MPEG-2 pack header, 14 bytes long; MPEG-1's is 12 bytes and starts with0010. - 3
01 89 C3 F8Mux rate and stuffing
The stream's data rate in units of 50 bytes per second: 25,200, which is 10.08 Mbit/s, the maximum for DVD-Video. The low bits of the last byte give the number of stuffing bytes, zero here.
- 4
00 00 01 BBThe system header
Lists the streams in the file and the buffer each needs: video stream
E0and audio streamC0. Players use it to set up decoders before the first frame arrives. - 5
00 00 01 E0 07 DAA PES packet
A packetized elementary stream packet: a piece of one stream, with its ID and length (2,010 bytes). IDs
E0toEFare video,C0toDFMPEG audio,BDprivate stream 1 (AC-3, LPCM and subtitles on DVDs),BEpadding andBFprivate stream 2 (DVD navigation data). - 6
PTS · DTSPresentation and decoding times
Also on the 90 kHz clock. This first picture is decoded at 0.500 s and shown at 0.533 s: with B-frames, pictures arrive in a different order from the one they're shown in. FFmpeg starts the clock half a second ahead of the first picture, giving the decoder's buffer time to fill.
- 7
00 00 01 B3 · B5 · B8 · 00Inside the video
The MPEG-2 video stream has its own start codes: a sequence header (
B3) with the size and frame rate, a sequence extension (B5) with profile and level, a group-of-pictures header (B8) and then a picture (00), the first one an I-frame. - 8
00 00 01 C0Interleaved audio
Packs of video and audio alternate in roughly the order the decoder needs them. This file has 314 packs of exactly 2,048 bytes, one DVD sector each: 302 carry video, 12 audio.
- 9
00 00 01 BEPadding and the end
A padding packet fills the last pack to 2,048 bytes. The standard defines an end code,
00 00 01 B9; FFmpeg leaves it out here, and players don't need it.
Versions
MPEG-1 vs MPEG-2
| MPEG-1 | MPEG-2 | |
|---|---|---|
| Standard | ISO/IEC 11172, published 1993 | ISO/IEC 13818, approved 1994 (also ITU-T H.262 and H.222.0) |
| Designed for | Video at up to about 1.5 Mbit/s, roughly a CD's data rate | TV quality and above, at several Mbit/s |
| Typical picture | 352×240 or 352×288, progressive | 720×480 or 720×576 on DVD, up to 1920×1080 in HD broadcast; interlaced or progressive |
| Where you'll meet it | Video CDs, CD-ROM and early web video, old digital cameras | DVDs, digital TV (DVB, ATSC), DVD and HDV camcorders, TV capture |
| Pack header | 12 bytes, starts with bits 0010 | 14 bytes or more, starts with bits 01 |
| Audio | MPEG-1 Layer II (MP2), sometimes Layer I or III | MP2, plus AC-3 and LPCM in DVD streams |
MPEG-2 decoders also play MPEG-1, and both use the same start-code structure, so most software treats them as one family. To tell which a file holds, run ffprobe file.mpg: it reports mpeg1video or mpeg2video, plus the profile and level for MPEG-2. Main Profile at Main Level, used for DVDs and standard-definition broadcast, allows up to 720×576 pixels and 15 Mbit/s.
Related formats
VOB, TS, M2TS and other MPEG relatives
| Extension | What it is | Where it comes from |
|---|---|---|
.mpg, .mpeg, .m2p | MPEG-1 or MPEG-2 program stream | VCDs, capture cards, old cameras, exports |
.vob | A program stream with DVD extras: AC-3 or LPCM audio and subtitles in private stream 1, navigation packs in private stream 2 | The VIDEO_TS folder of a DVD |
.mod | DVD-style program streams from JVC, Panasonic and Canon camcorders | Standard-definition hard-disk camcorders |
.ts, .mts, .m2ts | MPEG transport stream: fixed 188-byte packets (192 in .m2ts) starting with 47, built to survive transmission errors and carry several programmes | Digital TV, Blu-ray, AVCHD camcorders, HLS streaming segments |
.m1v, .m2v, .mp2 | A single elementary stream: video only or audio only, with no container | DVD authoring and encoding tools |
A .vob file usually opens as an .mpg in a player, because it is one, with extras. The Library of Congress notes that renaming a VOB to .mpg keeps it readable, though most MPEG-2 players ignore its subtitle tracks. Transport streams use the same PES packets as program streams but cut them into small fixed-size packets, which is why the same video can move between .ts and .mpg without re-encoding: ffmpeg -i in.ts -c copy out.mpg.
On the web
Patents, licensing and why browsers don't play MPEG files
Both video codecs were once patent-licensed. MPEG-1's patents have all expired, and MDN describes it as free to use. MPEG-2's last US patent expired on 13 February 2018; Via LA, which runs the MPEG-2 patent pool, says patents are now active only in Malaysia. So encoding and decoding MPEG-1 and MPEG-2 is effectively free almost everywhere.
Browsers never adopted them anyway. Chrome, Edge and Firefox don't decode MPEG-1 or MPEG-2 video, and they don't read program streams, so an .mpg link downloads instead of playing. MDN lists Safari as able to decode both codecs, but no other browser can, and for a web page you'd convert to MP4 regardless: H.264 gives the same quality in a fraction of the size.
# MPEG to MP4 for the web (H.264 + AAC, deinterlaced)
ffmpeg -i in.mpg -vf yadif -c:v libx264 -crf 20 -c:a aac -movflags +faststart out.mp4The yadif filter deinterlaces: most DVD and TV material is interlaced, which shows as comb-like stripes on moving edges when it's played on a computer screen. Leave it out for progressive sources such as Video CDs.
Troubleshooting
Common MPEG problems and their causes
| Symptom | Usual cause | Fix |
|---|---|---|
| Stripes or combing on movement | Interlaced video shown without deinterlacing. | Turn on deinterlacing in the player (VLC: Video → Deinterlace), or convert with -vf yadif. |
| Wrong duration, or seeking jumps around | There's no index: players estimate positions from the bit rate and timestamps. | Remux to MP4 or MKV with -c copy if the codecs allow, or convert to MP4. |
| Picture but no sound | AC-3 or LPCM audio in private stream 1 (typical of VOB files) that the program doesn't handle. | Use VLC or mpv, or convert the audio to AAC. |
| Picture squashed or stretched | DVD pixels aren't square: 720×480 is shown at 4:3 or 16:9, according to a flag in the sequence header. | Use a player that respects the aspect ratio flag; when converting, FFmpeg keeps it. |
| Timestamps jump, audio drifts after joining files | Concatenated captures or VOBs with clock resets at each join. | Join them with ffmpeg -i "concat:VTS_01_1.VOB|VTS_01_2.VOB" -c copy all.mpg, then convert to MP4, which rewrites the timing. |
How to
How to open, edit and convert an MPEG file
- Windows: the Media Player app plays MPEG-1; MPEG-2 may need Microsoft's MPEG-2 Video Extension from the Microsoft Store. VLC plays everything, including VOBs.
- macOS: VLC or IINA play every kind; Apple's own players handle only some.
- Linux: VLC or mpv.
- Phones: VLC for Android and iOS. The built-in players usually don't open
.mpgfiles. - Edit: Shotcut, Kdenlive, DaVinci Resolve and Premiere Pro import MPEG-2; for quick cuts without re-encoding, Avidemux cuts at keyframes.
- Convert: HandBrake (free, with presets) or the FFmpeg command above. To keep the original MPEG-2 video without re-encoding in a more modern container, remux to MKV:
ffmpeg -i in.mpg -c copy out.mkv.
Ripping your own DVDs
Unencrypted DVD folders convert like any .vob. Most commercial DVDs are encrypted with CSS, and the law on bypassing it varies by country; this page doesn't cover that.
Security
Is an MPEG file safe?
- No code inside. An MPEG file holds only audio, video and timing data; it can't run anything.
- Decoder bugs. As with any media format, a crafted file could trigger a flaw in a decoder. Keep players updated, especially on servers that convert uploads.
- Fake files.
movie.mpg.exeis a program. Turn on file name extensions in Windows File Explorer, and be wary of sites that say you need a special "codec" to play a download.
Sample files
There are no sample MPEG files on this page. To make one for testing, run ffmpeg -f lavfi -i testsrc2=duration=5:size=720x480:rate=30000/1001 -f lavfi -i sine=frequency=440:duration=5 -target ntsc-dvd test.mpg for DVD-style MPEG-2, or use size=352x240 with -target ntsc-vcd for Video CD-style MPEG-1.
Put it online
Have an MPEG file? Give it a link.
Drop an MPG or MPEG file on 99helpers and it gets its own address to send instead of a large attachment. Browsers don't play MPEG program streams, so visitors download it; convert it to MP4 first if it should play in the browser.
Questions
MPEG files, frequently asked
What is an MPG file?
A video in an MPEG-1 or MPEG-2 program stream, the format of Video CDs, DVDs and many older camcorders and TV recordings. .mpg and .mpeg are the same thing.
Is MPEG the same as MP4?
No. Both come from the Moving Picture Experts Group, but MP4 is a newer container, usually with H.264 video. An .mpg file holds older MPEG-1 or MPEG-2 video in a program stream.
How do I play an MPG file?
VLC and mpv play every kind on Windows, macOS, Linux and phones. Browsers other than Safari can't.
How do I convert MPG to MP4?
Use HandBrake, or ffmpeg -i in.mpg -vf yadif -c:v libx264 -crf 20 -c:a aac out.mp4. The yadif filter deinterlaces DVD and TV material.
What's the difference between MPEG-1 and MPEG-2?
MPEG-1 (1993) targets about 1.5 Mbit/s and small pictures, as on Video CDs. MPEG-2 (1994) handles TV and HD resolutions, interlacing and higher bit rates, and is used on DVDs and digital TV.
Is a VOB file an MPEG file?
Yes: a DVD's VOB files are MPEG-2 program streams with extra streams for menus, subtitles and AC-3 audio. Most players open them like any .mpg.
Is MPEG-2 still patented?
Almost nowhere. MPEG-1's patents have expired, MPEG-2's last US patent expired in February 2018, and the patent pool says patents remain active only in Malaysia.
Why does my MPG look stripy?
It's interlaced, as most DVD and TV video is. Turn on deinterlacing in the player, or convert it with a deinterlacing filter such as FFmpeg's yadif.
Related formats
Other file types explained
Keep going
Related
Sources
- Library of Congress: MPEG-2 Video Encoding (H.262)
- Library of Congress: MPEG-1 Video Coding
- Library of Congress: MPEG-2 Main Profile
- Via LA: MPEG-2 patent list
- MDN: Web video codec guide (MPEG-1, MPEG-2)
- Wikipedia: MPEG program stream
Last reviewed 27 October 2026.