Created Understanding mkvinfo's output (markdown)

Moritz Bunkus 2015-02-07 21:11:21 +01:00
parent 7ac8d3b74e
commit 2f4554fd6b

@ -0,0 +1,41 @@
# Understanding mkvinfo's output
## The problem
You see that mkvinfo outputs quite a lot of elements, but some are missing. Sometimes whole important sections like the track headers aren't shown either.
## Explanation
mkvinfo is mostly a development and anlysis tool. It therefore doesn't work like a regular player would. It reads a file sequentially: from start to finish without seeking. When it finds an element it outputs that element.
mkvinfo does not output elements that are not present in the file. This confuses users who expect to see a "language" element with "eng" as the value because they've set the track's language to "English". However, mkvmerge does not write elements that are set to their [default values](Elements-not-showing-up-in-output-file) and therefore they're not present in the file, and mkvinfo doesn't show them.
mkvinfo has two different output modes: the tree mode that is active by default and the summary mode activated with `-s` (`--summary`).
## Tree mode
This is the default. For each EBML element found in the file a single line is output. The line is indented by the Matroska element's depth inside the Matroska element tree.
As this output can get very long mkvinfo stops when it finds the first cluster by default. This implies that all elements located behind the first cluster aren't output. This applies often to elements like attachments or chapters, but also the index (the "cues" in Matroska terms). It can even apply to the track headers: if tools like mmg's header editor or mkvpropedit need to write more data to the track headers than space is available at the start of the file (e.g. when you add long track names to a file) then the track headers will be relocated to the end of the file, and a meta index entry will be created at the start pointing to them.
You can tell mkvinfo to continue when it finds the first cluster by adding one `-v` (`--verbose`) parameter. The more `-v` parameters you add the more verbose the output will be after that, including things like element's positions, checksums etc.
There's only one such point where mkvinfo will stop: before the first cluster if no `-v` is used.
## Summary mode
In summary mode mkvinfo's output is meant to be terse. The track headers are condensed into a single line per track. Each frame is reported as a single line, no matter if it's stored in a BlockGroup or a SimpleBlock. Other elements are not output.
Summary mode is useful for comparing file content on a higher level than on an element-per-element level. It can be used for different things:
- getting an overview of how many frames are in a file
* quick overview of frame types (I/P/B frames)
* checking whether or not the frame content of two files equal by applying other Unix tools like `grep` or `diff` the mkvinfo's output
## Alternative: mkvmerge's identification
If all you need is a quick overview of which tracks, attachments, chapters and tags are present in a file then you should consider using mkvmerge's identification mode. That's what the GUI calls behind the scenes when you add a file, too. As an additional bonus mkvmerge reads a file like a player should: by starting at the beginning and quickly following the meta seek elements in order to find the important elements.
You can invoke the identification mode with `mkvmerge --identify yourfile.mkv` or, for additional properties for each item, like `mkvmerge --identify-verbose yourfile.mkv`.
Categories: [metadata](Category-metadata)