Convert MPG to CAVS — Free Online Tool
Convert MPG files (MPEG-1/2 video with MP2 audio) to CAVS format using libx264 video encoding and AAC audio — replacing the aging MPEG-2/MP2 codec pair with a far more efficient modern codec stack while preserving your video content. Ideal for adapting legacy broadcast or VCD/DVD-era footage for Chinese broadcast distribution systems that require the CAVS container.
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-2 video and MP2 audio streams, both of which are incompatible with the CAVS output container's required codecs. This means the conversion is a full transcode — not a remux — for both streams. The MPEG-2 video is decoded frame-by-frame and re-encoded using libx264 (H.264), which delivers significantly better compression at the same visual quality compared to MPEG-2. The MP2 audio is simultaneously decoded and re-encoded into AAC, which is the standard audio codec for the CAVS container. The CRF 23 setting for libx264 targets a balanced quality-to-filesize ratio, and AAC at 128k handles most voice and moderate-fidelity audio comfortably. Because both streams must be fully re-encoded, this conversion is more CPU-intensive than a simple remux and processing time will scale with the length and resolution of the source MPG file.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg tool, which handles the full transcode pipeline — decoding the MPEG-2 video and MP2 audio from the MPG container, re-encoding both streams, and writing them into the CAVS output file. |
-i input.mpg
|
Specifies the source MPG file as input. FFmpeg will detect the MPEG-2 video and MP2 audio streams inside the MPG container and prepare them for decoding and re-encoding. |
-c:v libx264
|
Sets the video encoder to libx264, which re-encodes the MPEG-2 video stream from the source MPG into H.264 — a far more compression-efficient codec that the CAVS container expects. |
-c:a aac
|
Sets the audio encoder to AAC, re-encoding the MP2 audio track from the source MPG into AAC format, which is required by the CAVS container and is more efficient and widely supported than MP2. |
-crf 23
|
Sets the Constant Rate Factor for the libx264 encoder to 23, which is the default balanced quality setting. Lower values (e.g., 18) produce higher quality and larger files; higher values (e.g., 28–35) produce smaller files with more visible compression relative to the original MPEG-2 source. |
-b:a 128k
|
Sets the AAC audio bitrate to 128 kilobits per second, which is adequate for speech and moderate-quality audio content typical of VCD/DVD-era MPG files. Increase to 192k or 256k if the source MPG contains high-fidelity music or broadcast audio. |
output.cavs
|
Specifies the output filename with the .cavs extension, which tells FFmpeg to write the re-encoded H.264 video and AAC audio into the CAVS container format. |
Common Use Cases
- Preparing archived VCD or DVD MPEG-2 footage for submission to Chinese broadcast platforms or distribution pipelines that require CAVS-compatible files
- Converting legacy MPEG-2 broadcast recordings captured from satellite or cable into a more storage-efficient format using H.264 compression inside the CAVS wrapper
- Modernizing a library of MPG training or educational videos produced for DVD distribution into the CAVS format for use in Chinese institutional media systems
- Re-encoding old MPG home video archives — originally authored for VCD playback — into CAVS to reduce file size while retaining watchable quality via H.264's superior compression
- Transcoding MPEG-2 broadcast master files with MP2 audio into CAVS with AAC audio for compatibility with Chinese media players or set-top boxes that require the national standard format
- Converting MPG source footage from legacy broadcast equipment into CAVS as an intermediate step in a Chinese digital media production workflow
Frequently Asked Questions
Yes, some quality loss is inevitable because this conversion involves a full transcode of both the MPEG-2 video and MP2 audio streams — there is no lossless path between these two formats. The default CRF 23 setting for libx264 produces visually good quality for most content, but if your source MPG is already a compressed, low-bitrate file, re-encoding will compound any existing artifacts. For high-quality source MPG files, the output can look very close to the original despite the generational loss.
The CAVS container format and the AVS video codec standard are technically distinct concepts. FFmpeg's support for encoding native AVS video (libxavs) is limited and not widely available in standard builds, so libx264 (H.264) is used as the video codec inside the .cavs container — which is a practical approach for broad compatibility. If you specifically need native AVS-encoded video for strict broadcast compliance, you would need a specialized encoder beyond what FFmpeg's standard build provides.
MPG files using MPEG-2 video are considerably less efficient than H.264 at the same visual quality, so for most content the CAVS output with libx264 will be noticeably smaller than the source MPG. However, if the source MPG was encoded at a very low bitrate or very low resolution, the CRF 23 default may actually produce a file of similar size or slightly larger, since CRF is quality-based rather than bitrate-based. You can lower the CRF value (e.g., to 28 or 35) in the FFmpeg command to target a smaller output file at the cost of some quality.
The MP2 audio track in the source MPG is fully decoded and re-encoded as AAC at 128k bitrate, since CAVS requires AAC audio and cannot carry MP2 streams. MP2 is an older audio codec historically associated with broadcast and VCD/DVD applications, while AAC is more efficient and widely supported. The 128k AAC bitrate is sufficient for speech and moderate-quality music, but if your MPG contains high-fidelity audio you may want to increase the bitrate to 192k or 256k by changing the -b:a flag in the command.
Video quality in this command is controlled by the -crf flag, which accepts values from 0 (highest quality, largest file) to 51 (lowest quality, smallest file). The default is 23, which suits general-purpose use well. To reduce file size, increase CRF to 28 or 35; to improve quality at the cost of a larger file, decrease it to 18 or lower. For audio, replace 128k in -b:a 128k with 192k or 256k for better fidelity, keeping in mind this will modestly increase file size.
Yes. On Linux or macOS you can loop over files in a shell: `for f in *.mpg; do ffmpeg -i "$f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "${f%.mpg}.cavs"; done`. On Windows Command Prompt, use: `for %f in (*.mpg) do ffmpeg -i "%f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "%~nf.cavs"`. The browser-based tool processes one file at a time, so the FFmpeg command is the recommended approach for batch jobs, particularly for large collections of archival MPG footage.
Technical Notes
MPG is a legacy container rooted in the MPEG-1 and MPEG-2 standards, historically used for VCD (MPEG-1), DVD (MPEG-2), and broadcast applications. Its default codec pairing — MPEG-2 video and MP2 audio — predates modern compression technology by decades and results in relatively large file sizes for the visual quality delivered. The CAVS format (.cavs) is a Chinese national standard container, and this conversion uses libx264 for video and AAC for audio, both of which must be fully transcoded from the source streams. Neither stream can be stream-copied, since MPEG-2 and MP2 are not valid codecs within the CAVS container. Metadata preservation is minimal in this conversion: chapter markers, multiple audio tracks, and subtitle streams are not supported by CAVS and will be dropped during the transcode. The MPEG-2 source may contain interlaced video (common in broadcast MPG files); libx264 will encode this as-is by default, so if your source is interlaced and you need progressive output, you should add a deinterlace filter (e.g., -vf yadif) to the FFmpeg command before converting. File sizes will typically decrease substantially compared to the source MPG due to H.264's superior compression efficiency over MPEG-2 at comparable quality levels.