What is a .MKV file?
A .mkv file can most frequently be identified as a Matroska Video file, the visual format component of Matroska file formats created by Matroska project and managed by members of Matroska & CELLAR. Matroska file format extensions for particular situations include .mka (for audio), .mks (for subtitle only files), and .mk3d (stereoscopic video format). Matroska multimedia file format is an open format that does not contain video or audio codecs and thus can contain H.264/H.265/HEVC, VP9, MPEG-2, FLAC, Opus, TrueHD, Vorbis, AAC, ALAC, AC-3, DTS, SRT, ASS, and other streams. It appeared in 2002 as an advanced multimedia replacement of AVI, OGM, MOV, and MP4 files with a structure based on the EBML binary code.
The typical places where users would encounter files having such extension would be HD or even UHD movie files, rips of DVDs, Blu-rays or games, anime fansubs releases, screen capturing clips, Anime files that employ subtitles using the .ass file extension (a very common one among fansub fans), media for libraries for Plex, Jellyfin, Kodi, etc., and more rarely - audio files. Single MKV can contain more than one language, subtitles in different tracks (with many more than English available), chapter marks, thumbnails, font resources, metadata, and even some files (in attachments) all inside a single file. This format, as .mkv extension, has no competing formats; it might sometimes refer to files incorrectly named by users.
How to open a .MKV file
Open a .MKV file on Windows
- 1 Go to the folder with your file in File Explorer. Usually, downloaded files end up in Downloads.
- 2 Double-click your .MKV file if you have an app for .mkv files on your computer. In case it does not open, move on to step three.
- 3 Right-click your .MKV file -> select .
- 4 Choose VLC media player in the list (Windows 11: choose Always). For Windows 10 -> put a check on "Always use this app to open .mkv files" and click OK.
Still not opening? See common problems and fixes, or view it in your browser.
Open a .MKV file on macOS
- 1 In the Finder app, locate your .MKV file.
- 2 Just double-click your .MKV file in order to automatically launch the program which is connected with it.
- 3 Need another app on your Mac? Control-click the file (or right-click with a mouse). In the pop-up menu select .
- 4 If it isn't in the list, choose and find the application manually.
Still not opening? See common problems and fixes, or view it in your browser.
Open a .MKV file on Linux
- 1 Launch your file manager. Depending on the desktop it may be named Files (GNOME), Dolphin (KDE Plasma), Nemo (Cinnamon) or Thunar (Xfce).
- 2 Double-click the file.
- 3 Or choose another program by right-clicking the file -> .
- 4 Install VLC media player (if it is not installed on your computer) from the software centre, repository or Flathub.
Still not opening? See common problems and fixes, or view it in your browser.
Programs for Linux
- VLC media player open-source
- mpv open-source
- Kodi open-source
- HandBrake open-source
- MediaInfo open-source
- Plex freemium
- Jellyfin open-source
- MKVToolNix open-source
Open a .MKV file on Android
- 1 Launch Files or another file management app.
- 2 In Downloads, find the .MKV file and open it by tapping.
- 3 A list of apps capable of opening the file will be shown. Tap VLC media player and press Always to permanently connect the file type with this app.
- 4 No apps able to open this file? Download VLC media player from the Google Play Store.
Still not opening? See common problems and fixes, or view it in your browser.
Open a .MKV file on iPhone / iPad
- 1 Use the Files app and go to On My iPhone, iCloud Drive or Downloads.
- 2 Tap the .MKV file you want to open.
- 3 If the file can be opened by a built-in iOS app (supported format), it opens automatically.
- 4 Touch and hold the file to get the context menu -> choose -> select VLC media player from the list of apps.
- 5 If there is no such option, download the app first from the App Store and then tap the document again.
Still not opening? See common problems and fixes, or view it in your browser.
Open a .MKV file online
- 1 Move to the online viewer at the top of this page.
- 2 Drag the file there or select it, and its contents will appear in your browser tab. The file is not uploaded.
Still not opening? See common problems and fixes, or view it in your browser.
More details about opening .MKV files
In Windows operating system .mkv can be opened using VLC media player, MPC-HC, mpv, Kodi (also called XBMC), PotPlayer, also included are the Movies & TV or Media Player programs which come preinstalled in Windows operating system.
On macOS some examples are VLC, IINA (built on mpv), mpv, Kodi, Plex, and Infuse. In order for users to play their favorite movies at their convenience, local file players such as VLC, IINA and mpv would be recommended in order to play files, whereas, if someone prefers the library playback feature then it's best that they make use of Kodi but Plex or Infuse could prove useful for home media libraries. It's safe to conclude here that Apple QuickTime Player doesn't provide a whole lot of functionality of native matroska playback support so therefore unsupported files will require the use of a third-party application to view videos.
Some of the programs used to run matroska files on a Linux machine are VLC, mpv (Celluloid), Kodi, FFplay and GStreamer-based players all of which work on MKVs when they are accompanied by the codec packs installed using your operating systems repository. VLC for Android, MX Player, Kodi, Plex or Jellyfin server can be utilized in Android devices to watch MKVs. The hardware decoding is still required on the part of the device to watch H.264, HEVC, AV1, DTS, VP9 and other formats available on the file. On iOS/iPadOS, VLC, Infuse, Plex or Jellyfin could be used and not necessarily the Files app or TV app.
For web playback purposes some servers such as Emby, Plex and Jellyfin provide for direct or transcoded playback for the file depending upon whether browser support the file format. If someone wishes to get more info on their movie apart from its video aspect they would find MediaInfo quite helpful for the job as it provides for all sorts of information of containers or video like codecs, resolution, languages and chapter information among others and also it provides this info in an easy to read format. In case the file cannot be opened after double clicking then there could be some alternative actions performed that include opening via VLC or mpv, modifying their settings changing associations, adding support of codecs etc. For making any kind of changes on container itself MKVToolNix proves very helpful in removing/adding new tracks etc.
Technical details
Matroska is binary EBML; therefore, an .mkv file is not a text or line-by-line format in spite of the fact that EBML uses an XML-like element style. The byte signature beginning from the byte position zero is 1A 45 DF A3 and denotes the EBML header element ID. The element sizes are written as variable length integers after the ID. Then follow element payloads. As the element payload, EBML uses DocType - 'matroska', specifying the Matroska level of features required for correct writing/reading of the file. Usually, the version 4 of Matroska file is used.
SeekHead, Info (for timings and application information per segment), Tracks (description for streams), Chapters, Tags, Attachments, Cues (seek information) and Clusters are the main structures coming after the header EBML in each Segment. Void elements allocate and change some free places, whereas CRC-32 elements protect some master EBML elements. Timecode is used in matroska and is scaled with the help of timecode scale of Segment with value 1,000,000 nanoseconds for default.
Media samples are located in SimpleBlock or BlockGroup elements in Clusters structure having track numbers, relative timecodes of Cluster and Block, flags and lacing option used to indicate the amount of frames in Block. In addition, in case of BlockGroup it is possible to have references (used by inter frames codecs like video prediction codecs). The coding depends on codec; moreover, zlib compression or encryption is applied sometimes to the selected track of the movie. Meta information in the file Matroska contains EBML element; lots of fields are UTF-8 strings (WritingApp, MuxingApp, the names, names and languages of tracks, chapters' labels, string fields tags' text). The usual size of an MKV file is from few MB to 4 - 80 GB in high resolution movies; besides, Matroska removes 4GB practical limitation existing in old AVI file format; the common MIME type: video/x-matroska; other Matroska MIME types audio/x-matroska for .mka file and video/x-matroska-3d.
How to convert .MKV files
Transcode .mkv to .mp4 if phones, television sets, game consoles, browsers, media players or editing software support MP4 but not Matroska itself. The remux operation is supported for MP4-compatible streams: ffmpeg -i input.mkv -map 0 -c copy output.mp4 - this operation will be fast and won't change streams like H.264 or HEVC video, or AAC/AC-3 audio; nonetheless some Matroska features are incompatible like some attachment files or subtitle formats.
Maximum portability would consist of transcoding video part to format supported by devices in H.264 video codec and AAC audio codec, enclosed into mp4 or m4v container: ffmpeg -i input.mkv -map 0:v:0 -map 0:a? -c:v libx264 -crf 20 -preset medium -c:a aac -b:a 160k output.mp4; this method requires some lossiness; chapters, subtitles and some other parts would be possibly dropped as result.
Transcode into WebM, if VP9/AV1 video and Opus or Vorbis formats acceptable. Example of such operation: ffmpeg -i input.mkv -c:v libvpx-vp9 -crf 32 -b:v 0 -c:a libopus output.webm; WebM should be understood only as limited subset of Matroska.
HandBrake is program capable to accept matroska files as input file for encoding and support of several MKV/MP4 presets; also, it contains subtitle processing tools.
MKVToolNix will assist in removing tracks, defaulting audio and subtitles, cutting and concatenation of videos, setting metadata on mkv containers without need of reencoding.
To extract captions one can use the following command: ffmpeg -i input.mkv -map 0:s:0 output.srt; however, in case of extracting subtitles from PGS and VobSub subtitles optical character recognition step is needed to convert the subtitles to plain text form. Audio is extracted to .m4a, .flac, or .mp3. Other parts including videos aren't included there as well.
| Convert to | Tool | Command / note |
|---|---|---|
| MP4 | FFmpeg | ffmpeg -i input.mkv -map 0 -c copy output.mp4 Fast remux when the MKV contains MP4-compatible streams such as H.264/H.265/AV1 video and AAC/AC-3 audio; some subtitle or attachment tracks may be omitted or unsupported. |
| MP4 (H.264/AAC) | FFmpeg | ffmpeg -i input.mkv -map 0:v:0 -map 0:a? -c:v libx264 -crf 20 -preset medium -c:a aac -b:a 160k output.mp4 Re-encodes for broad compatibility with phones, browsers, TVs, and editors; quality loss and longer processing time are expected. |
| WebM | FFmpeg | ffmpeg -i input.mkv -c:v libvpx-vp9 -crf 32 -b:v 0 -c:a libopus output.webm Creates a web-oriented Matroska subset using VP8/VP9/AV1-style video and Vorbis/Opus audio; menus, attachments, and many subtitle formats are not preserved. |
| MOV | FFmpeg | ffmpeg -i input.mkv -map 0:v:0 -map 0:a? -c:v prores_ks -profile:v 3 -c:a pcm_s16le output.mov Useful for editing workflows; produces much larger files and does not preserve all MKV features. |
| Audio-only MP3 | FFmpeg | ffmpeg -i input.mkv -vn -c:a libmp3lame -q:a 2 output.mp3 Extracts and converts the main audio to MP3; video, subtitles, chapters, and multichannel lossless properties are discarded. |
| SRT subtitles | FFmpeg | ffmpeg -i input.mkv -map 0:s:0 output.srt Works only for text subtitle streams that FFmpeg can write as SRT; image-based subtitles such as PGS/VobSub require OCR. |
| MKV with selected tracks | MKVToolNix | mkvmerge -o output.mkv --no-attachments --no-chapters input.mkv Remuxes without re-encoding and can remove, reorder, or rename tracks; it remains an MKV file rather than changing container family. |
Common problems and fixes
A “No suitable decoder module” error or “unsupported codec" means that the MKV file container loaded, but its stream did not. Applications like VLC Media Player, mpv, IINA, or Kodi support H.264, H.265/HEVC, VP9, AV1, AAC, AC-3, FLAC streams better than a standard player on a computer. Transcoding to more universally supported formats H.264 and AAC via FFmpeg or similar utility can fix a problematic case as well.
An “Invalid data found when processing input” FFmpeg message usually denotes a corrupted download or incorrectly encoded MKV file. It can be either a bad download (incomplete), incorrect tagging, or damaged chunks that make the file unusable for transcoding. Remux the file using an MKVToolNix mkvmerge as it is sometimes possible to build a valid file even when no re-encoding takes place. Seeking and/or out-of-sync audio mean a damaged cue, a bad timing or editing with variable FPS - all such issues can be corrected by building new indexes via remuxing anew.
An audioless film means a MKV that has one multichannel audio stream that neither the player nor the television set can play correctly (like DTS, TrueHD, E-AC-3). Only the audio needs to be transcoded into something supported and compatible (AAC or AC-3). No subtitles mean an incorrect recognition of subtitle track due to ignored forced/default flag, the inability to correctly encode subtitle file and/or a problem with using custom fonts.
The file association of the file type may be wrong and, because of this, MKV files may open via editors or photo viewing utilities on a computer. In these cases change an associated application for Windows/Mac/Linux OS. Smart televisions can sometimes not support particular MKV files for various reasons.
Security considerations
Since Matroska is a multimedia container like AVI and not Office format and does not specify standard scripts/macro functionality, there are no standard execution features, and therefore .mkv file is initially safer compared to executable formats, and the user should avoid running any embedded files contained. Matroska can support any attachments, for instance fonts, posters, etc., and users should never open or run them without trusted source verification.
Malware uses flaws of demuxing tools, Subtitles ASS/SSA renderer, Font Engine, picture parsing module, Video/Audio Decoders in order to attack users. Therefore, VLC, FFmpeg, mpv, Kodi as well as system Codecs have to be updated constantly. Stylish subtitles along with attached Fonts put heavy load to old renderers' and Font Engine's code. Additional metadata contains information about file title, author, date of creation/writing, tracks information, their naming conventions, languages used and even encoding parameters as well as chapters and attachments: fonts and covers. Matroska supports encryption within container; however, ordinary consumer files will not be encrypted most of the time.
History and versions
Matroska was launched in 2002 as the development initiative on building multimedia container format started by Steve Lhomme (with several more co-developers' help) as a continuation from work and discussions held around the previous MCF container project. The title refers to the concept of Russian matryoshka dolls in regard to implementation of a wide range of objects inside one extensible container, such as video stream object (multiple types), multiple streams of audio, subtitle and chapter data, attachments and rich metadata of the file.
Initially, releases of the early 2000s era focused on eliminating the weaknesses that restricted usage of new formats in AVI and that included variable frame rate video, recent codecs, ordering chapters, multi-track audio, multiple tracks of sub-titles, rich metadata. It was based on EBML - extended binary markup language, resembling a binary version of XML structure, which was used for further development into the open container of WebM created by Google in 2010 for use in web videos but with certain restriction of possible codec types that could be used in this profile.
Later Matroska attracted considerable attention by means of fansubber groups because of its great efficiency of handling rich subtitles and multi-track versions. Then the development of formal standards of the Matroska, EBML, FFV1, and FLAC were initiated in IETF's CELLAR working group. In 2020 the specification of EBML was finally published as RFC 8794. Now Matroska still is an open and publicly described specification known as Matroska v4 or living standard with full functionality in most common media libraries, such as FFmpeg, VLC, MKVToolNix mkvmerge, several media servers and wide number of media player hardware devices and software tools.
Related formats
.MP4 and .M4V have better compatibility in most players and on all platforms (on browsers, mobiles and even in some camera apps and in some video editing software), but if you are interested in more flexible containers with ability to handle non-standard subtitle, attachment and codec files, choose .MKV.
.WEBM, is just the web-profile variant of Matroska with a set of codecs limited to only VP8, VP9, AV1 video, Opus audio etc. .AVI is quite old and rather outdated format from Microsoft family which is backward-compatible and easy to play in various environments (at least in case of legacy support), yet inferior to MKV while dealing with the recent standards.
.MOV, being Apple's QuickTime container, works well in many cases, where .MKV works better in consumer-level subtitles and audio files, but in the case of working in Apple environments it will work well too as well as the camera formats. .TS (and its version - .M2TS) will do well for broadcast and Blu-ray streaming delivery (however with poorer metadata capabilities).
.OGM and .OGV were widely used for handling Ogg-encoded videos earlier, FLV was used in Flash playback, and last one, but not least, .ISO/Blu-ray format (with folders as backups).
No comments yet. Be the first to share your experience with this file type.