MPEG to MKV Converter
Learn how to convert MPEG video files to MKV format using FFmpeg commands, with a format comparison table and interactive command builder.
FFmpeg Command Builder
Fill in the fields and get a ready-to-run FFmpeg command.
Generated Command
ffmpeg -i video.mpg -c copy video.mkv
Remuxes the MPEG container into MKV without re-encoding. All streams are copied as-is — lossless and very fast.
MPEG vs MKV — Format Comparison
| Feature | MPEG | MKV |
|---|---|---|
| Released | 1991 (MPEG consortium) | 2002 (Open source) |
| File extensions | .mpg, .mpeg, .m1v, .m2v | .mkv, .mk3d, .mka |
| Audio tracks | Limited | Unlimited |
| Subtitle tracks | Very limited | Unlimited |
| Chapter support | No | Yes |
| Codec support | MPEG-1, MPEG-2 video | All codecs (H.264, H.265, AV1...) |
| Open standard | Partially (ISO standard) | Yes (Matroska) |
| HDR / metadata | No | Yes |
Quick FFmpeg Reference
Remux (lossless, fastest)
ffmpeg -i input.mpg -c copy output.mkv
Re-encode to H.264 + AAC
ffmpeg -i input.mpg -c:v libx264 -crf 23 -c:a aac output.mkv
Re-encode to H.265 + AAC
ffmpeg -i input.mpg -c:v libx265 -crf 28 -c:a aac output.mkv
Add external subtitle file
ffmpeg -i input.mpg -i subs.srt -c copy -c:s srt output.mkv
Batch convert (Linux/macOS)
for f in *.mpg; do ffmpeg -i "$f" -c copy "${f%.mpg}.mkv"; done
Copied!
Summary
Learn how to convert MPEG video files to MKV format using FFmpeg commands, with a format comparison table and interactive command builder.
How it works
- MPEG files (.mpg, .mpeg) store video and audio streams inside a Program Stream or Transport Stream container with limited metadata support.
- MKV is a flexible container that can hold the same streams without altering codec data — a process called remuxing.
- FFmpeg reads the MPEG container, extracts the raw streams, and places them into an MKV wrapper with no quality loss.
- Use the command builder below to generate an FFmpeg command tailored to your conversion goal.
- Run the resulting command in your terminal; a remux typically completes in seconds.
Use cases
- Remux MPEG files to MKV to add subtitle tracks or multiple audio streams.
- Improve compatibility with modern media players that handle MKV better than MPEG.
- Preserve original video quality by avoiding re-encoding during the container switch.
- Add chapter markers or metadata not supported in the MPEG format.
- Reduce file size by re-encoding to H.265/HEVC inside an MKV container.
- Archive legacy video collections in a future-proof open-standard format.
- Enable hardware-accelerated playback on devices that support MKV but not MPEG.
- Batch-convert an entire MPEG library to MKV with a single FFmpeg command.
Frequently Asked Questions
Last updated: 2026-06-11 ·
Reviewed by Nham Vu