Convert Y4M to WEBA — Free Online Tool

Convert Y4M (YUV4MPEG2) video files to WEBA audio by extracting and encoding the audio stream to Opus at 128k bitrate inside a WebM container. Since Y4M is a raw, uncompressed intermediate format with no audio codec overhead, this tool isolates any embedded audio and delivers it as a lightweight, web-ready WEBA file.

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

Y4M (YUV4MPEG2) is a headerless, uncompressed raw video format commonly used as an intermediate in video processing pipelines — it carries raw YUV frames and, if present, an uncompressed or lightly encoded audio stream. During this conversion, FFmpeg reads the Y4M container, discards all video frames entirely (using the -vn flag), and encodes the audio stream using the Opus codec (libopus) at 128k bitrate. The result is a .weba file — an audio-only WebM container holding Opus audio — which is dramatically smaller than the original Y4M and optimized for browser playback and web delivery. No video data is carried over; this is a pure audio extraction and transcode operation.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg command-line tool, which is running here as FFmpeg.wasm compiled to WebAssembly and executing entirely inside your browser — no data leaves your machine.
-i input.y4m Specifies the input file in Y4M (YUV4MPEG2) format. FFmpeg reads the raw uncompressed video frames and any audio stream present in this lossless intermediate container.
-c:a libopus Sets the audio codec to libopus, encoding the output audio as Opus — a modern, royalty-free lossy codec optimized for web streaming and supported natively by all major browsers in WEBA/WebM containers.
-b:a 128k Sets the audio bitrate to 128 kilobits per second. For the Opus codec, 128k delivers high perceptual quality suitable for both music and speech, striking a balance between file size and fidelity.
-vn Disables video output entirely, instructing FFmpeg to ignore all raw YUV video frames from the Y4M input. This is essential since WEBA is an audio-only container and cannot hold a video stream.
output.weba Specifies the output filename with the .weba extension, which tells FFmpeg to write an audio-only WebM container. The .weba extension is the standard designation for WebM files containing only an Opus or Vorbis audio track, intended for web delivery.

Common Use Cases

  • Extracting a voiceover or soundtrack from a Y4M file produced by a video synthesis or rendering pipeline for use on a website or web app
  • Pulling audio from a Y4M intermediate file generated by tools like ffmpeg pipe chains or VapourSynth before the final video encode, to preview or archive the audio separately
  • Converting a Y4M test clip's audio track to Opus WEBA for embedding in an HTML5 audio element without needing to serve the massive uncompressed Y4M file
  • Archiving the audio component of a raw Y4M broadcast capture in a compressed, web-compatible format to reduce storage footprint while retaining good perceptual quality
  • Delivering a music or dialogue track from a Y4M mastering session as a WEBA file to a web developer who needs a small, streamable audio asset
  • Processing Y4M files output by scientific or medical imaging pipelines that happen to contain audio annotations, converting just the audio to a shareable web format

Frequently Asked Questions

Y4M (YUV4MPEG2) is primarily a raw video format, but the specification does allow for an embedded audio stream, and some tools that generate Y4M files will include one. However, many Y4M files in the wild contain no audio track at all — they are used purely as a lossless video intermediate. If your Y4M file has no audio, running this conversion will produce an empty or very short WEBA file. You can check for audio with 'ffmpeg -i input.y4m' before converting.
Y4M stores raw, uncompressed YUV video frames, making files extremely large — a few seconds of 1080p Y4M footage can easily exceed several gigabytes. The WEBA output discards all of that video data entirely and only retains the audio, which is then encoded with the Opus codec at 128k bitrate — a highly efficient lossy compression. The size reduction is typically dramatic, often by 99% or more, since you are going from uncompressed multi-gigabyte video to a compressed audio-only file.
Yes — Opus is a lossy codec, so this conversion is not lossless. However, Opus at 128k is widely regarded as transparent or near-transparent for most audio content, meaning most listeners cannot distinguish it from the source in a blind test. If the original Y4M file contained uncompressed PCM audio, you will experience some degree of perceptual encoding loss, but the result will be perceptually high quality for speech, music, and general audio content.
Replace the '128k' value in the '-b:a 128k' flag with your desired bitrate. For example, use '-b:a 64k' for a smaller file suitable for speech, '-b:a 192k' for higher fidelity music, or '-b:a 320k' for the highest practical Opus bitrate. Opus is extremely efficient at low bitrates, so even 96k typically sounds excellent for most content. The full command would look like: ffmpeg -i input.y4m -c:a libopus -b:a 192k -vn output.weba
Yes — WEBA is a WebM audio container and supports both Opus (libopus) and Vorbis (libvorbis). To switch to Vorbis, change the command to: ffmpeg -i input.y4m -c:a libvorbis -b:a 128k -vn output.weba. However, Opus is generally recommended over Vorbis because it achieves better audio quality at the same bitrate, has lower latency, and is more broadly supported in modern browsers. Vorbis is an older codec and is largely superseded by Opus for new use cases.
FFmpeg itself processes one file per command invocation, but you can batch process using a shell loop. On Linux or macOS, run: for f in *.y4m; do ffmpeg -i "$f" -c:a libopus -b:a 128k -vn "${f%.y4m}.weba"; done. On Windows PowerShell, use: Get-ChildItem *.y4m | ForEach-Object { ffmpeg -i $_.FullName -c:a libopus -b:a 128k -vn ($_.BaseName + '.weba') }. Note that this browser-based tool processes files individually, so the FFmpeg command is particularly valuable for large-scale batch operations on your desktop.

Technical Notes

Y4M files do not use a compressed video codec — rawvideo is the 'codec', meaning each frame is stored as literal YUV color data with no inter-frame compression. This makes Y4M a pure lossless intermediate but also makes it impractical for distribution due to extreme file sizes. The format has minimal metadata support: it carries basic stream properties (resolution, frame rate, color space) in a text header but does not support embedded chapter markers, subtitle tracks, or rich metadata like ID3 tags or Vorbis comments. As a result, any title, artist, or album metadata from the original production pipeline will not be preserved in the output WEBA file, and you may need to tag the WEBA file separately after conversion. The WEBA container inherits the WebM/Matroska metadata model, so tools like ffmpeg or MKVToolNix can add tags post-conversion. One important caveat: because Y4M is rarely used as a final delivery format and is most common in piping workflows (e.g., output from x264 or VapourSynth piped through ffmpeg), many Y4M files simply will not contain an audio stream at all. Always verify audio presence before converting.

Related Tools