Convert MPG to WebM — Free Online Tool
Convert MPG files — including MPEG-1 and MPEG-2 encoded video — to WebM using the VP9 video codec and Opus audio, producing compact, royalty-free files optimized for HTML5 web playback. This conversion replaces aging broadcast-era compression with a modern open format natively supported by Chrome, Firefox, and Edge without plugins.
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 typically carry MPEG-1 or MPEG-2 video streams alongside MP2 audio, a combination rooted in VCD, DVD, and broadcast television standards from the 1990s. Because WebM cannot contain either of those codecs, this conversion is a full transcode — both the video and audio streams are decoded and re-encoded from scratch. The MPEG-2 video is decoded and re-encoded using the VP9 codec (libvpx-vp9), which achieves significantly better compression efficiency than MPEG-2 at comparable visual quality. The MP2 audio is decoded and re-encoded into Opus (libopus), a modern codec that outperforms MP2 at every bitrate. The special flag pair '-b:v 0' is required to activate VP9's constrained quality mode alongside '-crf', allowing the bitrate to float freely while targeting consistent perceptual quality rather than a fixed file size.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg application, the open-source multimedia processing engine that handles decoding the MPEG-1/2 video and MP2 audio from the MPG container and re-encoding them into WebM. |
-i input.mpg
|
Specifies the input MPG file. FFmpeg reads the MPEG-1 or MPEG-2 video stream and the MP2 audio stream from this container, which it will fully decode before re-encoding into the VP9 and Opus codecs. |
-c:v libvpx-vp9
|
Sets the video encoder to libvpx-vp9, Google's open-source VP9 implementation. This replaces the MPEG-2 (or MPEG-1) video codec from the source MPG with VP9, which offers substantially better compression efficiency and is natively playable in all modern web browsers. |
-c:a libopus
|
Sets the audio encoder to libopus, which re-encodes the MP2 audio from the MPG file into the Opus format. Opus is the only high-quality, widely supported audio codec in the WebM ecosystem and significantly outperforms MP2 at equivalent bitrates. |
-crf 33
|
Sets the VP9 Constant Rate Factor to 33, targeting a specific level of perceptual visual quality rather than a fixed bitrate. Lower values (toward 0) produce higher quality and larger files; higher values (toward 63) produce smaller files with more visible compression. A value of 33 is a balanced default suitable for most MPG source material destined for web delivery. |
-b:a 128k
|
Sets the Opus audio bitrate to 128 kilobits per second. Opus at 128k delivers transparent or near-transparent audio quality for most content, and is a significant improvement over typical MP2 audio found in MPG files, which often runs at 128–192k with inferior perceptual coding. |
-b:v 0
|
Sets the target video bitrate to zero, which is a required companion to '-crf' when using libvpx-vp9. Without this flag, VP9 defaults to a capped-quality mode that ignores the CRF setting; '-b:v 0' removes the bitrate cap and enables true constrained quality encoding driven entirely by the CRF value. |
output.webm
|
Specifies the output filename and tells FFmpeg to write the converted video into a WebM container. The .webm extension signals the Matroska-based container that will hold the VP9 video and Opus audio streams for royalty-free HTML5 playback. |
Common Use Cases
- Publishing archival broadcast footage or VHS-captured MPG files to a website without requiring a video hosting platform or proprietary plugin
- Embedding legacy MPEG-2 training or corporate video content into a modern HTML5 video element that plays natively in all current browsers
- Reducing the file size of large MPEG-2 DVB or satellite recordings before storing or streaming them, since VP9 delivers comparable quality at roughly half the bitrate
- Converting VCD-sourced MPEG-1 MPG files into a format compatible with web-based media players and progressive streaming workflows
- Preparing older news archive or documentary footage encoded as MPEG-2 for use in a web-based video editor that requires WebM input
- Transcoding MPG files captured from broadcast hardware into a royalty-free container for distribution on platforms that mandate open formats
Frequently Asked Questions
At the default CRF value of 33, most MPEG-2 source material will look equal to or better than the original when re-encoded to VP9, because VP9 is a significantly more efficient codec than MPEG-2. However, because both the input and output are lossy, there is always some generation loss from decoding and re-encoding. If preserving maximum fidelity is critical, lower the CRF value toward 0 to allocate more bits to the VP9 encode.
WebM only supports Opus and Vorbis as its audio codecs — the MP2 audio track found in most MPG files cannot be placed into a WebM container. The MP2 audio is fully decoded and re-encoded to Opus using libopus. Opus is a substantial upgrade over MP2: it achieves similar or better perceptual quality at half the bitrate, and is natively supported in all modern browsers, making it the ideal audio codec for web delivery.
MPEG-2, the dominant codec in MPG files, is an older standard with less efficient compression than VP9. VP9 uses more advanced prediction techniques and entropy coding that can achieve the same perceived visual quality at roughly 40–60% of the MPEG-2 bitrate. Additionally, Opus is far more efficient than MP2, so both streams contribute to a smaller overall file size even when quality is maintained or improved.
Yes — change the '-crf 33' value to control VP9 quality. The scale runs from 0 (highest quality, largest file) to 63 (lowest quality, smallest file). For archival MPG content you want to preserve faithfully, values between 18 and 24 are recommended. For web delivery where bandwidth matters more than perfect fidelity, 28 to 36 is a practical range. Always pair the '-crf' value with '-b:v 0' as shown in the command — omitting '-b:v 0' disables constrained quality mode and CRF will not behave as expected.
MPG files do not support embedded chapter markers or subtitle tracks at the container level, so there is nothing to lose on that front. However, WebM itself does support chapters, subtitles, and multiple audio tracks, so if you need to add those features to your video, WebM is a capable target format for that enriched workflow — you would just need to add those elements separately using additional FFmpeg arguments.
On Linux or macOS, you can loop over all MPG files in a directory with: for f in *.mpg; do ffmpeg -i "$f" -c:v libvpx-vp9 -c:a libopus -crf 33 -b:a 128k -b:v 0 "${f%.mpg}.webm"; done. On Windows Command Prompt, use: for %f in (*.mpg) do ffmpeg -i "%f" -c:v libvpx-vp9 -c:a libopus -crf 33 -b:a 128k -b:v 0 "%~nf.webm". Note that VP9 encoding is CPU-intensive, so batch jobs on large MPEG-2 files can take considerable time — consider adding '-speed 2' or '-speed 4' to the command to trade some compression efficiency for faster encoding.
Technical Notes
MPG is a rigid, broadcast-oriented container whose codec options are frozen at MPEG-1 and MPEG-2 for video and MP2 (or occasionally MP3/AAC) for audio — none of which are valid in a WebM container, making a full transcode unavoidable. VP9's constrained quality mode, activated by the combination of '-crf 33' and '-b:v 0', is the recommended encoding strategy for archival MPG content because it targets perceptual quality uniformly across scenes rather than capping at a fixed bitrate, which is especially beneficial for MPEG-2 sources that may have variable-bitrate encoding from broadcast hardware. One practical limitation is encoding speed: VP9 (libvpx-vp9) is considerably slower than MPEG-2 encoding, so conversion of long MPEG-2 files can be time-consuming in the browser. WebM does not support MPEG-2's interlaced video natively in the same way MPG broadcast sources can carry interlaced fields; if your MPG source is interlaced (common with DVB or VHS captures), consider adding '-vf yadif' to the FFmpeg command to deinterlace before encoding to VP9 for cleaner results. Metadata fields such as creation date or title stored in the MPG wrapper may not be carried over into the WebM output, as the two containers use incompatible metadata schemes.