Convert AVI to MPG — Free Online Tool

Convert AVI files to MPG format using MPEG-2 video and MP2 audio encoding — the same codec combination used in DVD and broadcast video production. This tool re-encodes your AVI content into a standards-compliant MPEG-2 Program Stream entirely in your browser, with no file uploads required.

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

Unlike a simple remux, converting AVI to MPG requires full re-encoding of both the video and audio streams. AVI files commonly contain H.264 (libx264) video and MP3 audio, neither of which is native to the MPEG-2 Program Stream (.mpg) container. The video must be decoded and re-encoded using the mpeg2video encoder, which applies discrete cosine transform (DCT) compression in I-frames, P-frames, and B-frames. The audio is simultaneously transcoded to MP2 (MPEG-1 Audio Layer II), the standard audio codec for MPEG-2 streams. The output is structured as an MPEG Program Stream — a format that interleaves audio and video packets in a way specifically designed for DVD authoring tools, VCD workflows, and broadcast pipelines. Because both streams are fully re-encoded, processing time is longer than a remux, and some generation loss will occur.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg application — the open-source multimedia processing engine that handles all decoding, encoding, and stream muxing for this AVI-to-MPG conversion.
-i input.avi Specifies the input file as an AVI container. FFmpeg will detect the contained streams — typically H.264 or MJPEG video and MP3 or AAC audio — and decode them for re-encoding into the MPEG-2 Program Stream.
-c:v mpeg2video Sets the video encoder to mpeg2video, which re-encodes the AVI's video stream using the MPEG-2 standard. This is required because MPG Program Streams do not support modern codecs like H.264 or MJPEG.
-c:a mp2 Sets the audio encoder to MP2 (MPEG-1 Audio Layer II), the standard audio codec for MPEG-2 Program Streams used in DVD and broadcast video. This transcodes the AVI's audio (commonly MP3 or AAC) into the MP2 format expected by MPG-compatible devices and authoring tools.
-q:v 2 Sets the MPEG-2 video quality using the quantizer scale, where 1 is the highest quality and 31 is the lowest. A value of 2 targets near-maximum quality, allowing the encoder to use a higher bitrate to preserve detail from the source AVI rather than aggressively compressing the output.
-b:a 192k Sets the MP2 audio bitrate to 192 kilobits per second, which provides good stereo audio fidelity appropriate for DVD and broadcast use and is well above the MP2 minimum of 128k.
output.mpg Specifies the output filename with the .mpg extension, which tells FFmpeg to write an MPEG-2 Program Stream container — the format used for DVD video, VCD, and broadcast-compatible MPEG-2 files.

Common Use Cases

  • Preparing archival AVI footage from legacy camcorders for DVD authoring software that requires an MPEG-2 Program Stream input
  • Converting AVI recordings to MPG for playback on standalone DVD players that do not support AVI containers or H.264 video
  • Supplying broadcast-ready MPEG-2 video files to television stations or post-production facilities that operate on MPEG-2 ingest workflows
  • Creating VCD-compatible video files from AVI source footage for distribution on physical media to regions where VCD playback is still common
  • Converting AVI screen recordings or captured video to MPG so they can be imported into older non-linear editing software that only accepts MPEG-2 streams
  • Reducing compatibility friction when sharing video with legacy systems, kiosks, or industrial display hardware that accepts MPG but not modern AVI/H.264 files

Frequently Asked Questions

Yes — this conversion always involves quality loss because both streams must be fully re-encoded. Your AVI's video (often H.264) is decoded and re-compressed using the MPEG-2 encoder, which is less efficient than H.264 and will produce a larger file at equivalent visual quality. The audio is similarly transcoded from MP3 or AAC down to MP2. To minimize quality loss, the default video quality setting (-q:v 2) is the highest available for MPEG-2, and the default audio bitrate (192k) is well above the MP2 minimum. Avoid converting an already-compressed AVI to MPG more than once, as each generation of re-encoding compounds quality degradation.
MPEG-2 is an older compression standard that is significantly less efficient than H.264, which is the most common codec found in modern AVI files. For the same visual quality level, MPEG-2 typically requires two to three times the bitrate that H.264 needs. At the default -q:v 2 setting, the encoder targets high quality without a strict bitrate cap, which can produce MPG files that are noticeably larger than the source AVI. If file size is a concern, you can increase the -q:v value (e.g., to 5 or 8) in the FFmpeg command to trade some quality for a smaller output file.
MPEG-2 with MP2 audio in a Program Stream container is the native format for DVD authoring, so most DVD authoring tools will accept the output from this conversion. However, DVD video has strict compliance requirements — specifically 720x480 (NTSC) or 720x576 (PAL) resolution, and a video bitrate between 2 and 9.8 Mbps. If your AVI source has a non-standard resolution or the output bitrate falls outside those bounds, the authoring software may reject it. You may need to add resolution scaling and a target bitrate flag (-b:v) to the FFmpeg command to produce a fully DVD-compliant stream.
No — the MPEG Program Stream format used for MPG files supports only a single audio track in standard practice, whereas AVI can carry multiple audio streams simultaneously. If your source AVI contains multiple audio tracks (for example, a director's commentary alongside the main audio), only the first audio track will be included in the MPG output. If you need a specific audio track other than the default, you can add -map 0:a:1 (or another index) to the FFmpeg command to select the desired track before conversion.
The video quality is controlled by the -q:v flag, which uses MPEG-2's quantizer scale. Lower values mean higher quality: -q:v 1 is the maximum quality setting and -q:v 31 produces the lowest quality. The default used here is -q:v 2, which prioritizes quality over file size. To reduce file size at the cost of some quality, try -q:v 4 or -q:v 6. Unlike H.264's CRF scale, MPEG-2's -q:v directly sets the quantizer without targeting a specific visual threshold, so the relationship between the number and perceived quality is less predictable — it's best to test with a short clip first.
Yes — on Linux or macOS you can wrap the command in a shell loop: for f in *.avi; do ffmpeg -i "$f" -c:v mpeg2video -c:a mp2 -q:v 2 -b:a 192k "${f%.avi}.mpg"; done. On Windows Command Prompt, use: for %f in (*.avi) do ffmpeg -i "%f" -c:v mpeg2video -c:a mp2 -q:v 2 -b:a 192k "%~nf.mpg". This browser-based tool processes one file at a time, so the FFmpeg command is the recommended approach for batch jobs or for files larger than 1GB.

Technical Notes

The output of this conversion is an MPEG-2 Program Stream, the container variant denoted by the .mpg extension and distinct from the Transport Stream (.ts) used in broadcast transmission. The mpeg2video encoder uses fixed quantizer encoding when driven by -q:v, meaning the bitrate will float depending on scene complexity rather than being capped — high-motion or high-detail AVI sources can produce unexpectedly large MPG files at q:v 2. The MP2 audio codec is limited to a maximum bitrate of 384k and is natively mono or stereo; surround audio in the source AVI will be downmixed to stereo. Neither AVI metadata tags (title, author, comment fields) nor chapter markers are carried over to MPG, as the MPEG Program Stream format has no equivalent metadata container. Subtitle streams embedded in AVI (via formats like VobSub) cannot be included in the MPG output. If your end goal is true DVD compliance, additional parameters for resolution, interlacing, and bitrate constraints must be added to the command beyond what this tool provides by default.

Related Tools