Extract Audio from Y4M to WEBA — Free Online Tool
Extract audio from a Y4M (YUV4MPEG2) video file and save it as a WEBA file encoded with the Opus codec — a modern, highly efficient lossy audio format optimized for web delivery. Y4M is a lossless uncompressed intermediate format that contains no audio by default, so this tool is most useful when Y4M files have been piped or assembled with an accompanying audio stream.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your Y4M 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
Y4M (YUV4MPEG2) is an uncompressed, lossless video container primarily used as an intermediate format in video processing pipelines. Because it stores raw video frames, it rarely contains audio — but when it does (for example, when generated by a tool that muxes an audio stream into the container), this tool strips the raw video entirely using the -vn flag and re-encodes only the audio stream using the Opus codec (libopus) into a WEBA container. Opus is a lossy codec, so the original audio data is compressed and some fidelity is lost, but Opus is renowned for delivering excellent quality at low bitrates (128k default). The result is a lightweight, web-ready .weba audio file from what was previously a large, uncompressed video source.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg command-line tool, which is the engine powering this conversion. In the browser-based version of this tool, FFmpeg runs via WebAssembly (FFmpeg.wasm) entirely client-side — no data leaves your machine. |
-i input.y4m
|
Specifies the input file — in this case a Y4M (YUV4MPEG2) file containing uncompressed raw video and optionally an audio stream. FFmpeg reads the Y4M container headers to identify available streams before processing. |
-vn
|
Disables video output, ensuring no raw video stream from the Y4M source is included in the output file. This is essential here because WEBA is an audio-only container and cannot store video, and because Y4M's uncompressed video frames would be incompatible with the WebM format anyway. |
-c:a libopus
|
Encodes the audio stream using the libopus encoder, producing Opus-compressed audio. Opus is the default and preferred codec for WEBA/WebM audio, offering better compression efficiency than Vorbis at equivalent bitrates and native support in modern browsers. |
-b:a 128k
|
Sets the Opus audio encoder to a target bitrate of 128 kilobits per second. At this bitrate, Opus delivers perceptually high-quality audio — suitable for both speech and music — while producing a file dramatically smaller than the uncompressed Y4M source. |
-vn
|
A second instance of the video-disable flag, placed after the codec flags. While redundant, FFmpeg handles this gracefully without error. It reinforces that the output WEBA file must contain no video stream, which is a structural requirement of the audio-only WebM/WEBA format. |
output.weba
|
Specifies the output filename with the .weba extension, which signals to FFmpeg that the output container should be WebM audio (audio/webm). The .weba extension is the standard designation for audio-only WebM files and is recognized by browsers and media players that support the WebM format. |
Common Use Cases
- Extracting a narration or commentary track from a Y4M file produced by a lossless video editing or compositing pipeline, to publish as a standalone web audio clip.
- Pulling audio from a Y4M intermediate file generated during a video encoding workflow (e.g., from FFmpeg piping between tools) where the audio needs to be archived or shared separately.
- Converting audio embedded in a Y4M test file — commonly used in codec benchmarking and research — into a distributable WEBA format for web embedding or browser playback.
- Saving bandwidth when sharing project audio from a lossless Y4M master: the resulting .weba file at 128k Opus can be 50–100x smaller than the source while retaining perceptually transparent quality.
- Preparing audio for an HTML5 web player that supports the WebM/WEBA format natively in Chrome, Firefox, and Edge, without needing to re-upload a massive uncompressed Y4M file.
- Isolating a music or sound design track from a Y4M file used in a visual effects or animation pipeline, for review or delivery to audio post-production.
Frequently Asked Questions
Y4M is technically a video-only format in its standard specification — it stores raw YUV video frames and does not have a defined audio container structure. However, some tools and FFmpeg pipelines may mux an audio stream alongside Y4M video in practice. If your Y4M file has no audio stream, this tool will produce an empty or failed output. You can check for an audio stream by running 'ffprobe input.y4m' before converting.
Y4M stores completely uncompressed raw video frames, which makes files enormous — a few seconds of 1080p Y4M video can easily be several gigabytes. The WEBA output contains only the audio, encoded with the Opus codec at 128k bitrate, which is a lossy but highly efficient compression format. Audio-only at 128k Opus produces files that are tiny by comparison, often thousands of times smaller than the Y4M source.
Both Opus and Vorbis are open, royalty-free audio codecs that can be stored in a WEBA (WebM audio) container. Opus is the modern successor: it offers better quality at equivalent bitrates, lower latency, and broader support in current browsers and devices. Vorbis is older and has slightly wider legacy support. This tool defaults to Opus (libopus), which is the recommended choice for new projects. If you need Vorbis, you can modify the FFmpeg command by replacing '-c:a libopus' with '-c:a libvorbis'.
The '-b:a 128k' flag controls the Opus audio bitrate. You can replace '128k' with values like '64k' (lower quality, smaller file), '192k', '256k', or '320k' (higher quality, larger file). For speech content, 64k Opus is typically sufficient and transparent. For music or high-fidelity audio, 128k–192k is generally indistinguishable from the source for most listeners. Opus is efficient enough that going above 192k rarely provides perceptible improvement.
Y4M does not support embedded metadata beyond basic stream header parameters (resolution, frame rate, color space). As a result, there is no title, artist, or comment metadata to carry over into the WEBA file. The output .weba file will have an essentially empty metadata block. If you need to add metadata tags to the output, you can append FFmpeg flags such as '-metadata title="My Track"' to the command before the output filename.
The command shown on this page processes a single file, but you can adapt it for batch processing in a shell script. On Linux or macOS, use: 'for f in *.y4m; do ffmpeg -i "$f" -vn -c:a libopus -b:a 128k "${f%.y4m}.weba"; done'. On Windows PowerShell, use: 'Get-ChildItem *.y4m | ForEach-Object { ffmpeg -i $_.Name -vn -c:a libopus -b:a 128k ($_.BaseName + ".weba") }'. This is particularly useful when processing multiple Y4M intermediates from a batch rendering or encoding pipeline.
Technical Notes
Y4M files store raw planar YUV video data with no compression, making them exclusively suited as intermediate formats — they are rarely a final delivery format. Because the format has no defined audio specification, the presence of an audio stream in a Y4M file depends entirely on how the file was generated (typically via FFmpeg piping or non-standard muxing). The WEBA output uses the libopus encoder, which implements the Opus codec (RFC 6716). Opus is a transform codec combining elements of SILK (for speech) and CELT (for music/general audio) and natively supports 8kHz–48kHz sample rates. FFmpeg's libopus encoder outputs at 48kHz by default, so if your source audio is at a different sample rate, it will be resampled automatically. The -vn flag appears twice in the resolved command (once before and once after the codec flags) — FFmpeg accepts this redundancy without error, and both instances serve to ensure no video stream is written to the output. WEBA files use the .weba extension and the 'audio/webm' MIME type, and are natively playable in Chromium-based browsers and Firefox without any plugins. Safari has limited WebM support, so WEBA files may not play on Apple platforms without additional software.