Peek inside a Matroska (.mkv) or WebM (.webm) container without a media player — read its EBML header, doc type, segment info and every track’s codec, type and language. The inspector walks the EBML element tree directly with the browser’s DataView API, entirely on your device.
When to use this
You reach for an EBML inspector when you need to know what is inside a container before loading it into a full player or transcoder. Typical cases:
- You downloaded an MKV and want to confirm whether it uses H.264 or H.265 video before committing to a long transcode.
- A playback device refuses a file and you want to check whether it is the video codec (
V_MPEG4/ISO/AVC,V_MPEGH/ISO/HEVC), the audio (A_DTS,A_TRUEHD) or the subtitle format (S_HDMV/PGS) causing the incompatibility. - You are debugging a muxer and want to verify the
MuxingApp,WritingApp, andTimestampScaleit wrote. - You want to confirm a file is genuinely WebM (and therefore browser-safe) rather than a renamed MKV.
Everything runs in your browser with DataView — no upload, no install, no network.
How it works
MKV and WebM are EBML documents — a binary tree where each element has three parts:
[ Element ID ][ Size ][ Data ]
Both the ID and the size are variable-length integers (vints). The first byte’s leading bits
mark the length: a leading 1 means 1 byte, 01 means 2 bytes, 001 means 3 bytes, and so on.
For the size, those length-marker bits are stripped before reading the value; for the ID, they
are kept (the ID is used verbatim).
The inspector reads only the elements that carry metadata:
EBML header (0x1A45DFA3)
DocType (0x4282) "matroska" or "webm"
DocTypeVersion (0x4287)
Segment (0x18538067)
Info (0x1549A966)
TimestampScale (0x2AD7B1) nanoseconds per tick (default 1,000,000)
Duration (0x4489) float, in TimestampScale units
Title (0x7BA9)
MuxingApp (0x4D80)
WritingApp (0x5741)
Tracks (0x1654AE6B)
TrackEntry (0xAE)
TrackType (0x83) 1=video 2=audio 17=subtitle
CodecID (0x86) e.g. V_VP9, A_OPUS
Language (0x22B59C)
Name (0x536E)
Master elements (Segment, Info, Tracks, TrackEntry) contain children, so the inspector recurses into them; leaf elements hold a typed value (string, unsigned integer or float).
Duration
Playback length is computed from two fields:
seconds = Duration × TimestampScale ÷ 1,000,000,000
With the default scale of 1,000,000 ns, a stored Duration of 7200000 represents 7,200 ms = 7.2 s.
Reading the codec IDs
The CodecID strings follow a naming convention: prefix letter identifies the track type (V_ = video, A_ = audio, S_ = subtitle), and the rest names the codec family and format. Common ones:
| CodecID | What it means |
|---|---|
V_MPEG4/ISO/AVC | H.264 video |
V_MPEGH/ISO/HEVC | H.265/HEVC video |
V_VP9 | VP9 video (web-safe) |
V_AV1 | AV1 video |
A_AAC | AAC audio |
A_OPUS | Opus audio (web-safe) |
A_AC3 | Dolby AC-3 audio |
S_TEXT/UTF8 | SRT-style subtitle |
S_HDMV/PGS | Blu-ray PGS bitmap subtitle |
If the CodecID starts with V_VP or V_AV1 and audio is A_OPUS or A_VORBIS, the file is natively web-playable. Any other video or audio codec will require transcoding for browser or device compatibility.
Tips
- A DocType of
webmguarantees web-playable codecs (VP8/VP9/AV1, Opus/Vorbis);matroskaallows any codec. - The Segment element’s size is often unknown (all size bits set to 1) in streamed files — the inspector handles this by scanning to the end of the read region.
- Track language defaults to
engwhen no Language element is present, per the Matroska spec. - Files with many subtitle tracks (multilingual rips) will show one TrackEntry per subtitle stream — the inspector lists them all with their language tags.