Convert MKV to Y4M — Free Online Tool
Convert MKV files to Y4M (YUV4MPEG2) format directly in your browser — no upload required. Y4M is a fully uncompressed, lossless intermediate format that strips away MKV's container structure and decodes the video stream to raw YUV pixel data, making it ideal for piping into video processing tools like FFmpeg filters, VapourSynth, or AviSynth.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your MKV 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 MKV's compressed video stream — whether it was encoded with H.264, H.265, VP9, or another codec — and outputs fully uncompressed YUV pixel data wrapped in the Y4M header format. Unlike a simple remux, this is a full decode operation: every frame is decompressed to raw planar YUV samples. Y4M carries no audio, so all audio tracks, subtitles, chapters, and metadata from the MKV are discarded. The result is a lossless representation of the video frames as they would appear after decoding, with each frame preceded by a small Y4M frame header. File sizes are dramatically larger than the source MKV because no compression is applied.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg command-line tool, which handles all decoding, stream processing, and output writing. In this browser tool, FFmpeg runs as a WebAssembly binary (FFmpeg.wasm) entirely within your browser tab. |
-i input.mkv
|
Specifies the input Matroska file. FFmpeg reads the MKV container, demuxes its streams (video, audio, subtitles, etc.), and selects the video stream for decoding. The MKV container's flexibility means this could contain H.264, H.265, VP9, or other compressed video that must be fully decoded before Y4M output. |
-c:v rawvideo
|
Sets the video codec for the output to rawvideo, meaning FFmpeg writes the decoded YUV pixel data directly to the Y4M file with no re-compression. This is what makes the output lossless — frames are stored exactly as decoded from the MKV's compressed stream. |
output.y4m
|
Specifies the output filename with the .y4m extension. FFmpeg infers the YUV4MPEG2 container format from this extension and writes the appropriate Y4M ASCII header followed by raw frame data. No audio, subtitle, or chapter streams from the MKV are included, as the Y4M format supports only uncompressed video. |
Common Use Cases
- Feed decoded video frames from an MKV into a VapourSynth or AviSynth processing pipeline that accepts Y4M input via stdin
- Provide lossless source frames to x264 or x265 encoders when re-encoding an MKV with precise quality control, bypassing intermediate lossy steps
- Extract a fully decoded, uncompressed frame sequence from an MKV to verify encoder output or inspect visual artifacts without codec interference
- Use as an intermediate format when applying FFmpeg filter chains to MKV content where frame-accurate, uncompressed data is required between processing stages
- Prepare MKV-sourced video for scientific or broadcast workflows that require uncompressed YUV input and cannot accept containerized or compressed streams
- Debug a problematic MKV file by decoding it to raw Y4M to confirm the video stream itself is intact and the issue is container- or codec-level
Frequently Asked Questions
No — the Y4M output is a lossless decode of the MKV's video stream. Every pixel value from the decoded frames is preserved exactly as the MKV's codec (e.g., H.264 or H.265) produced them. However, the original compression artifacts already baked into the MKV cannot be undone; Y4M simply captures the decoded output faithfully without introducing any additional degradation.
MKV files store video in a compressed format like H.264 or H.265, which can achieve 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 video that occupies ~100MB as an MKV could easily exceed 10–15GB as a Y4M file, which is why Y4M is used only as a transient intermediate format and not for storage or distribution.
No. Y4M is a video-only format with no support for audio tracks, subtitles, chapters, or any metadata. The format specification only defines a stream of raw YUV video frames with a plain-text header. All of the MKV's additional tracks and metadata are discarded during this conversion. If you need the audio separately, you would need to run a second FFmpeg command to extract it.
FFmpeg will output Y4M in the pixel format of the decoded source stream, most commonly yuv420p for H.264 or H.265 MKV content. The Y4M header encodes the colorspace and chroma subsampling so downstream tools can read it correctly. If your MKV uses a different pixel format such as yuv444p or a 10-bit format, FFmpeg will reflect that in the Y4M header, though some receiving applications may only support the standard 8-bit yuv420p.
The command as shown processes a single file. To batch convert multiple MKV files to Y4M on your desktop, you can use a shell loop — for example, in Bash: `for f in *.mkv; do ffmpeg -i "$f" -c:v rawvideo "${f%.mkv}.y4m"; done`. Be very mindful of available disk space, as each Y4M output will be orders of magnitude larger than its MKV source.
Yes — this is one of Y4M's primary design purposes. On the desktop, you can modify the command to write to stdout using `-` as the output filename: `ffmpeg -i input.mkv -c:v rawvideo -f yuv4mpegpipe -`. The receiving application, such as x265 or a custom filter script, reads the raw frame stream from stdin. This avoids writing massive uncompressed files to disk entirely, making it practical even for large MKV sources.
Technical Notes
Y4M (YUV4MPEG2) was designed specifically as a pipe-friendly interchange format, and the FFmpeg flag `-c:v rawvideo` instructs the encoder to write decoded pixel data directly without any compression stage. The output file consists of a single ASCII header line describing frame dimensions, frame rate, interlacing, and pixel format, followed by individual frame headers and raw planar YUV data for each frame. Because MKV can carry H.264, H.265, VP9, PNG, or MJPEG video streams, the decode complexity varies — H.265 in particular may be slow to decode in a browser-based WebAssembly environment for large files. The Y4M format has no concept of variable frame rate; if the source MKV has a VFR timeline, FFmpeg will handle frame timing as best it can but the Y4M stream is inherently CFR. Transparency is not supported in Y4M (it has no alpha channel plane), so any alpha data in the MKV source (e.g., from a PNG-encoded stream) is discarded. The 1GB browser processing limit is a meaningful constraint here given Y4M's extreme file sizes; for longer or higher-resolution MKV sources, using the displayed FFmpeg command locally and piping to stdout is strongly recommended.