Convert MP4 to Y4M — Free Online Tool
Convert MP4 video files to Y4M (YUV4MPEG2) uncompressed format directly in your browser. Y4M strips away all compression and container overhead, producing raw YUV pixel data ideal for lossless video processing pipelines, frame-accurate analysis, or piping into tools like VapourSynth, AviSynth, or x264/x265 encoders.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your MP4 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
During this conversion, FFmpeg decodes the compressed video stream from the MP4 container — whether encoded with H.264 (libx264), H.265 (libx265), or VP9 — and writes every frame as raw, uncompressed YUV pixel data into the Y4M container. The Y4M format is little more than a plain-text header followed by raw frame data, so no re-compression occurs on output. This means the pixel values you get are exactly what the MP4 decoder produced, with no generation loss introduced by this conversion step. Audio is dropped entirely, as Y4M has no audio track support. The resulting file will be dramatically larger than the source MP4 because none of the original codec's compression is retained.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg multimedia processing tool. In this browser-based tool, this runs as FFmpeg.wasm compiled to WebAssembly, executing entirely within your browser with no server involvement. |
-i input.mp4
|
Specifies the input file — your MP4 source. FFmpeg will read the MP4 container, detect the video codec (H.264, H.265, or VP9), and decode the compressed video stream frame by frame for output. |
-c:v rawvideo
|
Sets the video codec for the output to 'rawvideo', which means no compression is applied — decoded YUV frames from the MP4 are written directly into the Y4M file as-is. This is the only valid video codec for Y4M output and is what produces the lossless, uncompressed result. |
output.y4m
|
The output filename with the .y4m extension, which signals FFmpeg to use the YUV4MPEG2 container format. FFmpeg writes a Y4M-compliant header (encoding frame dimensions, frame rate, and pixel format) followed by the raw uncompressed frame data. |
Common Use Cases
- Feeding decoded video frames into a lossless encoding pipeline (e.g., piping Y4M output directly into x264 or x265 via stdin for fine-grained encoding control)
- Performing frame-accurate video analysis or quality metrics testing (PSNR, SSIM, VMAF) where compressed artifacts in the source would skew results
- Using the decoded raw frames as input to VapourSynth or AviSynth scripts that require an uncompressed or pipe-friendly source format
- Archiving a specific decoded state of a video for reproducible processing — ensuring every downstream tool sees identical pixel data regardless of decoder version
- Preparing video frames for import into applications like Blender's Video Sequence Editor or scientific visualization tools that accept raw YUV streams
- Debugging codec decode output by inspecting the raw YUV data to verify color space, chroma subsampling, or decoder behavior against a reference
Frequently Asked Questions
MP4 files store video using codecs like H.264 or H.265, which achieve compression ratios of 100:1 or more by discarding perceptually redundant information and storing only differences between frames. Y4M stores every frame in full, uncompressed YUV pixel data with no inter-frame compression whatsoever. A one-minute 1080p MP4 that is 100MB can easily expand to 10–20GB as a Y4M file, which is why Y4M is used as a temporary intermediate format rather than for long-term storage.
No quality is lost in the conversion step itself — Y4M stores the raw decoded output of the MP4's video codec, so the pixels written to disk are exactly what the decoder produced. However, it is important to understand that if the original MP4 was encoded with a lossy codec (H.264, H.265, or VP9), that prior lossy compression is already baked into the pixel values. Converting to Y4M does not recover information discarded during the original encoding; it simply preserves the decoded result without introducing any further degradation.
No. Y4M (YUV4MPEG2) is a video-only format with no provision for audio tracks, chapters, or metadata. All audio streams from the MP4 are silently dropped during this conversion. If you need to preserve the audio alongside a lossless video workflow, you should extract the audio separately from the MP4 as a standalone file (e.g., AAC or WAV) and handle it as a separate stream in your pipeline.
The Y4M output will use whatever color space and chroma subsampling FFmpeg's decoder produces from the MP4 source. Most H.264 and H.265 encoded MP4 files use YUV 4:2:0 (yuv420p), which is what the rawvideo codec will write into the Y4M frames. If the source uses a different pixel format (such as yuv444p or a 10-bit format), FFmpeg will preserve it. The Y4M header encodes this information so downstream tools can interpret the frame data correctly.
Yes — this is one of the primary use cases for Y4M. Replace the output filename with a pipe by using 'pipe:1' as the output and adding '-f yuv4mpegpipe', then pipe the output to another command: 'ffmpeg -i input.mp4 -c:v rawvideo -f yuv4mpegpipe pipe:1 | x264 --demuxer y4m -o output.mkv -'. This avoids writing a massive intermediate file to disk entirely, which is the standard professional workflow for Y4M.
The single-file command shown ('ffmpeg -i input.mp4 -c:v rawvideo output.y4m') processes one file at a time. For batch processing on the command line, you can wrap it in a shell loop — on Linux/macOS: 'for f in *.mp4; do ffmpeg -i "$f" -c:v rawvideo "${f%.mp4}.y4m"; done', or on Windows PowerShell: 'Get-ChildItem *.mp4 | ForEach-Object { ffmpeg -i $_.Name -c:v rawvideo ($_.BaseName + ".y4m") }'. Keep in mind that batch Y4M output can consume enormous disk space very quickly given the uncompressed nature of the format.
Technical Notes
Y4M (YUV4MPEG2) is deliberately minimal: its header specifies width, height, frame rate, interlacing, and color space, followed by raw frame data prefixed with a short per-frame marker. FFmpeg's 'rawvideo' codec is the correct codec designation for writing this format — it performs no compression and writes decoded frames verbatim. Because MP4 supports multiple video codecs (H.264, H.265, VP9), the decode step varies in computational cost, but the output is always the same structure: uncompressed YUV frames. Metadata present in the MP4 — including chapter markers, subtitle tracks, multiple audio tracks, and container-level tags — is entirely discarded, as Y4M has no mechanism to carry any of it. The format does not support transparency (alpha channels), so any alpha information, if somehow present in the source, will be lost. Y4M files are not suitable for distribution or archival due to their size; they are intended for transient use within a processing pipeline. One practical limitation of processing Y4M in the browser via FFmpeg.wasm is the 1GB file size cap on input, but the output Y4M will frequently exceed this size even for short clips — this tool is therefore best suited for short clips or lower-resolution sources when used in-browser.