Convert MPG to MP4 — Free Online Tool
Convert MPG files (MPEG-1/MPEG-2 video with MP2 audio) to MP4 using H.264 and AAC — the modern web standard. This tool re-encodes your legacy broadcast or DVD-era footage into a widely compatible format that plays on every device and browser, using FFmpeg running entirely in your browser.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your MPG file here
or click to browse
Free — no uploads, no signups. Your files never leave your browser.
Settings
Note: Browser-based encoding uses approximate quality targets. For precise CRF compression, copy the FFmpeg command above and run it on your desktop.
Estimated output:
Conversion Complete!
DownloadHow It Works
MPG files use MPEG-1 or MPEG-2 video codecs alongside MP2 audio, a combination rooted in VCD, DVD, and broadcast television standards from the 1990s and 2000s. Neither codec is natively supported by most modern browsers, streaming platforms, or mobile devices. This conversion fully re-encodes the video stream from MPEG-2 to H.264 (libx264) using CRF 23 for high-quality lossy compression, and transcodes the MP2 audio track to AAC at 128k — the dominant audio codec for MP4 containers. The -movflags +faststart flag reorganizes the MP4 metadata to the front of the file, enabling progressive streaming and immediate playback before the full file is downloaded.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg program. When run in the browser, this is executed via FFmpeg.wasm (WebAssembly), which is a full port of FFmpeg that runs locally without any server involvement. |
-i input.mpg
|
Specifies the input MPG file. FFmpeg automatically detects that this is an MPEG program stream and identifies the enclosed MPEG-2 video and MP2 audio streams for processing. |
-c:v libx264
|
Re-encodes the MPEG-2 video stream using the H.264 encoder (libx264). This is necessary because MPEG-2 is not a valid video codec in MP4 containers for modern playback compatibility. |
-c:a aac
|
Transcodes the MP2 audio track to AAC using FFmpeg's native AAC encoder. MP2 audio is not supported inside MP4 containers by most players, so this transcode is required for the output to play correctly. |
-crf 23
|
Sets the Constant Rate Factor for H.264 encoding to 23, which is the libx264 default and produces high-quality output. This is a perceptual quality target — FFmpeg dynamically assigns bitrate across scenes rather than using the fixed constant bitrate that the original MPEG-2 stream used. |
-b:a 128k
|
Sets the AAC audio output bitrate to 128 kbps. This is sufficient to represent the frequency content of a typical MP2 audio track from an MPG file, which is often itself encoded at 192k or 224k — perceptual differences at this bitrate with AAC are minimal. |
-movflags +faststart
|
Moves the MP4 moov atom (the container's metadata index) to the beginning of the file after encoding. This is essential for web streaming and web player compatibility, allowing playback to begin before the entire file is downloaded — a capability the original MPG format does not offer. |
output.mp4
|
Defines the output filename and container format. The .mp4 extension tells FFmpeg to write an MPEG-4 Part 14 container, which will hold the newly encoded H.264 video and AAC audio streams. |
Common Use Cases
- Uploading old VHS captures or DVD rips stored as MPG files to YouTube, Vimeo, or social media platforms that require H.264 MP4
- Making broadcast-recorded MPEG-2 footage from a DVR or TV capture card playable on an iPhone, Android phone, or modern Smart TV
- Archiving VCD or DVD video collections into a modern MP4 format that is smaller, more compatible, and easier to manage on current operating systems
- Preparing MPG footage from legacy security cameras or industrial video equipment for editing in modern NLEs like Premiere Pro or DaVinci Resolve that prefer H.264 MP4 input
- Converting MPG files from a DVD authoring project or disc rip to MP4 so they can be embedded and played back natively in a web page or CMS
- Processing old corporate training videos or broadcast segments stored as MPG into MP4 for distribution via streaming platforms or email without compatibility issues
Frequently Asked Questions
Yes, there is some quality loss because both stages involve lossy compression — the original MPG was already encoded with lossy MPEG-2 video and MP2 audio, and the output re-encodes those streams into H.264 and AAC. However, CRF 23 for H.264 is a high-quality setting that preserves nearly all perceptual detail from the MPEG-2 source. For most MPG files, the output will be visually indistinguishable from the original at a significantly smaller file size. If you want to minimize quality loss, lower the CRF value (e.g., -crf 18) at the cost of a larger file.
H.264 (libx264) is a much more efficient codec than MPEG-2. It achieves comparable or better visual quality at roughly half the bitrate of MPEG-2. MPG files encoded for VCD or DVD often carry high constant bitrates required by those standards, whereas H.264 with CRF encoding allocates bits dynamically based on scene complexity. The result is a smaller MP4 with quality that matches or exceeds the MPG source.
MPG containers do not natively support subtitle tracks or chapter metadata, so there is nothing from the source file to carry over. However, the MP4 format itself does support subtitles and chapters, meaning you could add those tracks afterward using a tool like MKVToolNix or FFmpeg's subtitle muxing flags if needed.
Yes. To adjust video quality, change the -crf value: lower numbers (e.g., -crf 18) produce higher quality and larger files, while higher numbers (e.g., -crf 28) reduce file size with more visible compression. For audio, replace -b:a 128k with a higher bitrate like -b:a 192k or -b:a 256k if the original MPG had high-quality MP2 audio worth preserving more faithfully. The command otherwise stays the same.
Yes. On Linux or macOS, you can run: for f in *.mpg; do ffmpeg -i "$f" -c:v libx264 -c:a aac -crf 23 -b:a 128k -movflags +faststart "${f%.mpg}.mp4"; done. On Windows Command Prompt, use: for %f in (*.mpg) do ffmpeg -i "%f" -c:v libx264 -c:a aac -crf 23 -b:a 128k -movflags +faststart "%~nf.mp4". The browser-based tool processes one file at a time, so the desktop FFmpeg command is the recommended approach for batch processing libraries of MPG files.
MPG files encoded with MPEG-2 require full re-encoding to H.264, which is computationally intensive — unlike some conversions where the video stream can be copied without re-encoding. Additionally, high-bitrate MPEG-2 files common in DVD or broadcast contexts contain dense I-frame data that libx264 must decode and re-analyze to apply its own compression. Longer or higher-resolution MPG files (e.g., 720x576 PAL or 720x480 NTSC at 6–9 Mbps) will take proportionally more time than short clips.
Technical Notes
MPG is a program stream container designed for MPEG-1 and MPEG-2 video, with audio typically encoded as MP2 (MPEG-1 Audio Layer II). These formats were engineered for constant-bitrate delivery on physical media (VCD at ~1.15 Mbps video, DVD at up to ~9.8 Mbps) and broadcast transmission, not for flexible digital distribution. The MP2 audio codec, while still technically sound, is not supported by the AAC-centric MP4 container ecosystem and must be transcoded. This conversion does not preserve the original MPEG-2 timestamps or VBI (vertical blanking interval) data that some broadcast MPG files contain. The -movflags +faststart flag is particularly valuable here because it allows the output MP4 to begin playback immediately when streamed from a web server, unlike MPG which requires buffering the entire file. H.264 also provides significantly better compression efficiency than MPEG-2 — expect file size reductions of 40–60% at comparable quality. Note that MPG does not support multiple audio tracks, subtitles, or chapter markers at the container level, so the MP4 output will contain a single video and single audio stream matching the source.