3 Meta data fields like bitrate lost
Moritz Bunkus edited this page 2019-05-18 10:21:56 +02:00

Why are meta data fields like bitrate or encoder name lost when muxing to Matroska?

The problem

You use tools like MediaInfo to show you information about source files and compare that with the information after you've muxed that file into a Matroska file. You notice that several pieces of information like e.g. the bitrate or the encoder name are not present in a Matroska file.

The answer

The Matroska file format does not offer header fields for such pieces of information. In general only information that a codec might require for playback is stored in Matroska's track headers. Data that is simply informational can be stored in Matroska tags if you want, but mkvmerge does not do that automatically for you.

You might notice that MediaInfo still shows bitrate information for some Matroska files but not for others. This may have two reasons:

  1. The bitrate might be stored on the bitstream level. This is only possible for audio/video types whose specifications provide fields for that kind of information in the bitstream.
  2. If there's only a single track in a Matroska file then the bitrate can be estimated with the following formula: bitrate_in_kbit_per_second = (file_size_in_bytes * 8) / (file_duration_in_seconds * 1024)

Note that starting with v7.0.0 mkvmerge will create track-specific statistics and store them in tags. Newer versions of MediaInfo should be able to use that information properly.

Categories: merging, metadata