Extract Audio from Y4M to OGG — Free Online Tool
Extract audio from a Y4M (YUV4MPEG2) video file and save it as an OGG file encoded with the Vorbis codec — a fully open-source, royalty-free format ideal for web and Linux-native audio workflows. Since Y4M is an uncompressed intermediate format that typically carries no audio, this tool handles the stream extraction gracefully and encodes any present audio using Vorbis at quality level 4.
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 is a raw, uncompressed video format used almost exclusively as an intermediate container in processing pipelines — for example, as the output of tools like ffmpeg, VirtualDub, or AviSynth before a final encode. Because Y4M stores only raw YUV video frames, it rarely contains an audio stream; when it does, that audio is typically raw PCM carried alongside the video. This tool discards the video stream entirely using the -vn flag and encodes any audio stream present using the libvorbis encoder into an OGG container. Vorbis uses perceptual lossy compression at the specified quality level, so the resulting OGG file will be significantly smaller than the raw source audio while retaining excellent perceptual quality.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg command-line tool — in the browser this runs via FFmpeg.wasm, a WebAssembly port that executes the same logic as the desktop binary without uploading your file to any server. |
-i input.y4m
|
Specifies the input file in Y4M (YUV4MPEG2) format. FFmpeg reads the plain-text Y4M header to determine frame dimensions, frame rate, chroma subsampling, and any audio stream parameters before processing. |
-vn
|
Disables video output entirely, telling FFmpeg to ignore the raw YUV video frames from the Y4M file and include only audio streams in the output — which is the core behavior of this audio extraction tool. |
-c:a libvorbis
|
Encodes the audio stream using the libvorbis encoder, which produces OGG/Vorbis — a royalty-free, open-source lossy audio codec developed by Xiph.Org, the same organization behind the OGG container format itself. |
-q:a 4
|
Sets the Vorbis variable bitrate quality to level 4 on a 0–10 scale, targeting approximately 128 kbps — a balanced default that delivers good perceptual quality for both music and speech while keeping the OGG file size manageable. |
output.ogg
|
Specifies the output filename with the .ogg extension, which tells FFmpeg to wrap the encoded Vorbis audio stream in an OGG container — the standard open container for Vorbis audio. |
Common Use Cases
- Extracting a PCM audio track from a Y4M file produced by a video synthesis or generative art pipeline where audio was embedded alongside raw frames.
- Converting a raw Y4M intermediate produced by a broadcast or scientific imaging workflow into a distributable OGG/Vorbis audio file for archiving the audio commentary or narration track.
- Preparing audio from a Y4M file for use in a Linux-native game engine or application that preferentially uses OGG Vorbis as its primary audio format.
- Stripping audio from a Y4M test sequence used in codec development or video quality benchmarking, saving just the reference audio as an OGG for separate evaluation.
- Isolating narration or soundtrack audio from a Y4M file output by an open-source video editor like Kdenlive or Blender's video sequencer during a lossless intermediate export step.
- Quickly generating a lightweight OGG audio preview from a large, unwieldy Y4M file without needing to re-encode the full video or install desktop software.
Frequently Asked Questions
The Y4M (YUV4MPEG2) specification technically supports raw PCM audio alongside the video frames, but in practice the format is almost exclusively used without any audio track. Most tools that produce Y4M files — such as FFmpeg piping workflows, AviSynth, or VapourSynth — output video-only Y4M. If your Y4M file has no audio stream, FFmpeg will produce an empty or zero-byte OGG output and may report 'Output file is empty.' You should first verify your Y4M file has an audio stream before using this tool.
Vorbis is the default audio codec for the OGG container and has the broadest compatibility across media players, browsers, and platforms. Opus is technically superior — especially at low bitrates — but it is a newer codec and not universally supported in all OGG-aware applications. The FFmpeg command uses libvorbis to maximize compatibility. If you need Opus instead, you can modify the command to use -c:a libopus, though note that Opus in OGG uses the .opus extension by convention.
The -q:a 4 flag sets Vorbis's variable bitrate quality on a scale of 0 to 10, where 4 targets approximately 128 kbps — a good balance between file size and transparency for most music and speech content. Quality 0 targets around 64 kbps (noticeably lossy), while quality 10 targets around 500 kbps (nearly transparent). Since Y4M audio is typically raw PCM, encoding it at quality 4 will produce a file that is dramatically smaller than the source while sounding virtually identical to most listeners.
Change the value after -q:a to any integer from 0 to 10. For example, use -q:a 6 for higher quality (approximately 192 kbps) or -q:a 2 for a smaller file (approximately 96 kbps). For speech-only content such as narration, quality 2 or 3 is usually sufficient. For archiving music or high-fidelity audio, quality 7 or 8 is recommended. The full modified command would look like: ffmpeg -i input.y4m -vn -c:a libvorbis -q:a 6 output.ogg
Yes — on Linux or macOS you can use a shell loop: for f in *.y4m; do ffmpeg -i "$f" -vn -c:a libvorbis -q:a 4 "${f%.y4m}.ogg"; done. On Windows PowerShell, use: Get-ChildItem *.y4m | ForEach-Object { ffmpeg -i $_.FullName -vn -c:a libvorbis -q:a 4 ($_.BaseName + '.ogg') }. This is particularly useful when processing multiple Y4M files output from a video processing pipeline.
Y4M files rarely contain meaningful metadata beyond basic stream parameters like frame rate, chroma subsampling, and interlacing. Even if metadata is present, the OGG container does support Vorbis Comment tags (the standard metadata format for OGG files), and FFmpeg will attempt to copy any recognized metadata fields automatically. In practice, you will likely need to add tags manually to the output OGG file using a tool like EasyTag or beets, since the Y4M source almost certainly contains none.
Technical Notes
Y4M (YUV4MPEG2) is a minimalist format: it stores raw, uncompressed YUV video frames with a plain-text header describing resolution, frame rate, chroma subsampling (e.g., 4:2:0, 4:4:4), and interlacing. Audio support in the Y4M spec exists but is implemented by almost no tools in practice. FFmpeg can read Y4M files with embedded audio, but encountering one is rare. The OGG container, by contrast, is a feature-rich, stream-multiplexed format that supports multiple audio tracks, chapter markers, and rich Vorbis Comment metadata. The libvorbis encoder used here is the reference implementation and produces fully standards-compliant OGG/Vorbis streams. One important distinction: OGG supports both lossy codecs (Vorbis, Opus) and lossless (FLAC), but this command uses Vorbis which is lossy — if lossless preservation of the Y4M audio is required, the command should be modified to use -c:a flac. File sizes will vary widely depending on audio duration and content, but a quality-4 Vorbis encode typically achieves 8–12x compression compared to raw 16-bit PCM at 44.1 kHz stereo.