Valid HTML 4.01!

AVI-Mux GUI

output options - MKV



General

This section explains the available settings for output files. Not recommended values are display in red color.

Warning! If you use output settings appearing in red, you are entirely acting on your own risk! Using such settings does probably decrease compatibility!

back to main page

mkv settings page 1 mkv settings page 2 mkv settings page 3



Output: MKV file structure

Lacing

Lacing allows to store several audio frames of the same stream in one MKV block, similarly to chunks in AVI files. This reduces overhead, but also causes a loss of time stamps. This is usually no problem for playback of files (except for Vorbis streams, which should not use excessive lacing), but might cause issues if you try to reprocess such a file.

Available modes:

Additionally, you can specify different lacing behaviour for different audio formats. Check the box next to the format field to indicate that a special setting shall be used, or uncheck it to use the general setting instead. Note that the default settings have a reason to be there. Play around with them on your own risk.

You can also lace video. Experience has shown that Mediaplayer Classic can replay such files, but it is not recommended nor spec compliant! Use video lacing at your own risk, and only in connection with the auto-setting! You should only use it if it is absolutely necessary, i.e. if your file won't fit on a DVD+R DL disc without it!

Cues

The Cue structure allows seeking to a specific timecode without searching in the file itself. Files not containing Cues might malfunction, especially audio-only files with many tracks.

You can select the type of tracks you want to create cues for: Cue Interval Settings:
minimum interval:
Minimum interval in milliseconds between 2 CuePoints for the same stream
cue data rate:
When automatic cue size is enabled, select how many kilobytes per hours and per stream should be used for Cues. This space will be reserved before the first Cluster
target size:
If the Cues, as created using the indicated minimum interval, exceed the selected data rate (default: 20 kB/stream/hour), CuePoints to be dropped are randomly chosen. Target size ratio is a factor by which the space available for Cues is multiplied to calculate the size the Cues should have at the end ("target size"). Each CuePoint is kept with a probability of target_size/current_size, meaning that the actual size of the Cues will slightly differ from the target size. If the final Cues' size exceeds the available space, this value will be reduced by 1 and AVI-Mux GUI will retry selecting CuePoints to be kept. Note that, for large output files with tens of thousands of CuePoints, this can take a few seconds.
The following behaviour cannot be influenced at the moment: recommended:

Other settings

force matroska v1 compatibilityThis prevents the user from choosing settings that stretch the matroska file specifications to a questionable extent. It also prevents the usage of structures that are only available in Matroska v2, for example SimpleBlocks.
force matroska v2 compatibilityThis prevents the user from choosing settings that stretch the matroska file specifications to a questionable extent. When Matroska v2 is enabled, SimpleBlocks are used when possible, significantly reducing overhead
write PrevClusterSize/Positionchoose whether or not the PrevClusterSize / Position Element is written into each cluster. See Matroska specs for more information. Simply said, software for recovering broken matroska files can make use of this, but it is rather useless for intact files.
index clusters in seekheadIf checked, one seekhead entry will be added for each cluster. It consumes about 18 bytes per entry.

When size of headers is set to automatic, this setting is disabled (indexing clusters makes the estimation how much space is needed hard).

Warning: Very small clusters in connection with very large files cause extensive memory usage of AVI-Mux GUI if this setting is used. For example, selecting a size of 16 kB per cluster when muxing a 4,4 GB file took 450 MB RAM at the end of the muxing process)!

recommended: disabled
maximum cluster sizeset the maximum size of clusters here. Note that some clusters might exceed this size by a few bytes. Lower values reduce the risk of losing larger parts of the stream if a file is damaged, but cause more overhead and more memory consumption when muxing.
maximum cluster lengthHere you can define the maximum length of a cluster, in time.

Warning: You use settings larger than 30k units (see Timecode Scale settings) on your own risk!
limit first cluster to 30kuWhen allowing clusters to span over a period of more than 30ku, you can limit the first cluster to 30ku. This may fix compatibility problems you introduce by allowing such clusters in the first place
always write DisplayWidth/HeightThe DisplayWidth/Height elements contain the output size of the movie (which is different from the encoding resolution for anamorphically encoded videos). If the movie is not encoded anamorphically, those elements can be dropped. However, some earlier versions of TCMP do not like this at all, and setting the aspect ration later (e.g. using Jory 'jcsston' Stone's Matroska Shell Extentions) would be impossible. Check this setting to always write the DisplayWidth/Height elements.

recommended: enabled
timecode scaleDefines the accuracy timecodes are stored at. It is given as a multiple of nanoseconds. That means, a value of 1000000 causes timecodes to be stored in milliseconds. Audiostreams are internally handled using microseconds, so using values below 1000 here won't increase timecode accuracy.

You can set the desired timecode scale separately for files that contain video (mkv) and files that only contain audio (mka).
write 2 copies of TracksThe Tracks element, containing the description of the type of each track in the file, will be stored twice, so that the file still can work if one copy gets damaged.
width of floats in bitsAllows to select either 32 or 64 bit floats. Floats of 32 bit have an accuracy of about 2^-24, meaning, when using 32 bit floats, the segment duration could be off by 1ms for a file lasting 4h30min. If that is not acceptable, use 64 bit floats along with a lower setting for TimecodeScale. However, some applications might need to be updated to handle 64 bit floats.

80 bit floats used to be allowed in the matroska specification, but were removed. Consequently, AVI-Mux GUI can read 80 bit floats, but can only write them if you disable matroska v1 as well as matroska v2 compatibility.
randomize element orderIf this setting is used, some elements will be randomly ordered inside their parent element. The purpose is only to find lazy coders, who assume a certain element order inside Matroska files in their own parsers, even though the format doesn't require it.

If using this setting results in a file a certain application can't handle, keep the file and contact the author of the application in question.
index non-Clusters in 1st SeekheadWhen Clusters are index in the SeekHead, the first small SeekHead is usually not large enough to hold references to all Level 1 - elements. When this setting is checked, references to non-Clusters (Tags, SegmentInfo, Tracks, Cues, Chapters) will always be put into the first SeekHead, otherwise it will be put into the 2nd SeekHead, if it is present.

Besides looking for b0rked Matroska parsers or intentionally creating certain test files, there is no reason to disable this setting.
size of headersDefines how much space is at least reserved for headers which are written before the first cluster. When this value is too big, you waste space, when it is too small, Chapters, Tags and Cues must be written to the end of the file, instead of the beginning, which makes opening them a bit slower on very-slow-seek-media, like Princo DVD-R, and which makes it more inconvenient to verify such files manually, for example in a hex editor or an EBML Tree Viewer.

See here for remarks concerning this feature.
hard linkingIf the output file is split into several parts, hard linking makes it easier for a matroska parser to realize that those parts are in fact one file. Some players will even pretend those parts to be one big file. This results in SegmentFamily, PrevUID und NextUID being written to output files.
stripe stream headers if possibleAC3, MP3 and DTS audio frames begin with specific sequences of bytes which are the same for each frame. Matroska allows to remove such specific bytes in order to save space. For AC3, you gain one byte per 16ms, for DTS, you typically gain 1 byte per 2.05ms. This is called "header striping". It also works with MPEG4/ASP video in native mode and gains 4 bytes per frame then.
allow CodecID "A_AAC"Write simply A_AAC and use WAVEFORMATEX private data as codec private instead of using A_AAC/MPEGx/xxx[/SBR]. See Matroska Codec Specs for more information.

Automatic header size calculation

There are a few remarks you might want to be aware of concerning this feature: