.mkv MIME type
Matroska videovideo
video/matroskaMatroska video, a container for almost any codec. RFC 9559 registered video/matroska in 2024.
| MIME type | video/matroska |
|---|---|
| Extensions | .mkv |
| Also seen as | video/x-matroska |
| Content-Type | video/matroska |
| Compress in transit? | No — already compressed |
| File signature | 1A 45 DF A3 the EBML header shared by WebM and Matroska |
Good to know
- Most servers and the
filecommand still usevideo/x-matroska, Apache's stock config included. Accept both on upload. - Browsers don't officially support Matroska in
<video>. If the codecs inside are browser-friendly, remux without re-encoding:ffmpeg -i in.mkv -c copy out.mp4. - Audio-only Matroska files use
.mkaandaudio/matroska.
Serve .mkv files with the right type
The response header to send:
Content-Type: video/matroska
Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:
video/matroska mkv;
AddType video/matroska .mkv
res.set("Content-Type", "video/matroska");import mimetypes
mimetypes.add_type("video/matroska", ".mkv")<input type="file" accept=".mkv,video/matroska">
Check it
See what a server sends for a file, and what type a local file really is by its contents:
curl -sI https://example.com/file.mkv | grep -i '^content-type:' file --mime-type file.mkv
Frequently asked questions
What is the MIME type for .mkv files?
video/matroska. You may also see video/x-matroska, but video/matroska is the one to send.
What Content-Type header should a .mkv file be served with?
Content-Type: video/matroska. It's already compressed, so servers shouldn't gzip it.
How can I tell if a file is really a .mkv?
Check its bytes rather than the extension: MKV files start with 1A 45 DF A3 — the EBML header shared by WebM and Matroska. On the command line, file --mime-type name.mkv does this for you.
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options