Convert MPG to AVI — Free Online Tool
Convert MPG files (MPEG-1/MPEG-2 video with MP2 audio) to AVI using H.264 video encoding and MP3 audio. This re-encodes the legacy MPEG stream into a modern H.264/libx264 codec inside an AVI container, dramatically improving compression efficiency while maintaining broad compatibility with older Windows-based software and media players.
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 carry MPEG-1 or MPEG-2 video streams alongside MP2 audio, a codec pairing common in VCD, DVD, and broadcast workflows from the 1990s and 2000s. Because AVI does not natively support MPEG-2 video or MP2 audio in most playback pipelines, this conversion performs a full transcode: the MPEG-2 video stream is decoded and re-encoded using libx264 (H.264), which typically achieves the same visual quality at roughly half the file size of MPEG-2. Simultaneously, the MP2 audio track is decoded and re-encoded as MP3 using the LAME encoder, producing a standard stereo audio stream that AVI containers handle natively. Both streams are then interleaved into the AVI container structure, which stores audio and video in synchronized alternating chunks.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg tool, which handles all decoding, encoding, and container muxing. In the browser version, this runs via FFmpeg.wasm compiled to WebAssembly, executing entirely on your local machine without any server upload. |
-i input.mpg
|
Specifies the input MPG file. FFmpeg probes this file to detect the MPEG-2 video stream and MP2 audio stream that are standard in MPG containers, then selects the appropriate decoders for each. |
-c:v libx264
|
Encodes the output video using the libx264 H.264 encoder, replacing the source MPEG-2 video codec. H.264 is chosen here because it is the most compatible modern codec for AVI containers and delivers significantly better compression than the MPEG-2 stream in the source MPG. |
-c:a libmp3lame
|
Re-encodes the MP2 audio from the MPG source into MP3 using the LAME encoder. This is necessary because MP2 audio, while standard in MPEG/broadcast contexts, has poor playback support inside AVI files in most media players, whereas MP3 inside AVI is universally recognized. |
-crf 23
|
Sets the Constant Rate Factor for the H.264 encoder at 23, which is the libx264 default and produces a good balance of visual quality and file size for most MPEG-2 source material. Lower values (e.g., 18) produce better quality at larger file sizes; higher values (e.g., 28) reduce file size with more visible compression. |
-b:a 128k
|
Sets the MP3 audio output bitrate to 128 kilobits per second. This is a step down from the 192k default used in the MPG source but is appropriate for voice, dialogue, and general audio content; increase this to 192k or 320k if the MPG contains music or high-fidelity audio that needs to be preserved. |
output.avi
|
Defines the output filename and tells FFmpeg to write the encoded H.264 video and MP3 audio into an AVI container. FFmpeg infers the AVI muxer from the .avi extension and automatically writes OpenDML extension headers if the output exceeds the legacy 1GB RIFF size limit. |
Common Use Cases
- Opening old VCD or DVD-ripped MPG files in legacy Windows video editors (such as older versions of Vegas Pro or VirtualDub) that expect AVI with H.264 or MPEG-4 video rather than raw MPEG-2 streams
- Archiving broadcast or surveillance footage originally recorded as MPG into AVI files for use with older Windows-based CCTV review software that only accepts AVI input
- Reducing the file size of large MPEG-2 MPG recordings from set-top boxes or DVD recorders before storing them on network drives, taking advantage of H.264's superior compression
- Preparing MPG video content for use in legacy Windows Media Player installations or kiosk systems that lack MPEG-2 decoder licenses but can play H.264 inside AVI
- Converting MPG training or instructional videos from older authoring systems into AVI so they can be imported into PowerPoint or older e-learning platforms that only accept AVI
- Re-packaging MPG news or film footage clips for use in older non-linear editing workflows where the production pipeline is built around AVI file interchange
Frequently Asked Questions
Yes, some generation loss is unavoidable because both the MPEG-2 video and MP2 audio in the MPG file must be fully decoded and re-encoded. The default CRF value of 23 for libx264 produces visually good results for most content, but fine detail in high-motion sequences may show slightly more compression artifacts than the original MPEG-2 source. If your source MPG is already heavily compressed (such as a VCD encode), each re-encode amplifies existing artifacts, so using a lower CRF value like 18 will better preserve fidelity at the cost of a larger output file.
H.264 (libx264) is a significantly more efficient codec than MPEG-2, the video standard used in MPG files. At the same perceived visual quality, H.264 typically requires 40–60% less data than MPEG-2 because it uses more advanced motion estimation, variable block sizes, and in-loop deblocking filters that MPEG-2 lacks. This means a 1GB MPG broadcast recording might convert to a 400–500MB AVI file while looking nearly identical on screen.
No. While MPG files natively carry MP2 (MPEG-1 Audio Layer II) audio, AVI containers have very limited support for MP2 playback in most modern and legacy players. This tool re-encodes the MP2 audio to MP3 using the LAME encoder, which is the audio format AVI handles most reliably across Windows Media Player, VLC, and older playback software. The default 128k bitrate is sufficient for speech and general audio; increase it to 192k or 320k for music-heavy content.
Yes. The -crf flag controls the H.264 quality scale, where lower numbers mean higher quality and larger file sizes. To improve quality, change -crf 23 to -crf 18 for visually near-lossless output, or go as low as -crf 0 for true lossless H.264. For a smaller file with acceptable quality, values between 25 and 30 work well for archive or preview copies. For example: ffmpeg -i input.mpg -c:v libx264 -c:a libmp3lame -crf 18 -b:a 192k output.avi
The single-file command shown on this page targets one file at a time, but you can batch process on your desktop using a shell loop. On Linux or macOS, run: for f in *.mpg; do ffmpeg -i "$f" -c:v libx264 -c:a libmp3lame -crf 23 -b:a 128k "${f%.mpg}.avi"; done. On Windows Command Prompt, use: for %f in (*.mpg) do ffmpeg -i "%f" -c:v libx264 -c:a libmp3lame -crf 23 -b:a 128k "%~nf.avi". The browser tool processes one file at a time, but files up to 1GB are supported for free.
No. Neither MPG nor AVI supports chapters or subtitle tracks in any meaningful cross-player way, so nothing is lost in that regard for chapters. However, if your MPG source was a DVD-ripped file with embedded subtitle streams, those streams are not carried into the AVI output because AVI has no standardized subtitle support. If you need to preserve subtitles, consider converting to MKV instead, which supports both H.264 video and subtitle tracks.
Technical Notes
MPG is a tightly specified container tied to the MPEG-1 and MPEG-2 standards, meaning its video codec (mpeg2video) and primary audio codec (MP2) are fixed by the standard rather than being freely selectable as in modern containers like MKV or MP4. MPEG-2 video uses a fixed 8-bit color depth with 4:2:0 chroma subsampling, and this conversion preserves those color space characteristics in the H.264 output by default. The AVI container format, introduced by Microsoft in 1992, uses the RIFF file structure with a fixed interleave pattern; it does not support variable frame rate video, streams longer than approximately 2GB without OpenDML extension headers, or modern features like HDR metadata. FFmpeg writes OpenDML-extended AVI automatically for files that would exceed the 1GB RIFF limit, ensuring compatibility with modern players. One important limitation: if your MPG source contains interlaced video (common in broadcast and DVD content), this conversion does not deinterlace by default — you may want to add -vf yadif to the command if the output appears combed on progressive displays. Metadata such as creation timestamps embedded in MPG program stream headers is not mapped to AVI output tags, so that information is lost during conversion.