Convert AVI to Y4M — Free Online Tool
Convert AVI files to Y4M (YUV4MPEG2) uncompressed video in your browser — no upload required. This conversion decodes the AVI's compressed video stream (typically H.264 or MJPEG) into raw YUV pixel data, producing a lossless intermediate file ideal for frame-accurate processing pipelines.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your AVI 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
AVI files store video in compressed form using codecs like H.264 (libx264), MJPEG, or PNG — all of which require decoding before the pixel data can be worked with directly. During this conversion, FFmpeg fully decodes every frame of the AVI's video stream and writes the raw YUV4MPEG2 data to a .y4m file. This is a full decode operation, not a remux — every frame is decompressed to its raw YUV color plane representation. Audio is dropped entirely, since Y4M is a video-only format with no audio container support. The result is an uncompressed frame sequence that preserves the full visual fidelity of the source without any re-encoding artifacts.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg command-line tool. In the browser version of this tool, FFmpeg runs locally via WebAssembly (FFmpeg.wasm) — your AVI file never leaves your device. |
-i input.avi
|
Specifies the input AVI file. FFmpeg will detect the container format and identify the compressed video streams (H.264, MJPEG, or PNG) and any audio streams stored inside the AVI wrapper. |
-c:v rawvideo
|
Sets the video codec for the output to rawvideo, which writes uncompressed pixel data directly. This is the correct and only meaningful codec choice for a Y4M output file, since Y4M exists specifically to carry raw, uncompressed frame data. |
output.y4m
|
The output filename with the .y4m extension, which causes FFmpeg to use the YUV4MPEG2 muxer. The resulting file will contain a plain-text header describing the video properties followed by raw YUV frame data — readable by any tool that supports the Y4M format. |
Common Use Cases
- Feeding decoded AVI footage into a lossless video processing tool like VapourSynth or AviSynth that expects raw Y4M input via a pipe
- Preparing AVI source material for frame-by-frame analysis or computer vision processing where compressed artifacts from H.264 or MJPEG would corrupt results
- Using a legacy AVI recording as the lossless input stage of a two-pass encoding pipeline, where Y4M acts as the clean intermediate before re-encoding to a modern codec
- Extracting the raw pixel data from an MJPEG-encoded AVI captured by a camera or screen recorder for use in scientific or forensic image analysis
- Passing AVI-sourced video content into FFmpeg's pipe interface for real-time processing by another application without intermediate compressed files
- Archiving the decoded visual content of an AVI before the original codec becomes unsupported, since Y4M raw data requires no codec to read
Frequently Asked Questions
Yes, with an important caveat: the Y4M output is a lossless representation of what the AVI's codec decodes to, not a lossless copy of the original capture. If the AVI used a lossy codec like H.264 or MJPEG, those compression artifacts are already baked into the pixel data. The Y4M file will be a perfect, uncompressed copy of those decoded frames — no additional quality is lost during the AVI-to-Y4M conversion itself.
AVI files store video in a compressed format — H.264, for example, achieves compression ratios of 100:1 or more. Y4M stores every frame as raw, uncompressed YUV pixel data with no compression whatsoever. A one-minute 1080p AVI that is 100MB could expand to 10GB or more as a Y4M file. This is expected behavior and is the reason Y4M is used as a temporary intermediate format rather than a storage format.
No. Y4M (YUV4MPEG2) is a video-only format — it has no mechanism to store audio streams. The audio tracks from the AVI, whether MP3 or AAC, are discarded entirely during this conversion. If you need to preserve the audio, you should separately extract it from the AVI as a standalone audio file before or after this conversion.
FFmpeg will output the Y4M file in the same YUV color space that the decoded AVI frames produce, most commonly YUV 4:2:0 for H.264-encoded AVIs or YUV 4:2:2 for MJPEG-encoded AVIs. Y4M headers encode the color space metadata explicitly, so downstream tools reading the file will know exactly how to interpret the chroma data. If your target application requires a specific chroma subsampling, you can add a -pix_fmt flag to the FFmpeg command to force conversion.
The displayed command processes a single file, but you can adapt it for batch processing in a shell. On Linux or macOS, use: for f in *.avi; do ffmpeg -i "$f" -c:v rawvideo "${f%.avi}.y4m"; done. On Windows Command Prompt, use: for %f in (*.avi) do ffmpeg -i "%f" -c:v rawvideo "%~nf.y4m". Be aware that batch converting to Y4M can consume enormous amounts of disk space given the uncompressed output size.
Yes — Y4M's primary design purpose is piping between applications. You can replace the output filename with a pipe destination: ffmpeg -i input.avi -c:v rawvideo -f yuv4mpegpipe - | your_tool. The -f yuv4mpegpipe flag explicitly sets the muxer for pipe output. This is common in workflows where tools like x264, VapourSynth, or custom image processors read Y4M from stdin to avoid writing large intermediate files to disk.
Technical Notes
Y4M (YUV4MPEG2) is intentionally minimal by design — its header stores frame rate, resolution, color space, and interlacing metadata, and each frame is prefixed with a small frame header. This simplicity makes it a reliable interchange format, but it means no chapters, no subtitles, no metadata tags, and no audio — all of which AVI can nominally carry. The -c:v rawvideo flag in the command tells FFmpeg to write uncompressed pixel data rather than apply any video codec. AVI files with multiple audio tracks will have all audio tracks silently dropped. If the source AVI contains interlaced video (common in older broadcast or DV captures), the interlacing information will be preserved in the Y4M frame headers rather than being deinterlaced, which is correct for processing pipelines that handle interlacing themselves. Files approaching or exceeding 1GB in AVI form will typically produce Y4M outputs far beyond 1GB — the browser-based tool supports AVI inputs up to 1GB, but the FFmpeg command shown can be run locally without size limits for larger source files.