Processed on this device
File formats at a glance.Formats

MKV file: What is it and which codecs can it contain?

.mkv

MKV is a Matroska media container, not a video codec. One file can hold video, multiple audio tracks, subtitles, chapters, attachments and metadata, while actual playback depends on the codecs inside.

Format at a glance

Full name
Matroska Video Container
File extensions
.mkv
MIME types
video/x-matroska
Category
Video
Compression
Depends on the contained codec
Transparency
Not applicable
Animation
Not applicable
Properties
Multiple media tracks, Subtitles, Chapters

Suitable tools

What is this format?

Matroska is an open, extensible container format. The .mkv extension is commonly used when a Matroska file contains video; .mka is commonly used for audio-only Matroska.

A player must understand both the Matroska structure and every selected codec. Two MKV files can therefore behave differently even though their filename extensions are identical.

What is it used for?

  • Video archives with multiple audio languages
  • Subtitled films and series
  • High-quality video with lossless audio
  • Remuxing several synchronized media tracks without re-encoding them

Which programs can open it?

  • VLC media player
  • mpv
  • Kodi
  • FFmpeg and compatible media applications

Support across devices and browsers

Windows

VLC and mpv are dependable; system-player support depends on installed codecs.

macOS

VLC, mpv or IINA are commonly used because QuickTime support is limited.

Linux

VLC, mpv and GStreamer-based players usually support Matroska with available codecs.

Android

VLC and compatible media players open many MKV combinations.

iOS

Third-party players such as VLC are normally required.

Browsers

Native HTML video playback for MKV is inconsistent and depends on both container and codec support.

Advantages

  • Can hold many synchronized video, audio and subtitle tracks
  • Supports chapters, attachments and rich metadata
  • Flexible choice of open and proprietary codecs

Disadvantages

  • Not every player supports Matroska natively
  • Codec support cannot be inferred from the .mkv extension
  • Large multi-track files can consume significant memory during browser processing

Comparison with alternatives

MKV vs. MP4

MP4 has stronger device and browser compatibility; MKV is more flexible for multiple tracks and subtitles.

MKV vs. MOV

MOV is central to Apple and professional workflows; MKV is open and commonly used for distribution and archives.

MKV vs. WebM

WebM uses a narrower web-focused codec set; Matroska accepts a much broader range.

LocalFileLab support

InputSupported

The container is passed to FFmpeg/WASM, but the bundled decoder set is not enumerated per codec in the repository.

OutputSupported

The codec table below lists the encoders actually configured for MKV output.

CompressionSupported

MKV is transcoded locally; it is not a simple container-only size reduction.

PreviewSupported

Browser playback depends on the contained codecs and native Matroska support.

MetadataSupported

Basic metadata mapping is configurable, but full preservation of attachments, chapters and stream metadata is not verified.

Container and codecs

The LocalFileLab statements below come from the FFmpeg/WASM and WebCodecs paths actually configured in the repository. Decoders or tracks not explicitly evidenced in code are marked unverified.

Container
Matroska / MKV
Typical video codecs
H.264 / AVC, H.265 / HEVC, VP9, AV1, MPEG-4 Part 2
Typical audio codecs
AAC, MP3, Opus, Vorbis, FLAC, AC-3, E-AC-3
CodecTypeInputOutputNotes
H.264 / AVCVideoUnverifiedSupportedThe project does not enumerate the FFmpeg/WASM input decoder per codec. A concrete FFmpeg/WASM encoder is configured in the repository.
H.265 / HEVCVideoUnverifiedSupportedThe project does not enumerate the FFmpeg/WASM input decoder per codec. A concrete FFmpeg/WASM encoder is configured in the repository. Playback may require a matching browser or system codec.
VP9VideoUnverifiedSupportedThe project does not enumerate the FFmpeg/WASM input decoder per codec. A concrete FFmpeg/WASM encoder is configured in the repository.
AV1VideoUnverifiedNot supportedThe project does not enumerate the FFmpeg/WASM input decoder per codec. This codec is not offered as an output for this container.
MPEG-4 Part 2VideoUnverifiedSupportedThe project does not enumerate the FFmpeg/WASM input decoder per codec. A concrete FFmpeg/WASM encoder is configured in the repository.
AACAudioUnverifiedSupportedThe project does not enumerate the FFmpeg/WASM input decoder per codec. A concrete FFmpeg/WASM encoder is configured in the repository.
MP3AudioUnverifiedSupportedThe project does not enumerate the FFmpeg/WASM input decoder per codec. A concrete FFmpeg/WASM encoder is configured in the repository.
OpusAudioUnverifiedSupportedThe project does not enumerate the FFmpeg/WASM input decoder per codec. A concrete FFmpeg/WASM encoder is configured in the repository.
VorbisAudioUnverifiedSupportedThe project does not enumerate the FFmpeg/WASM input decoder per codec. A concrete FFmpeg/WASM encoder is configured in the repository.
FLACAudioUnverifiedSupportedThe project does not enumerate the FFmpeg/WASM input decoder per codec. A concrete FFmpeg/WASM encoder is configured in the repository.
AC-3AudioUnverifiedSupportedThe project does not enumerate the FFmpeg/WASM input decoder per codec. A concrete FFmpeg/WASM encoder is configured in the repository.
E-AC-3AudioUnverifiedSupportedThe project does not enumerate the FFmpeg/WASM input decoder per codec. A concrete FFmpeg/WASM encoder is configured in the repository.
Text and subtitle tracksSubtitleUnverifiedNot supportedThis track is not mapped explicitly during export.

Tracks and metadata

Subtitle tracks
Unverified
Multiple audio tracks
Not supported
Chapters
Unverified
Metadata
Configurable

Known combinations

H.264 / AVC + AACOutput path configured

A concrete FFmpeg/WASM encoder is configured in the repository.

H.265 / HEVC + AACBrowser-dependent

A concrete FFmpeg/WASM encoder is configured in the repository. Playback may require a matching browser or system codec.

VP9 + OpusOutput path configured

A concrete FFmpeg/WASM encoder is configured in the repository.

AV1 + OpusNot supported

This codec is not offered as an output for this container.

Related formats

Frequently asked questions

Is MKV a video codec?

No. MKV is a container. The video might use H.264, HEVC, VP9 or another codec, and the audio uses its own codec.

Why does one MKV play while another does not?

They can contain different codecs, profiles, bit depths or track types. The player may support the container but not a selected stream.

Does LocalFileLab preserve all MKV tracks?

No guarantee is made. The current paths process primary video and audio; multiple audio tracks, subtitles, attachments and chapters are not explicitly mapped.