Extract Audio from Y4M to MP3 — Free Online Tool
Extract the audio track from a Y4M (YUV4MPEG2) file and save it as an MP3 using the LAME encoder at 128kbps by default. Since Y4M is a raw, uncompressed video format with no native audio support, this tool is designed to work with Y4M files that carry an accompanying audio stream, encoding it to the universally compatible MP3 format.
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 a raw, uncompressed video format commonly used as an intermediate format in video processing pipelines — for example, as output from tools like FFmpeg, AviSynth, or VapourSynth before final encoding. While the format itself has no native audio container specification, some Y4M files produced by certain tools do carry an audio stream. This conversion uses FFmpeg to discard the raw video stream entirely (-vn) without decoding or re-encoding it, then takes the audio stream and encodes it using the LAME MP3 encoder (libmp3lame) at 128kbps. Because Y4M carries uncompressed or minimally processed audio data, this is a transcoding operation — the audio is decoded from its source representation and compressed into MP3's lossy MPEG Audio Layer III format, resulting in significant file size reduction while retaining perceptually acceptable audio quality.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg program. In the browser-based version of this tool, FFmpeg runs locally via WebAssembly (FFmpeg.wasm) — 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 file. |
-vn
|
Disables video output entirely, telling FFmpeg to ignore the raw YUV video stream from the Y4M file. This is critical here because the Y4M video data is uncompressed and would be enormous — we only want the audio. |
-c:a libmp3lame
|
Selects the LAME MP3 encoder for the audio stream. libmp3lame is the standard open-source encoder used to produce MP3 files and is required to write valid MPEG Audio Layer III output. |
-b:a 128k
|
Sets the audio bitrate to 128 kilobits per second, which is the default constant bitrate for the MP3 output. This is a widely used standard that balances file size and perceptual audio quality for most listening scenarios. |
output.mp3
|
Defines the output filename and container. The .mp3 extension tells FFmpeg to write an MPEG Audio Layer III file, compatible with virtually all media players, mobile devices, streaming platforms, and browsers. |
Common Use Cases
- Extracting a commentary or narration track from a Y4M intermediate file produced during a lossless video editing workflow, to share or edit the audio independently.
- Pulling audio from a Y4M file generated by a VapourSynth or AviSynth script that muxed in an audio stream, when only the audio output is needed for review.
- Archiving the audio portion of a large raw Y4M capture file as a compact MP3 before deleting the multi-gigabyte video data.
- Separating audio from a Y4M file used in a piped FFmpeg encoding chain, to verify audio sync or content without processing the full uncompressed video.
- Converting a Y4M file's audio output to MP3 for playback on devices or media players that cannot handle raw Y4M containers.
- Generating an MP3 audio preview of a Y4M master file to share with collaborators for feedback without sending the full uncompressed source.
Frequently Asked Questions
Technically, the Y4M (YUV4MPEG2) specification was designed for raw video frames and does not formally define an audio container structure. However, some tools and FFmpeg pipelines do produce Y4M files with an associated audio stream muxed in. If your Y4M file was generated by such a tool, FFmpeg can detect and extract that audio. If your Y4M file has no audio stream, running this conversion will produce an empty or error output — you can verify by running 'ffmpeg -i input.y4m' and checking whether an audio stream is listed.
Yes, this is a lossy transcoding operation. The audio in the Y4M file is decoded and then re-encoded using the LAME MP3 encoder at 128kbps by default. MP3 uses perceptual compression that discards audio information the human ear is less sensitive to, so the output will not be a bit-for-bit copy of the original audio. For most speech and general listening content, 128kbps MP3 is transparent enough, but if you need lossless audio extraction, consider outputting to FLAC or WAV instead.
Replace '-b:a 128k' in the command with a higher bitrate value. For example, use '-b:a 192k' for a good quality/size balance, or '-b:a 320k' for the highest standard MP3 bitrate. The full command would look like: 'ffmpeg -i input.y4m -vn -c:a libmp3lame -b:a 320k output.mp3'. Higher bitrates produce larger files but retain more audio detail, which is more noticeable with music than with speech.
Y4M stores raw, uncompressed video frames, which means even a few seconds of video can occupy hundreds of megabytes or several gigabytes. The output MP3 contains only the audio stream, compressed with lossy MP3 encoding at 128kbps — eliminating all video data and applying significant audio compression. A one-hour audio track at 128kbps MP3 is roughly 55MB, whereas the Y4M source could be tens of gigabytes for the same duration.
Y4M files do not have a metadata container structure for tags like artist, title, or album, so there is no source metadata to carry over. The output MP3 file will contain no ID3 tags by default. If you need to embed metadata into the resulting MP3, you can add FFmpeg metadata flags to the command, such as '-metadata title="My Audio" -metadata artist="Author Name"', or use a dedicated tag editor like Mp3tag after conversion.
Yes. On Linux or macOS, you can use a shell loop: 'for f in *.y4m; do ffmpeg -i "$f" -vn -c:a libmp3lame -b:a 128k "${f%.y4m}.mp3"; done'. On Windows Command Prompt, use: 'for %f in (*.y4m) do ffmpeg -i "%f" -vn -c:a libmp3lame -b:a 128k "%~nf.mp3"'. This processes each Y4M file in the current directory and saves a corresponding MP3 with the same base filename.
Technical Notes
Y4M files store raw YUV pixel data for video frames with minimal compression, making them extremely large but ideal for lossless intermediate processing between video tools. The format's audio support is non-standard — not all Y4M files will contain an audio stream, and behavior depends on the tool that generated the file. When audio is present, FFmpeg's libmp3lame encoder handles the transcoding to MP3 (MPEG Audio Layer III). The LAME encoder at 128kbps uses a joint stereo mode by default, which is efficient for stereo content but will downmix to mono if the source is mono. MP3 has a maximum sample rate of 48kHz and supports up to 320kbps CBR. If the source audio sample rate exceeds 48kHz (possible with some professional Y4M workflows), FFmpeg will automatically resample it. The -vn flag ensures the massive raw video data is skipped entirely without being decoded, keeping processing fast regardless of video resolution or frame count. The resulting MP3 has wide compatibility with virtually all devices, browsers, and media players, making it a practical choice for sharing or archiving audio extracted from Y4M pipeline outputs.