.MPG MPEG Video
.mpg

MPEG Video

Convert MPG files to MP4, WebM, or GIF directly in your browser — no upload, no server. FileDex uses FFmpeg WASM to transcode MPEG-1 and MPEG-2 video locally, keeping your files completely private.

Learn more ↓
Container structure
Header container info
Meta tracks · codec
Data encoded frames
MPEG Program StreamMPEG-1 / MPEG-2LossyISO Standard1993
By FileDex

Your files never leave your device

Common questions

How do I convert MPG files to MP4 for web playback?

Use FileDex in your browser to transcode MPG to MP4 with H.264 encoding — no upload or installation required. FFmpeg WASM handles the decode of MPEG-1/2 video and re-encodes to H.264 with AAC audio in an MP4 container.

Can I stream-copy an MPG file to MP4 without re-encoding?

No. MPEG-1 and MPEG-2 video codecs are not valid payloads in the MP4 container. The video stream must be transcoded to H.264 or H.265. Audio can sometimes be stream-copied if it is already MP3, but MPEG-1 Layer II (MP2) audio must also be re-encoded.

What is the difference between .mpg and .mpeg file extensions?

They are identical. Both extensions indicate an MPEG Program Stream file containing MPEG-1 or MPEG-2 video. The .mpg extension originated from the 8.3 filename limitation in MS-DOS and early Windows.

Why does my MPG file show interlacing artifacts (combing) on my monitor?

MPEG-2 content from DVDs and broadcast TV is typically interlaced (fields alternating at 50/60 Hz). Modern progressive displays show combing on interlaced content. Apply a deinterlace filter during conversion — FFmpeg's yadif filter handles this automatically.

What makes .MPG special

MPEG-1 Program Stream defines how audio and video elementary streams merge into a single multiplexed file, and the .mpg extension has carried this format since the standard's publication as ISO/IEC 11172 in 1993. The format was engineered for digital storage media — specifically CD-ROMs — at a time when 1x CD drives delivered just 150 KB/s of sustained throughput. Every design decision reflects that constraint.

Continue reading — full technical deep dive

Pack and packet structure

MPEG-1 Program Stream multiplexes audio and video into fixed-size packs of 2048 bytes — this pack size was chosen to match CD-ROM sector size, which is why Video CDs use MPEG-1 at exactly 1.15 Mbit/s video + 224 kbit/s audio. Each pack begins with a pack header: a 32-bit start code (0x000001BA), a 5-byte system clock reference (SCR) used for decoder timing synchronization, and a mux rate field. Inside each pack, one or more PES (Packetized Elementary Stream) packets carry the actual compressed data.

A PES packet header contains a stream ID byte that identifies the content: 0xE0 for video, 0xC0 for audio, 0xBF for private stream 2. The header also carries a presentation timestamp (PTS) and optional decoding timestamp (DTS) as 33-bit values in 90 kHz clock units.

MPEG-1 vs MPEG-2 Program Stream

The .mpg extension covers both MPEG-1 and MPEG-2 Program Streams. Key differences:

Feature MPEG-1 PS MPEG-2 PS
Standard ISO 11172 ISO 13818
Max resolution 4095x4095 (practical: 352x240) 1920x1152 (practical: 720x480/576)
Interlace support No Yes (field/frame pictures)
Pack header 8 bytes, 5-byte SCR 10 bytes, 6-byte SCR + stuffing
Common use Video CD (VCD) DVD-Video (VOB files)

DVD .VOB files are MPEG-2 Program Streams with navigation packs added. Renaming a VOB to .mpg often plays correctly in media players, though menu and chapter data is lost.

Video encoding characteristics

MPEG-1 video uses three frame types: I-frames (intra-coded, self-contained), P-frames (predicted from previous reference), and B-frames (bidirectionally predicted from past and future references). A typical GOP (Group of Pictures) structure is IBBPBBPBBPBBPBB with a length of 15 frames. At 29.97 fps, this places an I-frame every 0.5 seconds, enabling coarse random access.

The Video CD standard (White Book) locks parameters to: 352x240 at 29.97 fps (NTSC) or 352x288 at 25 fps (PAL), 1.1508 Mbit/s constant bitrate video, and 224 kbit/s MPEG-1 Layer II audio. These constraints ensure that playback never exceeds 1x CD-ROM throughput.

Audio options

MPEG-1 audio layers are part of the same standard:

  • Layer I: 384 kbit/s max, 32 subbands, low complexity. Rarely used.
  • Layer II (MP2): 384 kbit/s max, used in VCD, DVB broadcast, and professional audio.
  • Layer III (MP3): 320 kbit/s max, psychoacoustic model improvements, became the dominant music format.

MPEG-2 PS files on DVDs typically use AC-3 (Dolby Digital) at 192–448 kbit/s or LPCM for uncompressed audio, though MPEG-1 Layer II audio is also permitted.

Limitations

MPG files lack chapter markers, subtitle tracks (DVDs store subtitles as separate subpicture streams), and modern codec support. There is no mechanism for H.264, H.265, or AV1 inside a Program Stream. The format is sequential — seeking requires scanning for pack start codes or relying on file-size-based estimation. Streaming performance is poor compared to MPEG-2 Transport Stream, which adds error recovery and clock synchronization features.

Conversion considerations

MPG files from VCDs and DVDs contain MPEG-1 or MPEG-2 video that most modern devices still decode natively. Converting to MP4 with H.264 re-encoding at equivalent visual quality typically shrinks file size by 60–70%. FileDex converts MPG to MP4, MKV, or WebM directly in your browser, re-encoding the legacy MPEG streams into modern codecs for universal playback.

.MPG compared to alternatives

.MPG compared to alternative formats
Formats Criteria Winner
.MPG (MPEG-2) vs .MP4 (H.264)
Compression efficiency
H.264 achieves 50-70% smaller files than MPEG-2 at equivalent visual quality through advanced motion compensation, CABAC entropy coding, and variable block sizes.
MP4 (H.264) wins
.MPG vs .MKV
Container flexibility
MPEG Program Stream only supports MPEG-1/2 video and audio codecs. MKV accepts virtually any codec combination including subtitles, chapters, and attachments.
MKV wins
.MPG (MPEG-1) vs .MPG (MPEG-2)
Resolution and quality
MPEG-1 is limited to progressive scan at VCD resolution (352x288). MPEG-2 supports up to 1920x1152 with interlaced scanning, used for DVD (720x576) and broadcast TV.
MPG (MPEG-2) wins

Technical reference

MIME Type
video/mpeg
Magic Bytes
00 00 01 B3 MPEG sequence header code.
Developer
ISO / Moving Picture Experts Group
Year Introduced
1993
Open Standard
Yes — View specification
00000000000001B3 ....

MPEG sequence header code.

Binary Structure

MPG files use the MPEG Program Stream (PS) container, a multiplexed byte stream designed for reliable storage media. The stream begins with a Pack Header starting with the pack start code 00 00 01 BA, followed by a system clock reference (SCR), mux rate, and stuffing length. Each pack contains one or more PES (Packetized Elementary Stream) packets, identified by start code 00 00 01 followed by a stream ID byte (0xE0 for video, 0xC0 for audio). PES packets carry presentation timestamps (PTS) and optional decoding timestamps (DTS) for A/V synchronization. The video elementary stream within PES begins with a Sequence Header (start code 00 00 01 B3) declaring horizontal/vertical size, aspect ratio, frame rate, and bitrate. GOP (Group of Pictures) headers (00 00 01 B8) mark I-frame boundaries for random access. The stream ends with an MPEG Program End code 00 00 01 B9.

OffsetLengthFieldExampleDescription
0x00 4 bytes Pack start code 00 00 01 BA Identifies the start of an MPEG Program Stream pack.
0x04 6 bytes (MPEG-2) or 5 bytes (MPEG-1) SCR + mux rate variable System Clock Reference for synchronization and multiplex rate. MPEG-2 uses 6 bytes (marker bits differ from MPEG-1's 5-byte format).
variable 4 bytes PES start code 00 00 01 E0 PES packet header. Stream ID 0xE0 = first video stream, 0xC0 = first audio stream.
variable 4 bytes Sequence header 00 00 01 B3 Video sequence header declaring resolution, aspect ratio, frame rate, and bitrate. Appears at stream start and optionally before each GOP.
variable 4 bytes GOP header 00 00 01 B8 Group of Pictures header containing timecode and closed_gop flag. Marks I-frame boundaries for seeking.
end 4 bytes Program end code 00 00 01 B9 Signals the end of the MPEG Program Stream. Not always present in truncated recordings.
1993MPEG-1 standard published (ISO/IEC 11172) — defines Video CD quality at 1.5 Mbps with 352x288 resolution1995MPEG-2 standard published (ISO/IEC 13818) — supports interlaced video, higher bitrates, and DVD-quality resolution1996DVD-Video specification adopts MPEG-2 Program Stream (.vob) as the mandatory video format2003MPEG-4 Part 10 (H.264/AVC) published, beginning the gradual replacement of MPEG-1/2 in most applications2013MPEG-2 core patents begin expiring; open-source decoders (FFmpeg, libmpeg2) gain unrestricted use
Transcode MPG to MP4 with H.264 (high quality) ffmpeg
ffmpeg -i input.mpg -c:v libx264 -crf 20 -preset medium -c:a aac -b:a 128k -movflags +faststart output.mp4

-crf 20 targets visually transparent quality. MPEG-1/2 audio (MP2) is re-encoded to AAC for MP4 compatibility. -movflags +faststart repositions the moov atom for web streaming.

Deinterlace MPEG-2 interlaced video during transcode ffmpeg
ffmpeg -i input.mpg -vf yadif -c:v libx264 -crf 18 -c:a aac output.mp4

yadif (yet another deinterlacing filter) converts interlaced MPEG-2 fields to progressive frames. Necessary for DVD-sourced MPG files to prevent combing artifacts on modern progressive displays.

Extract MPEG-2 stream info and GOP structure ffprobe
ffprobe -v error -show_format -show_streams -show_entries frame=pict_type -of csv=p=0 input.mpg | head -50

Shows container format, stream codecs, resolution, and frame types (I/P/B). The pict_type output reveals GOP structure, which is useful for determining seek-point density.

Remux MPEG-2 from Program Stream to Transport Stream ffmpeg
ffmpeg -i input.mpg -c copy output.ts

-c copy performs stream copy — no re-encoding. MPEG-2 video and audio transfer directly from PS to TS container. Useful for broadcast workflows that require Transport Stream input.

MPG MP4 transcode near-lossless MPEG-1/MPEG-2 video codecs are not compatible with the MP4 container. Transcoding to H.264 in MP4 restores compatibility with HTML5 video, mobile devices, and all modern players while typically reducing file size by 50-70% at equivalent quality.
MPG WEBM transcode near-lossless VP9 in WebM is royalty-free and natively supported in all modern browsers. Produces smaller files than H.264 at equivalent quality for web embedding and streaming.
MPG GIF transcode lossy Extracts short clips from legacy MPG recordings as animated GIFs for messaging or web use where inline video playback is not available.
LOW

Attack Vectors

  • Malformed PES headers — crafted stream ID or packet length fields have triggered buffer overflows in older decoders
  • Start code injection — embedded 00 00 01 sequences in payload data can confuse stream parsers
  • Oversized Sequence Header — declaring extremely large resolution values can cause memory exhaustion during decode buffer allocation

Mitigation: FileDex decodes MPG entirely in the browser sandbox using FFmpeg WASM. No server-side processing, no file upload. The WASM runtime enforces memory limits and runs isolated from the host system.

FFmpeg tool
Decodes MPEG-1/MPEG-2 Program Streams and transcodes to all modern formats
VLC tool
Cross-platform player with built-in MPEG-1/2 demuxer and decoder
libmpeg2 library
Standalone MPEG-1/MPEG-2 video decoder library used by MPlayer and xine
HandBrake tool
GUI video transcoder with MPEG-2 input support and H.264/H.265 output presets
mpv tool
Lightweight media player with FFmpeg-based MPEG decoding and hardware acceleration