MPEG to WebM Converter

Build an FFmpeg command to convert any MPEG/MPG file to WebM with VP8, VP9, or AV1, then copy and run it locally.

Choose a WebM Codec

All three codecs produce WebM output. Pick based on your speed and compression needs.

1

Install FFmpeg

  • Windows: Download from ffmpeg.org/download.html, extract, and add the bin/ folder to your PATH.
  • macOS: Run brew install ffmpeg in Terminal.
  • Linux: Run sudo apt install ffmpeg (Debian/Ubuntu) or sudo dnf install ffmpeg (Fedora).
2

Run the VP9 conversion command

Open a terminal in the folder containing your MPEG file and run one of these commands:

Good quality (CRF 31, recommended)
ffmpeg -i input.mpeg -c:v libvpx-vp9 -crf 31 -b:v 0 -c:a libopus output.webm
High quality (CRF 20)
ffmpeg -i input.mpeg -c:v libvpx-vp9 -crf 20 -b:v 0 -c:a libopus output.webm
Batch convert all .mpg files
for f in *.mpg; do ffmpeg -i "$f" -c:v libvpx-vp9 -crf 31 -b:v 0 -c:a libopus "${f%.mpg}.webm"; done macOS / Linux / Git Bash on Windows
3

Verify the output

Open output.webm in Chrome, Firefox, or VLC. VP9/WebM plays natively in all modern browsers without a plugin.

VP9 CRF Reference (0 = lossless, 63 = worst)

15
Near-lossless
Very large
20
High quality
Large
31
Default
Balanced
40
Smaller file
Visible loss

VP9 constrained quality mode requires -b:v 0 alongside -crf.

FFmpeg Command Builder

Fill in the fields to generate a ready-to-run FFmpeg command for MPEG to WebM conversion.

ffmpeg -i video.mpeg -c:v libvpx-vp9 -crf 31 -b:v 0 -c:a libopus video.webm

WebM Codec Comparison

Property VP8 VP9 AV1
FFmpeg encoder libvpx libvpx-vp9 libsvtav1 / libaom-av1
Compression vs H.264 Similar ~30–50% smaller ~50–60% smaller
Encode speed Fast Moderate (2–4× slower than VP8) Slow (libaom) / Fast (SVT)
Browser support Chrome 6+, Firefox 4+, Edge Chrome 29+, Firefox 28+, Edge 18+, Safari 14.1+ Chrome 70+, Firefox 67+, Safari 17+
Recommended audio Vorbis Opus Opus
Best use case Legacy browser support Modern web video delivery Archival, streaming with SVT-AV1
Copied!

Summary

Build an FFmpeg command to convert any MPEG/MPG file to WebM with VP8, VP9, or AV1, then copy and run it locally.

How it works

  1. Choose a WebM video codec: VP8 (fast, widely supported), VP9 (better compression), or AV1 (smallest files, slow encode).
  2. Set the quality level using the CRF slider — lower CRF means higher quality and larger file size.
  3. Optionally enter your input and output filenames to get a personalized command.
  4. Copy the generated FFmpeg command and run it in a terminal on your machine.
  5. FFmpeg reads the MPEG/MPG source, re-encodes it to the chosen WebM codec, and writes the output .webm file.

Use cases

  • Convert old MPEG/MPG recordings to WebM for HTML5 video playback in browsers.
  • Prepare video files for web delivery with VP9 to cut file size versus H.264.
  • Encode to AV1/WebM for modern streaming platforms that support it.
  • Batch-convert a folder of .mpg files to .webm with a single FFmpeg loop.
  • Reduce bandwidth costs by re-encoding MPEG-1/MPEG-2 archives to VP9.
  • Create WebM clips for embedding in web apps without licensing concerns.

Frequently Asked Questions

Last updated: 2026-06-11 · Reviewed by Nham Vu