Extract Audio from MKV to WEBA — Free Online Tool

Extract audio from MKV video files and convert it to WEBA format, encoding the audio stream with the Opus codec — a modern, open-source codec optimized for low-latency streaming and high-quality web playback. Ideal for pulling clean audio from MKV files destined for web-based media players or WebRTC applications.

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

MKV containers can hold a wide variety of audio codecs (AAC, MP3, Opus, Vorbis, FLAC, and more), but WEBA is an audio-only WebM container that exclusively supports Opus or Vorbis. During this conversion, the video stream is entirely discarded using the -vn flag — no video decoding or encoding takes place. The audio stream is then transcoded (re-encoded) to Opus using the libopus encoder at 128k bitrate by default. Even if the source MKV already contains an Opus audio track, a direct stream copy into WEBA is not performed here — the audio is re-encoded to ensure clean output within the WEBA/WebM container structure. The result is a compact, web-ready audio file stripped of all video data, subtitles, chapters, and multiple audio tracks that the MKV may have contained.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg binary — the underlying engine that powers this browser-based tool via WebAssembly (FFmpeg.wasm). The same command runs identically on a desktop FFmpeg installation for files over 1GB.
-i input.mkv Specifies the input file — your MKV source. FFmpeg reads the Matroska container and identifies all contained streams: video, audio (potentially multiple tracks), subtitles, and chapters.
-vn Disables video output entirely, instructing FFmpeg to ignore all video streams in the MKV. This is essential for producing an audio-only WEBA file and avoids any costly video decoding work.
-c:a libopus Sets the audio encoder to libopus, the reference Opus codec implementation. Opus is the required codec for WEBA files and is natively supported by all modern browsers, making it the ideal choice for web audio delivery.
-b:a 128k Sets the target average audio bitrate to 128 kilobits per second for the Opus encoder. At 128k, Opus delivers transparent or near-transparent quality for most music and speech content extracted from MKV sources.
-vn A second -vn flag appearing before the output filename, reaffirming that no video stream should be written to the WEBA output. While redundant alongside the earlier -vn, it is harmless and ensures the audio-only constraint is enforced at the output level.
output.weba The output filename with the .weba extension, which signals to FFmpeg to wrap the encoded Opus audio in a WebM-compatible container. The .weba extension is the standard convention for audio-only WebM files and is recognized by browsers for direct playback.

Common Use Cases

  • Extract the audio commentary track from an MKV film or documentary to publish as a standalone web audio file on a site using the HTML5 <audio> element with WebM/WEBA support
  • Pull audio from an MKV screen recording or tutorial video to create a podcast episode or audio-only lesson optimized for efficient web streaming
  • Convert MKV game capture footage audio to WEBA for use in browser-based games or web apps that rely on the Web Audio API, which handles Opus natively
  • Strip audio from MKV anime or foreign-language video files to create Opus-encoded WEBA files for use in WebRTC applications or browser-based language learning tools
  • Extract a music performance or concert recording stored in MKV and convert it to WEBA for embedding in a web page with minimal file size and high perceptual quality at lower bitrates
  • Prepare audio from MKV video archives for use in Progressive Web Apps (PWAs) where WEBA/Opus offers better compression efficiency than MP3 or AAC at equivalent perceptual quality

Frequently Asked Questions

It depends on the source audio codec in your MKV. Since WEBA only supports Opus or Vorbis, the audio must be re-encoded regardless — this is a lossy transcoding step. If your MKV contains FLAC or uncompressed audio, the quality loss at 128k Opus will be minimal and generally considered transparent by most listeners. However, if your source is already lossy (e.g., AAC or MP3 in the MKV), you are performing a generation loss — re-encoding from one lossy format to another — which can introduce subtle artifacts. For the best results in that case, use a higher bitrate like 192k or 256k in the FFmpeg command.
The WEBA format (an audio-only WebM container) does not support multiple audio tracks — it is designed as a simple, single-stream web audio format. FFmpeg will default to selecting the first audio stream from the MKV during this conversion. If you need a specific audio track from a multi-track MKV (such as a commentary track or a different language dub), you can modify the FFmpeg command to add -map 0:a:1 (for the second audio track) or -map 0:a:2 for the third, before the output filename.
No. The WEBA container format does not support chapters, subtitles, or complex metadata structures that MKV is known for. All subtitle tracks, chapter markers, and secondary metadata embedded in the source MKV are discarded during this conversion. Only the primary audio stream and basic metadata tags (such as title or artist, if present) may carry over. If preserving chapters or subtitles is important, you should work with the MKV directly or choose a container that supports those features.
AAC (Advanced Audio Coding) is the dominant lossy codec in the MKV ecosystem and is widely supported by hardware devices and desktop players. Opus, used in WEBA, is an open royalty-free codec developed by Xiph.Org and standardized by the IETF — it consistently outperforms AAC in perceptual quality at the same bitrate, especially at lower bitrates (64k–128k). However, Opus has weaker hardware decoder support outside of browsers and modern Linux/Android systems, making WEBA files less suitable for playback on smart TVs, older mobile devices, or media players that do not support WebM.
Replace the value after -b:a in the command with your desired bitrate. For example, to encode at 192k: ffmpeg -i input.mkv -vn -c:a libopus -b:a 192k output.weba. Opus performs exceptionally well at low bitrates, so 64k is often sufficient for speech, while 128k–192k is recommended for music. Going above 256k with Opus yields diminishing returns compared to lossless formats. You can also switch from Opus to Vorbis by replacing -c:a libopus with -c:a libvorbis if you need broader compatibility with older WebM implementations.
Yes. On Linux or macOS, you can use a shell loop: for f in *.mkv; do ffmpeg -i "$f" -vn -c:a libopus -b:a 128k "${f%.mkv}.weba"; done. On Windows Command Prompt, use: for %f in (*.mkv) do ffmpeg -i "%f" -vn -c:a libopus -b:a 128k "%~nf.weba". This is particularly useful for processing large collections of MKV files that exceed the 1GB browser limit, since running FFmpeg locally removes any file size constraints.

Technical Notes

WEBA is the file extension convention for audio-only WebM files, which use the same Matroska-derived container structure as WebM but carry only an audio stream. The libopus encoder used here is the reference implementation of the Opus codec (RFC 6716) and is well-supported across all modern browsers via the HTML5 Audio element and Web Audio API. One important limitation: WEBA does not inherit MKV's rich feature set — multiple audio tracks are collapsed to one, chapter data is dropped entirely, and subtitle streams are ignored. Because Opus is a variable-bitrate codec by nature, the -b:a 128k flag sets a target average bitrate rather than a strict constant bitrate, which is generally preferable for quality. The -vn flag appears twice in the resolved command (once before and implicitly associated with output) — in practice, a single -vn before the output file is sufficient, but the redundancy is harmless. For MKV files containing FLAC audio, this conversion involves a significant format shift from lossless to lossy; users who need to preserve lossless audio should not use WEBA as the target format and should instead consider extracting to FLAC directly.

Related Tools