Convert MPEG to Y4M — Free Online Tool
Convert MPEG files (MPEG-1/MPEG-2 video with MP2 or AAC audio) to Y4M (YUV4MPEG2), a fully uncompressed raw video format ideal for lossless intermediate processing. This conversion decodes the MPEG-compressed stream into raw YUV pixel data, making it perfect for frame-accurate editing pipelines and tools that require uncompressed input.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your MPEG 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
MPEG files store video using lossy MPEG-1 or MPEG-2 compression with interframe prediction (I-frames, P-frames, and B-frames). During this conversion, FFmpeg fully decodes every compressed MPEG video frame and writes the raw YUV pixel data into the Y4M container without any re-encoding or further compression. The Y4M format prefixes each frame with a small header containing resolution and frame rate metadata, making it trivially parseable by tools like x264, x265, VapourSynth, and AviSynth. Because Y4M has no audio support, the audio tracks from the MPEG file are discarded entirely — only the video stream is preserved in uncompressed form.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg binary. In the browser-based tool this runs as FFmpeg.wasm compiled to WebAssembly, executing the identical command logic as desktop FFmpeg without any server involvement. |
-i input.mpeg
|
Specifies the input MPEG file. FFmpeg will detect whether the container holds MPEG-1 or MPEG-2 video and route it to the appropriate decoder (mpeg1video or mpeg2video) along with its associated MP2, MP3, or AAC audio stream. |
-c:v rawvideo
|
Instructs FFmpeg to encode the output video stream as raw uncompressed video data. This causes every decoded MPEG frame to be written in full uncompressed YUV form into the Y4M container, with no re-compression or quality loss beyond what already exists in the MPEG source. |
output.y4m
|
Sets the output filename with the .y4m extension. FFmpeg uses this extension to select the YUV4MPEG2 muxer, which wraps each raw video frame with a small ASCII header containing resolution, frame rate, aspect ratio, and interlacing information required by downstream tools. |
Common Use Cases
- Feeding MPEG broadcast footage into a lossless video processing pipeline (e.g., VapourSynth or AviSynth) that requires uncompressed Y4M input for frame-level filtering and color grading
- Piping decoded MPEG video directly into a re-encoding tool like x264 or x265 via stdin using Y4M as the interchange format, avoiding intermediate file quality loss
- Extracting raw YUV frames from an MPEG-2 broadcast recording for frame-by-frame analysis or computer vision processing where compressed artifacts would interfere with results
- Archiving MPEG video in a fully decompressed state before performing lossless edits such as cropping, deinterlacing, or frame rate conversion in a tool chain that cannot read MPEG directly
- Preparing MPEG-1 or MPEG-2 source material for quality comparison tests, where uncompressed Y4M provides a neutral baseline free of any compression artifacts from the source codec
Frequently Asked Questions
No — the quality ceiling is permanently set by the original MPEG encoding. The MPEG-1 or MPEG-2 compression artifacts, macroblocking, and chroma subsampling already baked into the source cannot be recovered. What Y4M gives you is a lossless representation of exactly what was in the MPEG file — no further degradation is introduced by this conversion, and no subsequent processing step will add new compression artifacts on top of the MPEG ones.
MPEG-2 video is typically compressed at ratios of 20:1 to 50:1 compared to raw pixel data. Y4M stores every frame as uncompressed YUV data with no interframe prediction or DCT compression, so a 100MB MPEG file can expand to several gigabytes as Y4M. This size explosion is expected and is precisely why Y4M is used as an intermediate format rather than a storage format.
The audio is dropped entirely. Y4M is a video-only format with no provision for storing audio streams — it contains raw video frames and per-frame headers, nothing else. If you need the audio, extract it separately from the MPEG file before converting to Y4M, using a tool like FFmpeg with the '-vn' flag to isolate the MP2 or AAC audio track.
Yes — Y4M's per-frame headers include an interlacing field indicator (progressive, top-field-first, or bottom-field-first), and FFmpeg will carry over the interlacing metadata from the MPEG-2 stream. However, downstream tools vary in how well they handle interlaced Y4M, so if your workflow requires progressive video you should add a deinterlace filter (e.g., '-vf yadif') to the FFmpeg command before outputting to Y4M.
Insert a video filter flag between the input and output: 'ffmpeg -i input.mpeg -c:v rawvideo -vf yadif output.y4m'. The 'yadif' filter deinterlaces MPEG-2 interlaced fields into progressive frames before they are written as raw YUV data in the Y4M file. This is especially useful for MPEG-2 broadcast material captured from TV or DVD sources, which are almost always interlaced.
Yes, using a shell loop. On Linux or macOS: 'for f in *.mpeg; do ffmpeg -i "$f" -c:v rawvideo "${f%.mpeg}.y4m"; done'. On Windows PowerShell: 'Get-ChildItem *.mpeg | ForEach-Object { ffmpeg -i $_.FullName -c:v rawvideo ($_.BaseName + ".y4m") }'. Be mindful of disk space — each MPEG file will expand dramatically in size as uncompressed Y4M output.
Technical Notes
Y4M (YUV4MPEG2) stores video in the same YCbCr color space that MPEG-1 and MPEG-2 use internally, so no color space conversion is required during this conversion — the decoded YUV data maps directly into the Y4M frame structure. The chroma subsampling of the output (typically 4:2:0 for MPEG-2) is preserved as-is. Y4M has no support for subtitles, chapters, or multiple audio tracks, and since MPEG also lacks chapters and subtitle support at the container level, no metadata is silently lost beyond the audio stream. One important limitation: Y4M files are not streamable and cannot be seeked efficiently because there is no index — every frame must be read sequentially. This makes Y4M unsuitable as a delivery format but excellent for piped workflows. Files produced by this tool can be very large; a 1GB MPEG source can generate 20–40GB of Y4M output, so ensure sufficient disk space before running this conversion on long recordings.