An MKV file is not one solid block of data. It is built on a framework called EBML (Extensible Binary Meta Language), a binary format of nested components. Each component carries an ID, a size, and data. That structure is why a damaged MKV can still play up to the point of the break, and why repair tools can restore missing parts like duration and seeking. Here is the MKV file structure from the first byte to the last, what each section does, and what a repair tool regenerates.
The EBML Header Where Every MKV Starts
The very first thing in an MKV is the EBML header, identified by the component ID 1A 45 DF A3. This header declares that the file uses the EBML structure and tells a player which version of the format to expect. Everything after the header is a series of nested components. Without this header, a player would not recognize the file as Matroska. WebM, a restricted subset of Matroska, also starts with this same EBML header.
The Segment Element the Container for Everything Else
Right after the EBML header comes the Segment component, ID 18 53 80 67. This is the top-level container. Inside the Segment, you will find all the other major components: Info, Tracks, SeekHead, Clusters, and Cues. The Segment can be very large because it holds all media data.
Info, Tracks, and SeekHead the Blueprint
These three components describe the file itself.
Info Holds Metadata and Duration
The Info component (ID 15 49 A9 66) holds metadata such as the duration of the video and the title. When a repair tool regenerates a file, it recalculates the duration from the timestamps in the media data.
Tracks Describes Each Stream
The Tracks component (ID 16 54 AE 6B) describes each track in the file: video, audio, and subtitle. It includes codec information, language, and other properties. This component is usually intact even in a crashed file, because it is written early.
SeekHead Acts as a Table of Contents
The SeekHead (ID 11 4D 9B 74) acts as a table of contents. It points to the positions of the other top-level components inside the Segment. If the SeekHead is damaged, a repair tool can rebuild it by scanning the file for known component IDs.
Clusters Where the Media Lives
Media data is stored in Clusters (component ID 1F 43 B6 75). Each Cluster contains one or more Blocks, and each Block holds audio, video, or subtitle frames along with their timestamps. Because Clusters are self-contained, a player can read an MKV up to the point where the file is cut or corrupted. Everything after the cut is simply ignored. This is why a truncated MKV still plays the beginning. A repair tool does not regenerate media data; it only fixes the structural components around the Clusters.
Cues the Seek Index
The Cues component (ID 1C 53 BB 6B) is the seek index. It lists the positions of key Clusters so a player can jump to a specific time without scanning the entire file. Cues is usually written at the end of the file, after all Clusters. If an MKV is truncated, the Cues component may be missing entirely. A repair tool regenerates the Cues by scanning the Clusters and recording their timestamps and positions.
What a Repair Tool Regenerates
When a repair tool like the one at mkv.repair fixes a corrupted MKV, it does not recreate lost video or audio frames. Instead, it rebuilds the structural components that are missing or damaged. Here is what gets regenerated:
- Duration in the Info component, calculated from the timestamps in the Clusters.
- Cues (the seek index) so you can skip forward and backward.
- SeekHead entries that point to the correct locations of each top-level component.
Because the Clusters themselves are left untouched, the repaired file contains exactly the same media data as the original, just with a complete index and metadata.
Why WebM is Different
WebM is a restricted subset of Matroska. It uses the same EBML structure and the same component IDs, but it limits the allowed codecs to VP8, VP9, Opus, and Vorbis. The layout is identical: an EBML header, a Segment, Info, Tracks, Clusters, and Cues. The same repair principles apply to WebM files.