Extract Audio from MKV to M4B — Free Online Tool

Extract audio from an MKV file and save it as an M4B audiobook or podcast file, encoding the audio track to AAC with chapter metadata preserved. M4B's native support for bookmarking and chapter navigation makes this ideal for converting long-form MKV recordings into a format compatible with Apple Books, iPhone, and podcast apps.

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

During this conversion, FFmpeg discards all video streams from the MKV container entirely and extracts the audio track for re-encoding. If the MKV's audio is already AAC, it could theoretically be stream-copied, but this tool re-encodes to AAC at 128k bitrate to ensure clean compatibility with the M4B container's strict MPEG-4 audio requirements. The output is wrapped in an MPEG-4 container with the .m4b extension — structurally similar to .m4a but recognized by Apple devices and audiobook apps as a bookmarkable, chapter-aware audio file. The -movflags +faststart flag reorganizes the file's metadata to the front, enabling progressive playback before the full file has loaded, which is critical for podcast streaming and large audiobook files.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg application. When run via this browser tool, it executes inside FFmpeg.wasm — a WebAssembly build of FFmpeg — so the conversion happens entirely within your browser without any file being sent to a server.
-i input.mkv Specifies the input Matroska file, which may contain video, audio, subtitles, and chapter data. FFmpeg reads all streams from this container before applying the filters and mappings that follow.
-vn Disables all video output, ensuring no video stream from the MKV is included in the M4B file. This is essential here because M4B is a pure audio format and including a video stream would produce an invalid or incompatible output file.
-c:a aac Encodes the audio stream to AAC (Advanced Audio Coding) using FFmpeg's built-in AAC encoder. AAC is the native and required codec for M4B files, and it provides good quality at moderate bitrates — particularly well-suited to spoken-word content like audiobooks and podcasts.
-b:a 128k Sets the AAC audio bitrate to 128 kilobits per second. This is a standard bitrate that balances file size and audio quality well for audiobook and podcast content; for speech-only recordings you can lower this to 64k or 96k with minimal perceptible quality loss.
-movflags +faststart Relocates the MPEG-4 moov atom (which contains all track metadata and chapter information) to the beginning of the output file rather than the default position at the end. This allows podcast apps and web players to begin streaming the M4B immediately without waiting for the entire file to download.
output.m4b The output filename with the .m4b extension, which signals to Apple Books, iTunes, Overcast, and compatible audiobook players that this file should be treated as a bookmarkable audiobook with chapter support rather than a standard music track.

Common Use Cases

  • Convert a recorded lecture or course session stored as an MKV into an M4B audiobook so students can resume playback exactly where they left off on iPhone or Apple Books.
  • Package a multi-chapter audiobook that was recorded or downloaded as an MKV video file into the M4B format recognized natively by Overcast, Podcast Addict, and Apple Podcasts.
  • Strip the video track from an MKV recording of a long-form interview or documentary and produce an M4B file that podcast hosts can distribute with chapter markers intact.
  • Convert a Matroska-wrapped audiobook rip — which may include a static cover image as the video stream — into a pure M4B audio file compatible with car infotainment systems that support AAC but not MKV.
  • Produce an M4B podcast episode from an MKV screen recording of a tutorial, discarding the video and delivering just the narration in a streamable, bookmarkable format.
  • Archive a recorded reading or spoken-word performance from MKV into M4B so it can be imported directly into iTunes or Finder and synced to an iPod or iPhone as an audiobook.

Frequently Asked Questions

Both MKV and M4B support chapters, but they store chapter data in different formats — MKV uses Matroska chapter blocks while M4B uses MPEG-4 chapter tracks. FFmpeg will attempt to convert and carry over chapter metadata during this conversion, but complex or deeply nested MKV chapter structures may not translate perfectly. It is worth verifying chapters in your M4B player after conversion, and tools like mp4chaps or Chaptered can be used to manually edit or add chapter markers to the output file if needed.
Regardless of the source audio codec in the MKV — whether Opus, Vorbis, FLAC, or MP3 — this command re-encodes the audio to AAC at 128k bitrate, since AAC is the required codec for M4B files. Re-encoding from a lossy format like Opus or Vorbis introduces a second generation of lossy compression, which can slightly reduce audio quality. If the source is FLAC (lossless), the quality loss will be limited to what AAC at 128k introduces, which is generally transparent for speech-based content like audiobooks and podcasts.
M4B and M4A are structurally identical MPEG-4 audio containers and typically contain the same AAC audio — the difference is purely in the file extension and how software interprets it. Apple devices and apps like Apple Books, iTunes, and Overcast treat .m4b files as bookmarkable audiobooks, remembering your playback position and organizing them separately from music. A .m4a file with identical content would play fine but would not trigger audiobook-specific behavior. Most non-Apple players treat both extensions the same way.
Replace the 128k value in the -b:a 128k flag with your desired bitrate. For audiobooks and spoken-word content, 64k or 96k AAC is often indistinguishable from 128k and produces smaller files — ideal for long recordings. For music or high-fidelity content, 192k or 256k will better preserve dynamic range and detail. For example, the command fragment would become -b:a 64k for a compact audiobook or -b:a 256k for higher-quality audio.
The single-file command shown here processes one file at a time, but you can adapt it for batch processing in a shell script. On Linux or macOS, a simple loop like: for f in *.mkv; do ffmpeg -i "$f" -vn -c:a aac -b:a 128k -movflags +faststart "${f%.mkv}.m4b"; done will process every MKV in the current directory. On Windows Command Prompt, use a for loop with the same flags. The browser-based tool on this page handles one file at a time, so the FFmpeg command is particularly useful for bulk conversions of large libraries.
The -movflags +faststart flag moves the MPEG-4 file's moov atom (the metadata block containing track information, chapter data, and codec details) from the end of the file to the beginning. For local playback this makes almost no practical difference, since the player can seek to the end to read metadata instantly. However, for streaming over HTTP — such as when a podcast app downloads an M4B progressively — faststart allows playback to begin before the entire file has been downloaded, which is why it is considered best practice for any M4B file intended for podcast distribution or web hosting.

Technical Notes

M4B files are constrained to a single audio track, which means if the source MKV contains multiple audio streams (e.g., multiple language dubs or a commentary track), FFmpeg will select the default or first audio stream and discard the rest. The output M4B will contain AAC audio encoded using FFmpeg's native AAC encoder (not libfdk-aac), which is adequate for speech content but may be slightly less efficient than the Fraunhofer FDK encoder at very low bitrates. Metadata fields like title, artist, and album stored in the MKV's tags will be mapped to the M4B's ID3-compatible MPEG-4 metadata atoms where equivalent fields exist, though some MKV-specific tags have no M4B counterpart and will be dropped. The .m4b extension is what signals audiobook behavior to Apple software — the underlying container is standard MPEG-4, so the file can be renamed to .m4a if you need it to be treated as a regular audio file instead. Files with embedded cover art in the MKV video stream (a common pattern for audiobook rips stored as MKV with a static JPEG video track) will have that image discarded since this command strips all video with -vn; to preserve cover art in the M4B you would need an additional -map 0:v flag and specific metadata mapping.

Related Tools