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.
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.
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.