Convert WebM to Y4M — Free Online Tool

Convert WebM video files to Y4M (YUV4MPEG2) uncompressed raw video frames, decoding the VP9-encoded stream into a lossless intermediate format suitable for frame-accurate processing and piping into video tools like x264, VapourSynth, or AviSynth. Y4M strips all audio, subtitles, and metadata — what remains is pure, uncompressed pixel data.

FFmpeg Command

Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg

Free — no uploads, no signups. Your files never leave your browser.

Estimated output:

Conversion Complete!

Download

How It Works

WebM files typically carry video encoded with the VP9 codec, a highly efficient lossy compression scheme that stores video as a series of predicted frames and residuals. During this conversion, FFmpeg fully decodes every VP9 frame from the WebM container, decompressing all the motion prediction, entropy coding, and transform data back into raw YUV pixel values. Those uncompressed frames are then written into the Y4M (YUV4MPEG2) container, which is little more than a plain-text header describing frame dimensions, frame rate, and color space, followed by the raw pixel data for each frame in sequence. Because Y4M stores no compressed video data whatsoever, the output file will be dramatically larger than the input — potentially hundreds of times larger depending on resolution and length. Audio tracks, Opus or Vorbis audio present in the WebM file, are discarded entirely since Y4M has no audio container support.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg binary. In the browser-based version of this tool, this runs via FFmpeg.wasm compiled to WebAssembly, executing entirely client-side with no server involvement.
-i input.webm Specifies the input WebM file. FFmpeg will parse the Matroska-derived WebM container to locate the VP9 video stream and any Opus or Vorbis audio streams present in the file.
-c:v rawvideo Sets the video codec to rawvideo, instructing FFmpeg to fully decode the VP9 stream and write uncompressed YUV pixel data into the Y4M output rather than re-encoding with any compression codec.
output.y4m The output filename with the .y4m extension. FFmpeg infers the YUV4MPEG2 muxer from this extension, causing it to write a Y4M-format header followed by sequential raw video frames. No audio is written since the Y4M format supports only raw video data.

Common Use Cases

  • Feeding decoded WebM footage into a VapourSynth or AviSynth filtering pipeline that requires raw Y4M input via stdin for lossless frame processing
  • Piping VP9-decoded frames from a WebM source into a high-quality x264 or x265 encode session using shell piping, avoiding intermediate file re-encoding artifacts
  • Performing frame-by-frame visual quality analysis or PSNR/SSIM comparison on WebM-encoded content by extracting fully decoded frames as uncompressed Y4M data
  • Using the Y4M output as lossless ground-truth reference material when benchmarking different WebM/VP9 encoding settings against the original decoded content
  • Importing WebM video into older video processing tools or research codebases that accept Y4M as their standard raw video input format but cannot read WebM or VP9 natively
  • Archiving a fully decoded, codec-independent snapshot of a WebM clip for long-term preservation in a format that requires no proprietary decoder to interpret

Frequently Asked Questions

WebM's VP9 codec achieves very high compression ratios — a typical 1080p WebM file might compress video at 50:1 or more. Y4M stores every pixel of every frame as raw, uncompressed YUV values with no inter-frame prediction or entropy coding. A one-minute 1080p WebM file that is 50MB could easily expand to 10GB or more as Y4M, because you are looking at approximately 1920×1080×1.5 bytes × 1800 frames worth of raw data.
No. The conversion is lossless in the sense that FFmpeg fully decodes the VP9 stream and writes the exact reconstructed pixel values into Y4M. However, those reconstructed pixels already reflect any quality loss introduced when the WebM was originally encoded with VP9. Y4M faithfully preserves whatever the VP9 decoder produces — it does not recover detail that VP9's lossy compression discarded during the original encode.
Audio is silently dropped. Y4M is a video-only format with no mechanism for storing audio streams, so FFmpeg does not attempt to transcode the Opus or Vorbis audio from the WebM. If you need the audio separately, you should run a second FFmpeg command to extract it before converting to Y4M, for example using '-vn -c:a copy' to extract the Opus stream to an .ogg or .opus file.
By default, FFmpeg will output a pixel format that matches what the VP9 decoder produces, typically yuv420p for standard dynamic range WebM content. Y4M encodes the color space in its plain-text header. If the WebM source uses HDR with a wide color gamut, the decoded output may be yuv420p10le or similar, and the Y4M header will reflect this. You can force a specific pixel format by adding '-pix_fmt yuv420p' to the FFmpeg command if downstream tools require it.
Yes, and this is one of the primary use cases for Y4M. On the command line you can replace the output filename with a pipe: 'ffmpeg -i input.webm -c:v rawvideo -f yuv4mpegpipe - | x264 --demuxer y4m -o output.mp4 -'. The '-f yuv4mpegpipe' flag tells FFmpeg to use the Y4M muxer for stdout. This avoids writing a massive intermediate file to disk entirely, which is especially useful when working with high-resolution WebM sources.
You can batch-process files with a shell loop. On Linux or macOS: 'for f in *.webm; do ffmpeg -i "$f" -c:v rawvideo "${f%.webm}.y4m"; done'. On Windows PowerShell: 'Get-ChildItem *.webm | ForEach-Object { ffmpeg -i $_.FullName -c:v rawvideo ($_.BaseName + ".y4m") }'. Be aware that Y4M files are enormous, so ensure you have sufficient disk space before batch processing — even a few short WebM clips can consume tens of gigabytes as uncompressed Y4M.

Technical Notes

Y4M (YUV4MPEG2) was designed as a simple interchange format for the mjpegtools suite and has since become a standard pipe format between video processing applications. It consists of a single ASCII header line followed by per-frame headers and raw planar YUV data — there is no index, no seeking structure, and no compression. Because VP9 in WebM supports 8-bit and 10-bit color depth, HDR content with BT.2020 color primaries, and even alpha channel transparency (via a separate VP9 alpha stream), it is worth noting that Y4M does not support transparency — the alpha plane will be discarded. For HDR WebM sources, FFmpeg will decode to a high-bit-depth YUV format and the Y4M header will indicate the color space (e.g., C420p10), but tone mapping does not occur automatically; you must add explicit tone-mapping filters if your downstream tool expects SDR input. Subtitle tracks and chapter markers present in the WebM are also discarded, as Y4M has no container-level metadata support beyond the basic frame geometry header. File size should be estimated as: width × height × bytes-per-pixel × frame-count, where bytes-per-pixel is approximately 1.5 for 4:2:0 8-bit content.

Related Tools