Convert MPEG to MKV — Free Online Tool
Convert MPEG files to MKV by re-encoding legacy MPEG-1/MPEG-2 video into modern H.264 and transcoding MP2 audio to AAC — producing a compact, widely compatible Matroska file that plays on virtually any modern device or media player.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your MPEG 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
MPEG files typically contain MPEG-1 or MPEG-2 video streams paired with MP2 audio, a combination rooted in broadcast and DVD-era standards. Because MKV with H.264 video uses an entirely different codec than MPEG-2, the video must be fully re-encoded from MPEG-2 to H.264 using the libx264 encoder — this is not a simple remux. Similarly, the MP2 audio is transcoded to AAC. The re-encoding process applies CRF-based quality control (CRF 23 by default) to the video, which typically yields a significantly smaller file than the source MPEG while maintaining comparable or better visual quality, since H.264 is far more efficient than MPEG-2 at the same bitrate. The resulting MKV container gains support for subtitles, chapters, and multiple audio tracks — features MPEG does not support.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg program, the open-source multimedia processing engine that powers this conversion both in the browser (via FFmpeg.wasm) and on the desktop command line. |
-i input.mpeg
|
Specifies the input file — an MPEG container holding MPEG-1 or MPEG-2 video and typically MP2 audio, the legacy format being converted. |
-c:v libx264
|
Re-encodes the MPEG-2 (or MPEG-1) video stream using the H.264 encoder (libx264), replacing the legacy codec with a modern standard that is dramatically more compression-efficient and universally supported. |
-c:a aac
|
Transcodes the MP2 audio stream from the MPEG source to AAC, the standard audio codec for MKV output — more efficient than MP2 and compatible with virtually all modern playback devices. |
-crf 23
|
Sets the Constant Rate Factor for H.264 encoding at 23, the default quality level. This controls the visual quality-to-file-size tradeoff for the re-encoded MPEG-2 video; lower values mean higher quality and larger files. |
-b:a 128k
|
Sets the AAC audio bitrate to 128 kilobits per second, which provides good audio fidelity for most speech and music content transcoded from the original MPEG's MP2 audio track. |
output.mkv
|
Defines the output file as a Matroska (MKV) container, which wraps the newly encoded H.264 video and AAC audio while enabling support for subtitles, chapters, and multiple audio tracks that the original MPEG format could not carry. |
Common Use Cases
- Modernizing archived MPEG broadcast recordings or VHS captures so they play correctly on current media players like VLC, Plex, or Kodi without compatibility errors
- Shrinking large MPEG-2 video files from DVD rips or set-top box recordings by re-encoding to H.264, which can reduce file size by 50–70% at equivalent visual quality
- Preparing legacy MPEG footage for video editing software that handles H.264 in MKV more efficiently than MPEG-2 streams
- Converting MPEG files recorded by older camcorders or capture cards into a format compatible with modern smart TVs and streaming devices
- Preserving old MPEG training videos or corporate recordings in a future-proof container with metadata support before archiving to long-term storage
- Consolidating a library of mixed MPEG-1 and MPEG-2 files into a single consistent MKV/H.264 format for a home media server
Frequently Asked Questions
Because this conversion re-encodes the video from MPEG-2 to H.264, it is a lossy process and some generation loss is technically introduced. However, H.264 at CRF 23 is so much more efficient than MPEG-2 that in practice the output often looks visually indistinguishable from or even cleaner than the source, especially for older MPEG files that had high compression artifacts to begin with. If you want to minimize quality loss, lower the CRF value (e.g., -crf 18) in the FFmpeg command to increase bitrate and quality.
MPEG-2 video is far less compression-efficient than H.264 — H.264 can typically achieve the same perceptual quality at roughly half the bitrate or less. Additionally, MP2 audio is replaced with AAC, which is also more efficient. The result is that converting a large MPEG broadcast recording or DVD rip to MKV with H.264 and AAC can reduce file size by 50–75% without a noticeable drop in quality at the default CRF 23 setting.
MPEG files do not natively support embedded subtitles, chapters, or multiple audio tracks, so there is nothing of that kind to lose during conversion. The MKV container does support all of these features, meaning the output file is ready to have subtitles or chapter markers added using tools like MKVToolNix if needed. No subtitle or chapter data is generated automatically by this conversion.
The -crf flag controls H.264 video quality: lower values produce higher quality and larger files, while higher values produce smaller files with more compression. The default is -crf 23, which is a good balance for general use. For archival-quality output try -crf 18; for smaller files where quality is less critical, -crf 28 is reasonable. To change audio bitrate, replace -b:a 128k with a higher value like -b:a 192k for better audio fidelity.
Yes. On Linux or macOS you can run a shell loop: `for f in *.mpeg; do ffmpeg -i "$f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "${f%.mpeg}.mkv"; done`. On Windows Command Prompt use: `for %f in (*.mpeg) do ffmpeg -i "%f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "%~nf.mkv"`. The browser-based tool processes one file at a time, so the FFmpeg command is especially useful for bulk conversions of large MPEG libraries on your desktop.
H.264 (libx264) was chosen as the default because it offers the best balance of compression efficiency, encoding speed, and universal device compatibility. While H.265 (libx265) would produce even smaller files, it is slower to encode and has less consistent hardware playback support across older TVs, phones, and set-top boxes. If your target device supports HEVC, you can substitute -c:v libx265 in the command — just be aware encoding will take longer, and you may also want to add -tag:v hvc1 for Apple device compatibility.
Technical Notes
MPEG files using MPEG-2 video were the backbone of DVD video and digital broadcast (DVB, ATSC), typically encoded at fixed bitrates between 4–15 Mbps. When re-encoding to H.264 with CRF-based encoding, the encoder allocates bits dynamically per scene rather than maintaining a constant bitrate, which is why the output file size varies and tends to be much smaller. The MP2 audio codec common in MPEG files is replaced with AAC at 128k; this is generally transparent for most content, though audiophiles working with high-bitrate MP2 tracks may prefer to raise the AAC bitrate to 192k or 256k. One important limitation: MPEG files sometimes have non-standard or slightly malformed headers from legacy capture hardware — FFmpeg handles most of these gracefully, but severely corrupted MPEG files may produce sync errors or incomplete output. The MKV container preserves any title metadata embedded in the MPEG file, but MPEG's metadata support is minimal compared to modern containers, so expect sparse metadata in the output unless you add it manually.