If your MKV shows the wrong duration or no length at all, you are dealing with an mkv wrong duration problem. The file may play. The progress bar stays at the start. Seeking is broken, or the player reports an unknown length. This happens because the duration was never written into the file. Recorders write the duration when recording stops. A crashed recording has no duration or a placeholder. Live-stream captures may also lack a duration because the length was unknown while writing. The fix is to rebuild the file. Read every cluster's timestamps and write a proper duration and a new Cues index.
How Matroska Stores Duration
Reading The Segment Info Element
The Matroska container stores the total duration in the Segment Info element, specifically the Duration element (element ID 44 89). This value tells a media player how long the video is. Without it, the player cannot show a working progress bar or seek accurately. The duration is a single number written near the beginning of the file. If that number is missing or wrong, the player has no reference for the file's length.
Duration And Cues Work Together
Two things are required for proper seeking and progress display: a valid Duration element and a Cues index. Cues are a table of keyframe positions that allow the player to jump to specific times. Without both, you get symptoms like mkv shows no length or video length wrong mkv.
Why Crashed Recordings Have No Duration
When you record video, the software writes the duration only after the recording stops. If the recording crashes, the file is closed without writing that value. The result is a file that plays but has mkv duration missing. The same issue occurs with obs mkv no duration. OBS users see this when OBS crashes or when the system shuts down unexpectedly during a recording.
Check whether a Duration element exists using mkvinfo. Run mkvinfo yourfile.mkv and look for a line that says "Duration". If it is absent, your file is missing the duration. The file may still contain all video and audio data. The player cannot calculate the length without scanning the entire file.
How Live Streams and Captures Lose Duration
Live-stream captures present a different scenario. While recording a live stream, the encoder does not know the final length. It may write a placeholder duration (often zero) or omit the Duration element entirely. This is why mkv progress bar not working is common with downloaded streams. The file was written as the stream played. The duration was never updated after the stream ended.
The same logic applies to any MKV created by an application that writes the file incrementally without finalizing the header. The result is a file that appears to have no length, even though the video data is complete.
What Happens When Duration and Cues Are Missing
Without a duration and Cues, players cannot show a working progress bar or seek accurately. The player does not know where the file ends or where keyframes are located. Symptoms include:
- The progress bar shows the start or a random length.
- Dragging the progress bar causes the video to freeze or skip.
- Seeking to a specific time jumps to the wrong position or does not work at all.
- The player may report the file as corrupted or unplayable.
This does not mean the video data is lost. The clusters (chunks of video and audio) are still in the file. The problem is that the index (Cues) and the summary (Duration) are missing.
How Rebuilding Fixes the Problem
What Remuxing Does
Rebuilding an MKV file solves both issues. The process reads every cluster's timestamps and writes a valid duration and a new Cues index. This is called remuxing. It does not re-encode the video or audio. It rewrites the container structure.
Step-By-Step Rebuild
- The tool scans the entire file, reading the timestamp of each cluster.
- It calculates the total duration from the last timestamp.
- It writes a new Segment Info element with the proper Duration.
- It builds a new Cues index listing every keyframe and its position.
- It writes a new file with all video, audio, and subtitle data plus the corrected headers.
The output file has a proper duration, a working progress bar, and accurate seeking. This process works for crashed recordings, live-stream captures, and any MKV with missing or incorrect duration.
Verifying the Fix
After rebuilding, verify that the Duration element is present using mkvinfo. Run mkvinfo repairedfile.mkv and look for the Duration line. It should show the right length. Check that the Cues index exists. Look for a "Cues" section in the output.
Test the file in your media player. The progress bar should show the proper length, and seeking should work. If the file still behaves incorrectly, the original file may have deeper corruption that requires a different repair approach.
When to Use an Online Repair Tool
If you prefer not to install software, use an online repair service like mkv.repair. These tools perform the same remuxing process on their servers. Upload the broken MKV. The server rebuilds it with a proper duration and Cues index. The repaired file is then available for download. This is a free option with no watermark added to the output.
Online repair is best for files that are not too large to upload. It suits users who want a quick fix without command-line tools. The underlying process is the same: read every cluster's timestamps and write a valid duration and a new Cues index.