Convert Y4M to ALAC — Free Online Tool
Convert Y4M (YUV4MPEG2) video files to ALAC audio, extracting and losslessly compressing the raw audio stream into an Apple-compatible M4A container. This tool runs entirely in your browser using FFmpeg.wasm — no upload required.
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 commonly used as an intermediate in video processing pipelines — it contains no compressed video or audio data of its own, just raw YUV frames and, if present, a PCM audio stream. This conversion discards the video frames entirely and encodes any audio present in the Y4M file using Apple Lossless Audio Codec (ALAC), storing the result in an MPEG-4 (.m4a) container. ALAC compression is mathematically lossless — every audio sample is perfectly preserved, but the file size is significantly reduced compared to raw PCM. The output is fully compatible with iTunes, Apple Music, iOS, and macOS.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg binary — the open-source multimedia processing engine running here as FFmpeg.wasm inside your browser via WebAssembly. |
-i input.y4m
|
Specifies the input file as a Y4M (YUV4MPEG2) uncompressed video file. FFmpeg reads the raw YUV video frames and any accompanying raw PCM audio stream from this file. |
-c:a alac
|
Sets the audio codec to ALAC (Apple Lossless Audio Codec), encoding the raw PCM audio from the Y4M source into losslessly compressed Apple Lossless format for storage in the M4A container. This flag appears twice in the generated command — the second instance is redundant but harmless, as FFmpeg uses the last-specified value. |
-c:a alac
|
A duplicate of the preceding audio codec flag. FFmpeg processes this as a repeated instruction to use ALAC encoding and applies it without error, producing the same result as if it appeared only once. You can omit this duplicate if running the command locally. |
output.m4a
|
Defines the output file as an M4A file — an MPEG-4 audio container. FFmpeg infers from the .m4a extension that the output should be wrapped in an MPEG-4 Part 14 container, which is the standard packaging for ALAC audio and is natively recognized by all Apple devices and software. |
Common Use Cases
- Extracting the audio track from a Y4M intermediate file produced by a video processing pipeline (e.g., from x264/x265 encoding workflows that pipe through Y4M) and archiving it in a lossless, space-efficient format.
- Preparing a lossless audio file for use in Apple's ecosystem (iTunes, Logic Pro, Final Cut Pro) from a Y4M source generated by tools like FFmpeg, VirtualDub, or AviSynth.
- Converting raw audio captured alongside Y4M video during scientific or broadcast production into a distributable ALAC file without any quality degradation.
- Archiving the audio component of uncompressed Y4M test sequences (commonly used in codec benchmarking) into a compact lossless format for long-term storage.
- Producing an ALAC file for import into GarageBand or Logic Pro from a Y4M video file used in an audio-visual production workflow.
- Separating and losslessly encoding the audio from a Y4M file generated by screen-capture or animation-rendering tools for use in a podcast or voiceover project.
Frequently Asked Questions
Y4M files sometimes contain a raw PCM audio stream alongside their uncompressed video frames, but many Y4M files are video-only with no audio track. If your Y4M file has no audio, FFmpeg will produce an empty or invalid ALAC output file, since there is nothing to encode. You can verify whether your Y4M file has audio by running 'ffmpeg -i input.y4m' and checking the stream listing for an audio stream before attempting the conversion.
No — ALAC is a lossless codec, meaning every audio sample from the original raw PCM stream in the Y4M file is perfectly reconstructed in the output. Unlike MP3 or AAC, ALAC does not discard any audio information. The only transformation is compression, which reduces file size while preserving bit-for-bit accuracy. This makes ALAC an ideal archival format for audio extracted from uncompressed Y4M sources.
This is a redundancy in the resolved command — '-c:a alac' appears twice, but FFmpeg simply applies the last valid instance, so the output is still correctly encoded as ALAC. In practice, a single '-c:a alac' flag is sufficient. If you're running this command locally and want to clean it up, you can safely remove the duplicate flag without any effect on the output.
The displayed command processes a single file, but you can batch convert using a shell loop. On Linux or macOS, run: 'for f in *.y4m; do ffmpeg -i "$f" -c:a alac "${f%.y4m}.m4a"; done'. On Windows PowerShell, use: 'Get-ChildItem *.y4m | ForEach-Object { ffmpeg -i $_.Name -c:a alac ($_.BaseName + ".m4a") }'. Batch processing is especially useful for large Y4M files over 1GB, which exceed the browser tool's limit.
Yes — ALAC stored in an M4A container is natively supported across Apple's entire ecosystem, including Apple Music, iTunes, iPhone, iPad, macOS, and Apple TV. The format is also supported by many non-Apple players such as VLC, foobar2000, and Android devices via compatible apps. The M4A container produced by this conversion supports chapter markers, though audio extracted from Y4M pipelines typically won't carry chapter metadata.
Y4M files are extremely large because they store raw, uncompressed YUV video frames — even a few seconds of video can occupy gigabytes. The ALAC output contains only the audio stream, which represents a tiny fraction of the Y4M file's size. Additionally, ALAC compression typically reduces raw PCM audio by 40–60% depending on the content. Expect the ALAC output to be dramatically smaller than the source Y4M file.
Technical Notes
Y4M (YUV4MPEG2) is a minimalist uncompressed video container designed for piping raw video data between applications such as x264, FFmpeg, and AviSynth. Its audio support is limited — not all Y4M files contain audio, and when they do, the audio is stored as raw interleaved PCM, which FFmpeg reads directly. ALAC (Apple Lossless Audio Codec), standardized as part of the MPEG-4 specification and open-sourced by Apple in 2011, uses lossless prediction-based compression to reduce PCM audio size without any perceptual or mathematical loss. The output M4A container is an MPEG-4 Part 14 file, which supports metadata tags (artist, album, title, etc.), making it suitable for music library management in iTunes and Apple Music. One key limitation: if the Y4M source audio has an unusual sample rate or channel configuration, ALAC may require it to be within supported parameters (standard rates like 44.1kHz, 48kHz, 88.2kHz, 96kHz are all fine). The conversion drops all video streams entirely — no video remuxing or re-encoding occurs, since ALAC is a pure audio format.