Convert MPEG to AVI — Free Online Tool

Convert MPEG files (MPEG-1/MPEG-2 video with MP2 audio) to AVI using H.264 video encoding and MP3 audio — producing a compact, widely compatible file from legacy broadcast or DVD-era source material. This re-encodes both the video and audio streams, replacing outdated MPEG-1/2 compression with modern H.264 for significantly better quality-to-file-size ratio.

FFmpeg Command

Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg

Free — no uploads, no signups. Your files never leave your browser.

Estimated output:

Conversion Complete!

Download

How It Works

MPEG files typically carry MPEG-1 or MPEG-2 video alongside MP2 audio — codecs designed for broadcast TV, VCD, and DVD distribution in the 1990s and early 2000s. Because AVI does not natively support MPEG-2 video streams in a compatible way for modern playback, both streams must be fully re-encoded rather than simply remuxed. The video is transcoded from MPEG-1/2 to H.264 (libx264), which offers dramatically better compression efficiency at equivalent or superior visual quality. The MP2 audio is transcoded to MP3 (libmp3lame), which is universally supported across AVI-compatible software and hardware. The result is an AVI container with interleaved H.264 video and MP3 audio — smaller than the original MPEG in most cases, and playable on a far wider range of devices and media players.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg tool — the underlying engine that powers this browser-based conversion via its WebAssembly (FFmpeg.wasm) port. The same binary name is used when running this command on a local desktop installation.
-i input.mpeg Specifies the input file — an MPEG container that may hold MPEG-1 or MPEG-2 video and MP2, MP3, or AAC audio. FFmpeg auto-detects the specific codec and stream layout from the file headers, so no additional demuxer flags are needed for standard MPEG files.
-c:v libx264 Transcodes the MPEG-1 or MPEG-2 video stream to H.264 using the libx264 encoder — replacing the legacy macroblock-based MPEG compression with a far more efficient modern codec that produces smaller files at equivalent or better visual quality.
-c:a libmp3lame Transcodes the audio (typically MP2 in MPEG files) to MP3 using the LAME encoder — the highest-quality open-source MP3 implementation, and the audio format best supported by AVI players and editors across all platforms.
-crf 23 Sets the H.264 Constant Rate Factor to 23, which is libx264's default and represents a strong general-purpose quality setting. For MPEG-2 source material, this typically produces output that matches or exceeds the source visual quality while using less storage space.
-b:a 128k Sets the MP3 audio bitrate to 128 kilobits per second — a standard bitrate that provides transparent quality for typical MPEG audio content (voice, music, broadcast sound) and is universally supported by every AVI-compatible media player.
output.avi Defines the output file name and triggers FFmpeg to write an AVI container. The .avi extension causes FFmpeg to automatically select the AVI muxer, which interleaves the H.264 video and MP3 audio streams with the timing metadata that AVI requires for synchronized playback.

Common Use Cases

  • Opening old VCD or DVD-ripped MPEG files in legacy Windows video editors that require AVI input with H.264 video
  • Reducing the file size of large MPEG-2 broadcast recordings captured from a TV tuner card before archiving them to a NAS or external drive
  • Making MPEG video files from early 2000s camcorders compatible with older AVI-only media players on embedded or industrial systems
  • Preparing MPEG content for import into older versions of Adobe Premiere or Windows Movie Maker that handle AVI more reliably than raw MPEG streams
  • Converting MPEG recordings from legacy security DVR systems into AVI for use with forensic or review software that mandates that container
  • Archiving MPEG-1 video files from VCD collections into a more storage-efficient AVI/H.264 format while retaining the familiar AVI wrapper expected by downstream workflows

Frequently Asked Questions

Because both MPEG and AVI/H.264 are lossy formats, transcoding always involves some generation loss — the video is decoded from MPEG-1/2 compression and re-encoded into H.264. However, H.264 at the default CRF 23 setting is significantly more efficient than MPEG-2, meaning the output can actually look cleaner and sharper than the source at a smaller file size, especially for older MPEG-1 content. The most noticeable quality loss would occur if the source MPEG was already heavily compressed; re-encoding cannot recover detail that was discarded by the original encoder.
MPEG files commonly use MPEG-1 Audio Layer II (MP2) for their audio track — a format standard in broadcast television and DVD authoring but poorly supported in most AVI playback contexts. The AVI container works best with MP3 (MPEG-1 Audio Layer III), which shares historical roots with MP2 but is far more universally supported by media players, editing software, and hardware decoders. The libmp3lame encoder used here is the highest-quality open-source MP3 encoder available, so the audio transcoding at 128k produces clean, transparent results for most source material.
MPEG-1 and MPEG-2 video codecs are significantly less efficient than H.264 — H.264 can typically achieve the same perceptual quality at roughly half the bitrate of MPEG-2. If the source MPEG was encoded at a moderate-to-high bitrate (common for broadcast captures or DVD rips), the H.264 re-encode at CRF 23 will often produce a smaller file with comparable or better visual quality. MPEG-1 files from VCDs are especially likely to shrink dramatically because VCD encoding standards imposed tight bitrate limits that H.264 handles far more gracefully.
The video quality is controlled by the -crf flag, which accepts values from 0 (lossless) to 51 (worst quality). The default of 23 is a good general-purpose setting, but lowering it to 18 will produce visibly higher quality at a larger file size, while raising it to 28 will shrink the file further with some quality reduction. For audio, change the -b:a value — for example, use -b:a 192k for higher-quality audio or -b:a 96k to reduce file size. A command for higher quality would look like: ffmpeg -i input.mpeg -c:v libx264 -c:a libmp3lame -crf 18 -b:a 192k output.avi
Yes — on Linux or macOS you can use a shell loop: for f in *.mpeg; do ffmpeg -i "$f" -c:v libx264 -c:a libmp3lame -crf 23 -b:a 128k "${f%.mpeg}.avi"; done. On Windows Command Prompt, use: for %f in (*.mpeg) do ffmpeg -i "%f" -c:v libx264 -c:a libmp3lame -crf 23 -b:a 128k "%~nf.avi". The browser-based tool processes one file at a time, so the FFmpeg command approach is strongly recommended for batch jobs, particularly since the tool supports files up to 1GB while local FFmpeg has no such limit.
AVI does technically support multiple audio tracks, and unlike the MPEG input format (which is flagged as not supporting multiple audio tracks in standard configurations), the AVI output format used here does support them. However, by default the FFmpeg command maps only the first audio stream. If your MPEG source has multiple audio tracks — uncommon but possible in MPEG-2 transport streams from broadcast captures — you would need to add explicit stream mapping flags like -map 0:v:0 -map 0:a:0 -map 0:a:1 to include additional audio streams in the output.

Technical Notes

The MPEG container is one of the oldest standardized video formats, and its internal streams (MPEG-1/MPEG-2 video, MP2 audio) are not directly passthrough-compatible with AVI in a way that modern players handle reliably — making full re-encoding the correct approach here rather than a simple remux. The libx264 encoder produces Baseline, Main, or High Profile H.264 depending on content complexity; at CRF 23 it targets visually lossless quality for typical MPEG source material. One important limitation: MPEG files sourced from MPEG-2 transport streams (.ts files renamed to .mpeg) may contain multiple programs or discontinuous timestamps, which can cause audio sync issues in the AVI output — users should inspect such files with ffprobe first. MPEG files do not carry rich metadata (no chapter markers, no subtitle streams, no embedded cover art), so there is no metadata loss concern in this conversion. AVI also does not support subtitles or chapters, so this conversion is fully lossless in terms of container feature parity. The AVI output uses OpenDML extensions automatically when the output exceeds 2GB, bypassing the historical 2GB AVI file size limit.

Related Tools