1MKVMERGE(1)                      User Commands                     MKVMERGE(1)
2
3
4

NAME

6       mkvmerge - Merge multimedia streams into a Matroska(TM) file
7

SYNOPSIS

9       mkvmerge [global options] {-o out} [options1] {file1}
10                [[options2] {file2}] [@optionsfile]
11

DESCRIPTION

13       This program takes the input from several media files and joins their
14       streams (all of them or just a selection) into a Matroska(TM) file; see
15       the Matroska(TM) website[1].
16
17       Global options:
18
19       -v, --verbose
20           Increase verbosity.
21
22       -q, --quiet
23           Suppress status output.
24
25       -o, --output file-name
26           Write to the file file-name. If splitting is used then this
27           parameter is treated a bit differently. See the explanation for the
28           --split option for details.
29
30       -w, --webm
31           Create a WebM compliant file. This is also turned on if the output
32           file name's extension is "webm". This mode enforces several
33           restrictions. The only allowed codecs are VP8 video and Vorbis
34           audio tracks. Neither chapters nor tags are allowed. The DocType
35           header item is changed to "webm".
36
37       --title title
38           Sets the general title for the output file, e.g. the movie name.
39
40       --tags file-name
41           Read global tags from the XML file file-name. See the section about
42           tags below for details.
43
44       --default-language language-code
45           Sets the default language code that will be used for all tracks
46           unless overwritten with the --language option. The default language
47           code is 'und' for 'undefined'.
48
49       Segment info handling: (global options)
50
51       --segmentinfo filename.xml
52           Read segment information from a XML file. This file can contain the
53           segment family UID, segment UID, previous and next segment UID
54           elements. An example file and a DTD are included in the MKVToolNix
55           distribution.
56
57       --segment-uid SID1,SID2,...
58           Sets the segment UIDs to use. This is a comma-separated list of
59           128bit segment UIDs in the usual UID form: hex numbers with or
60           without the "0x" prefix, with or without spaces, exactly 32 digits.
61
62           Each file created contains one segment, and each segment has one
63           segment UID. If more segment UIDs are specified than segments are
64           created then the surplus UIDs are ignored. If fewer UIDs are
65           specified than segments are created then random UIDs will be
66           created for them.
67
68       Chapter and tag handling: (global options)
69
70       --chapter-language language-code
71           Sets the ISO639-2 language code that is written for each chapter
72           entry. Defaults to 'eng'. See the section about chapters below for
73           details.
74
75           This option can be used both for simple chapter files and for
76           source files that contain chapters but no information about the
77           chapters' language, e.g. MP4 and OGM files.
78
79       --chapter-charset character-set
80           Sets the character set that is used for the conversion to UTF-8 for
81           simple chapter files. See the section about text files and
82           character sets for an explanation how mkvmerge(1) converts between
83           character sets.
84
85           This switch does also apply to chapters that are copied from
86           certain container types, e.g. Ogg/OGM and MP4 files. See the
87           section about chapters below for details.
88
89       --cue-chapter-name-format format
90
91           mkvmerge(1) supports reading CUE sheets for audio files as the
92           input for chapters.  CUE sheets usually contain the entries
93           PERFORMER and TITLE for each index entry.  mkvmerge(1) uses these
94           two strings in order to construct the chapter name. With this
95           option the format used for this name can be set.
96
97           If this option is not given then mkvmerge(1) defaults to the format
98           '%p - %t' (the performer, followed by a space, a dash, another
99           space and the title).
100
101           If the format is given then everything except the following meta
102           characters is copied as-is, and the meta characters are replaced
103           like this:
104
105           ·   %p is replaced by the current entry's PERFORMER string,
106
107           ·   %t is replaced by the current entry's TITLE string,
108
109           ·   %n is replaced by the current track number and
110
111           ·   %N is replaced by the current track number padded with a
112               leading zero if it is < 10.
113
114       --chapters file-name
115           Read chapter information from the file file-name. See the section
116           about chapters below for details.
117
118       --global-tags file-name
119           Read global tags from the file file-name. See the section about
120           tags below for details.
121
122       General output control (advanced global options):
123
124       --track-order FID1:TID1,FID2:TID2,...
125           This option changes the order in which the tracks for an input file
126           are created. The argument is a comma separated list of pairs IDs.
127           Each pair contains first the file ID (FID1) which is simply the
128           number of the file on the command line starting at 0. The second is
129           a track ID (TID1) from that file. If some track IDs are omitted
130           then those tracks are created after the ones given with this option
131           have been created.
132
133       --cluster-length spec
134           Limit the number of data blocks or the duration of data in each
135           cluster. The spec parameter can either be a number n without a unit
136           or a number d postfixed with 'ms'.
137
138           If no unit is used then mkvmerge(1) will put at most n data blocks
139           into each cluster. The maximum number of blocks is 65535.
140
141           If the number d is postfixed with 'ms' then mkvmerge(1) puts at
142           most d milliseconds of data into each cluster. The minimum for d is
143           '100ms', and the maximum is '32000ms'.
144
145
146           mkvmerge(1) defaults to putting at most 65535 data blocks and
147           5000ms of data into a cluster.
148
149           Programs trying to find a certain frame can only seek directly to a
150           cluster and have to read the whole cluster afterwards. Therefore
151           creating larger clusters may lead to imprecise or slow seeking.
152
153       --no-cues
154           Tells mkvmerge(1) not to create and write the cue data which can be
155           compared to an index in an AVI.  Matroska(TM) files can be played
156           back without the cue data, but seeking will probably be imprecise
157           and slower. Use this only if you're really desperate for space or
158           for testing purposes. See also option --cues which can be specified
159           for each input file.
160
161       --clusters-in-meta-seek
162           Tells mkvmerge(1) to create a meta seek element at the end of the
163           file containing all clusters. See also the section about the
164           Matroska(TM) file layout.
165
166       --disable-lacing
167           Disables lacing for all tracks. This will increase the file's size,
168           especially if there are many audio tracks. This option is not
169           intended for everyday use.
170
171       --enable-durations
172           Write durations for all blocks. This will increase file size and
173           does not offer any additional value for players at the moment.
174
175       --timecode-scale factor
176           Forces the timecode scale factor to factor. Valid values are in the
177           range 1000..10000000 or the special value -1.
178
179           Normally mkvmerge(1) will use a value of 1000000 which means that
180           timecodes and durations will have a precision of 1ms. For files
181           that will not contain a video track but at least one audio track
182           mkvmerge(1) will automatically chose a timecode scale factor so
183           that all timecodes and durations have a precision of one audio
184           sample. This causes bigger overhead but allows precise seeking and
185           extraction.
186
187           If the special value -1 is used then mkvmerge(1) will use sample
188           precision even if a video track is present.
189
190       File splitting, linking and appending (more global options):
191
192       --split specification
193           Splits the output file after a given size or a given time. Please
194           note that tracks can only be split right before a key frame. Due to
195           buffering mkvmerge(1) will split right before the next key frame
196           after the split point has been reached. Therefore the split point
197           may be a bit off from what the user has specified.
198
199           At the moment mkvmerge(1) supports three different modes.
200
201            1. Splitting by size.
202
203               Syntax: --split [size:]d[k|m|g]
204
205               Examples: --split size:700m or --split 150000000
206
207               The parameter d may end with 'k', 'm' or 'g' to indicate that
208               the size is in KB, MB or GB respectively. Otherwise a size in
209               Bytes is assumed. After the current output file has reached
210               this size limit a new one will be started.
211
212               The 'size:' prefix may be omitted for compatibility reasons.
213
214            2. Splitting after a duration.
215
216               Syntax: --split [duration:]HH:MM:SS.nnnnnnnnn|ds
217
218               Examples: --split duration:00:60:00.000 or --split 3600s
219
220               The parameter must either have the form HH:MM:SS.nnnnnnnnn for
221               specifying the duration in up to nano-second precision or be a
222               number d followed by the letter 's' for the duration in
223               seconds.  HH is the number of hours, MM the number of minutes,
224               SS the number of seconds and nnnnnnnnn the number of
225               nanoseconds. Both the number of hours and the number of
226               nanoseconds can be omitted. There can be up to nine digits
227               after the decimal point. After the duration of the contents in
228               the current output has reached this limit a new output file
229               will be started.
230
231               The 'duration:' prefix may be omitted for compatibility
232               reasons.
233
234            3. Splitting after specific timecodes.
235
236               Syntax: --split timecodes:A[,B[,C...]]
237
238               Example: --split timecodes:00:45:00.000,01:20:00.250,6300s
239
240               The parameters A, B, C etc must all have the same format as the
241               ones used for the duration (see above). The list of timecodes
242               is separated by commas. After the input stream has reached the
243               current split point's timecode a new file is created. Then the
244               next split point given in this list is used.
245
246               The 'timecodes:' prefix must not be omitted.
247
248           For this splitting mode the output filename is treated differently
249           than for the normal operation. It may contain a printf like
250           expression '%d' including an optional field width, e.g. '%02d'. If
251           it does then the current file number will be formatted
252           appropriately and inserted at that point in the filename. If there
253           is no such pattern then a pattern of '-%03d' is assumed right
254           before the file's extension: '-o output.mkv' would result in
255           'output-001.mkv' and so on. If there's no extension then '-%03d'
256           will be appended to the name.
257
258       --link
259           Link files to one another when splitting the output file. See the
260           section on file linking below for details.
261
262       --link-to-previous segment-UID
263           Links the first output file to the segment with the segment UID
264           given by the segment-UID parameter. See the section on file linking
265           below for details.
266
267       --link-to-next segment-UID
268           Links the last output file to the segment with the segment UID
269           given by the segment-UID parameter. See the section on file linking
270           below for details.
271
272       --append-mode mode
273           Determines how timecodes are calculated when appending files. The
274           parameter mode can have two values: 'file' which is also the
275           default and 'track'.
276
277           When mkvmerge appends a track (called 'track2_1' from now on) from
278           a second file (called 'file2') to a track (called 'track1_1') from
279           the first file (called 'file1') then it has to offset all timecodes
280           for 'track2_1' by an amount. For 'file' mode this amount is the
281           highest timecode encountered in 'file1' even if that timecode was
282           from a different track than 'track1_1'. In track mode the offset is
283           the highest timecode of 'track1_1'.
284
285           Unfortunately mkvmerge cannot detect which mode to use reliably.
286           Therefore it defaults to 'file' mode. 'file' mode usually works
287           better for files that have been created independently of each
288           other; e.g. when appending AVI or MP4 files. 'track' mode may work
289           better for sources that are essentially just parts of one big file,
290           e.g. for VOB and EVO files.
291
292           Subtitle tracks are always treated as if 'file' mode were active
293           even if 'track' mode actually is.
294
295       --append-to SFID1:STID1:DFID1:DTID1[,...]
296           This option controls to which track another track is appended. Each
297           spec contains four IDs: a file ID, a track ID, a second file ID and
298           a second track ID. The first pair, "source file ID" and "source
299           track ID", identifies the track that is to be appended. The second
300           pair, "destination file ID" and "destination track ID", identifies
301           the track the first one is appended to.
302
303           If this option has been omitted then a standard mapping is used.
304           This standard mapping appends each track from the current file to a
305           track from the previous file with the same track ID. This allows
306           for easy appending if a movie has been split into two parts and
307           both file have the same number of tracks and track IDs with the
308           command mkvmerge -o output.mkv part1.mkv +part2.mkv.
309
310       +
311           A single '+' causes the next file to be appended instead of added.
312           The '+' can also be put in front of the next file name. Therefore
313           the following two commands are equivalent:
314
315               $ mkvmerge -o full.mkv file1.mkv + file2.mkv
316               $ mkvmerge -o full.mkv file1.mkv +file2.mkv
317
318
319       +
320           Normally mkvmerge looks for files in the same directory as an input
321           file that have the same base name and only differ in their running
322           number (e.g. 'VTS_01_1.VOB', 'VTS_01_2.VOB', 'VTS_01_3.VOB' etc).
323           This option, a single '=', causes mkvmerge not to look for those
324           additional files.
325
326           The '=' can also be put in front of the next file name. Therefore
327           the following two commands are equivalent:
328
329               $ mkvmerge -o full.mkv = file1.mkv
330               $ mkvmerge -o full.mkv =file1.mkv
331
332
333       Attachment support (more global options):
334
335       --attachment-description description
336           Plain text description of the following attachment. Applies to the
337           next --attach-file or --attach-file-once option.
338
339       --attachment-mime-type MIME type
340
341           MIME type of the following attachment. Applies to the next
342           --attach-file or --attach-file-once option. A list of officially
343           recognized MIME types can be found e.g. at the IANA homepage[2].
344           The MIME type is mandatory for an attachment.
345
346       --attachment-name name
347           Sets the name that will be stored in the output file for this
348           attachment. If this option is not given then the name will be
349           derived from the file name of the attachment as given with the
350           --attach-file or the --attach-file-once option.
351
352       --attach-file file-name, --attach-file-once file-name
353           Creates a file attachment inside the Matroska(TM) file. The MIME
354           type must have been set before this option can used. The difference
355           between the two forms is that during splitting the files attached
356           with --attach-file are attached to all output files while the ones
357           attached with --attach-file-once are only attached to the first
358           file created. If splitting is not used then both do the same.
359
360
361           mkvextract(1) can be used to extract attached files from a
362           Matroska(TM) file.
363
364       Options that can be used for each input file:
365
366       -a, --audio-tracks n,m,...
367           Copy the audio tracks n, m etc. The numbers are track IDs which can
368           be obtained with the --identify switch. They're not simply the
369           track numbers (see section track IDs). Default: copy all audio
370           tracks.
371
372       -d, --video-tracks n,m,...
373           Copy the video tracks n, m etc. The numbers are track IDs which can
374           be obtained with the --identify switch. They're not simply the
375           track numbers (see section track IDs). Default: copy all video
376           tracks.
377
378       -s, --subtitle-tracks n,m,...
379           Copy the subtitle tracks n, m etc. The numbers are track IDs which
380           can be obtained with the --identify switch. They're not simply the
381           track numbers (see section track IDs). Default: copy all subtitle
382           tracks.
383
384       -b, --button-tracks n,m,...
385           Copy the button tracks n, m etc. The numbers are track IDs which
386           can be obtained with the --identify switch. They're not simply the
387           track numbers (see section track IDs). Default: copy all button
388           tracks.
389
390       --track-tags n,m,...
391           Copy the tags for tracks n, m etc. The numbers are track IDs which
392           can be obtained with the --identify switch (see section track IDs).
393           They're not simply the track numbers. Default: copy tags for all
394           tracks.
395
396       -m, --attachments n[:all|first],m[:all|first],...
397           Copy the attachments with the IDs n, m etc to all or only the first
398           output file. Each ID can be followed by either ':all' (which is the
399           default if neither is entered) or ':first'. If splitting is active
400           then those attachments whose IDs are specified with ':all' are
401           copied to all of the resulting output files while the others are
402           only copied into the first output file. If splitting is not active
403           then both variants have the same effect.
404
405           The default is to copy all attachments to all output files.
406
407       -A, --no-audio
408           Don't copy any audio track from this file.
409
410       -D, --no-video
411           Don't copy any video track from this file.
412
413       -S, --no-subtitles
414           Don't copy any subtitle track from this file.
415
416       -B, --no-buttons
417           Don't copy any button track from this file.
418
419       -T, --no-track-tags
420           Don't copy any track specific tags from this file.
421
422       --no-chapters
423           Don't copy chapters from this file.
424
425       -M, --no-attachments
426           Don't copy attachments from this file.
427
428       --no-global-tags
429           Don't copy global tags from this file.
430
431       --chapter-charset character-set
432           Sets the charset that is used for the conversion to UTF-8 for
433           chapter information contained in the source file. See the section
434           about text files and character sets for an explanation how
435           mkvmerge(1) converts between character sets.
436
437       --chapter-language language-code
438           Sets the ISO639-2 language code that is written for each chapter
439           entry. This option can be used for source files that contain
440           chapters but no information about the chapters' languages, e.g. for
441           MP4 and OGM files.
442
443       -y, --sync TID:d[,o[/p]]
444           Adjust the timecodes of the track with the id TID by d ms. The
445           track IDs are the same as the ones given with --identify (see
446           section track IDs).
447
448
449           o/p: adjust the timestamps by o/p to fix linear drifts.  p defaults
450           to 1 if omitted. Both o and p can be floating point numbers.
451
452           Defaults: no manual sync correction (which is the same as d = 0 and
453           o/p = 1.0).
454
455           This option can be used multiple times for an input file applying
456           to several tracks by selecting different track IDs each time.
457
458       --cues TID:none|iframes|all
459           Controls for which tracks cue (index) entries are created for the
460           given track (see section track IDs). 'none' inhibits the creation
461           of cue entries. For 'iframes' only blocks with no backward or
462           forward references ( = I frames in video tracks) are put into the
463           cue sheet. 'all' causes mkvmerge(1) to create cue entries for all
464           blocks which will make the file very big.
465
466           The default is 'iframes' for video tracks and 'none' for all
467           others. See also option --no-cues which inhibits the creation of
468           cue entries regardless of the --cues options used.
469
470           This option can be used multiple times for an input file applying
471           to several tracks by selecting different track IDs each time.
472
473       --default-track TID[:bool]
474           Sets the 'default' flag for the given track (see section track IDs)
475           if the optional argument bool is not present. If the user does not
476           explicitly select a track himself then the player should prefer the
477           track that has his 'default' flag set. Only one track of each kind
478           (audio, video, subtitles, buttons) can have his 'default' flag set.
479           If the user wants no track to have the default track flag set then
480           he has to set bool to 0 for all tracks.
481
482           This option can be used multiple times for an input file applying
483           to several tracks by selecting different track IDs each time.
484
485       --forced-track TID[:bool]
486           Sets the 'forced' flag for the given track (see section track IDs)
487           if the optional argument bool is not present. A player must play
488           all tracks for which this flag is set to 1.
489
490           This option can be used multiple times for an input file applying
491           to several tracks by selecting different track IDs each time.
492
493       --blockadd TID:level
494           Keep only the BlockAdditions up to the level level for the given
495           track. The default is to keep all levels. This option only affects
496           certain kinds of codecs like WAVPACK4.
497
498       --track-name TID:name
499           Sets the track name for the given track (see section track IDs) to
500           name.
501
502       --language TID:language
503           Sets the language for the given track (see section track IDs). Both
504           ISO639-2 language codes and ISO639-1 country codes are allowed. The
505           country codes will be converted to language codes automatically.
506           All languages including their ISO639-2 codes can be listed with the
507           --list-languages option.
508
509           This option can be used multiple times for an input file applying
510           to several tracks by selecting different track IDs each time.
511
512       -t, --tags TID:file-name
513           Read tags for the track with the number TID from the file
514           file-name. See the section about tags below for details.
515
516       --aac-is-sbr TID[:0|1]
517           Tells mkvmerge(1) that the track with the ID TID is SBR AAC (also
518           known as HE-AAC or AAC+). This options is needed if a) the source
519           file is an AAC file (not for a Matroska(TM) file) and b) the AAC
520           file contains SBR AAC data. The reason for this switch is that it
521           is technically impossible to automatically tell normal AAC data
522           from SBR AAC data without decoding a complete AAC frame. As there
523           are several patent issues with AAC decoders mkvmerge(1) will never
524           contain this decoding stage. So for SBR AAC files this switch is
525           mandatory. The resulting file might not play back correctly or even
526           not at all if the switch was omitted.
527
528           If the source file is a Matroska(TM) file then the CodecID should
529           be enough to detect SBR AAC. However, if the CodecID is wrong then
530           this switch can be used to correct that.
531
532           If mkvmerge wrongfully detects that an AAC file is SBR then you can
533           add ':0' to the track ID.
534
535       --timecodes TID:file-name
536           Read the timecodes to be used for the specific track ID from
537           file-name. These timecodes forcefully override the timecodes that
538           mkvmerge(1) normally calculates. Read the section about external
539           timecode files.
540
541       --default-duration TID:x
542           Forces the default duration of a given track to the specified
543           value. Also modifies the track's timecodes to match the default
544           duration. The argument x must be postfixed with 's', 'ms', 'us',
545           'ns' or 'fps' to specify the default duration in seconds,
546           milliseconds, microseconds, nanoseconds or 'frames per second'
547           respectively. The number x itself can be a floating point number or
548           a fraction.
549
550           If the default duration is not forced then mkvmerge will try to
551           derive the track's default duration from the container and/or codec
552           used. One case in which this option is of use is when adding
553           AVC/h.264 elementary streams because these do not contain
554           information about their number of frames or a default duration for
555           each frame. For such files mkvmerge(1) will assume a default
556           duration of '25fps' unless overridden.
557
558           This option can also be used to change the FPS of video tracks
559           without having to use an external timecode file.
560
561       --nalu-size-length TID:n
562           Forces the NALU size length to n bytes. This parameter is only used
563           if the AVC/h.264 elementary stream packetizer is used. If left out
564           it defaults to 4 bytes, but there are files that contain frames or
565           slices that are all smaller than 65536 bytes. For such files you
566           can use this parameter and decrease the size to 2.
567
568       Options that only apply to video tracks:
569
570       -f, --fourcc TID:FourCC
571           Forces the FourCC to the specified value. Works only for video
572           tracks in the 'MS compatibility mode'.
573
574       --display-dimensions TID:widthxheight
575
576           Matroska(TM) files contain two values that set the display
577           properties that a player should scale the image on playback to:
578           display width and display height. These values can be set with this
579           option, e.g. '1:640x480'.
580
581           Another way to specify the values is to use the --aspect-ratio or
582           the --aspect-ratio-factor option (see below). These options are
583           mutually exclusive.
584
585       --aspect-ratio TID:ratio|width/height
586
587           Matroska(TM) files contain two values that set the display
588           properties that a player should scale the image on playback to:
589           display width and display height. With this option mkvmerge(1) will
590           automatically calculate the display width and display height based
591           on the image's original width and height and the aspect ratio given
592           with this option. The ratio can be given either as a floating point
593           number ratio or as a fraction 'width/height', e.g. '16/9'.
594
595           Another way to specify the values is to use the
596           --aspect-ratio-factor or --display-dimensions options (see above
597           and below). These options are mutually exclusive.
598
599       --aspect-ratio-factor TID:factor|n/d
600           Another way to set the aspect ratio is to specify a factor. The
601           original aspect ratio is first multiplied with this factor and used
602           as the target aspect ratio afterwards.
603
604           Another way to specify the values is to use the --aspect-ratio or
605           --display-dimensions options (see above). These options are
606           mutually exclusive.
607
608       --cropping TID:left,top,right,bottom
609           Sets the pixel cropping parameters of a video track to the given
610           values.
611
612       --stereo-mode TID:n|keyword
613           Sets the stereo mode for the video track with the track ID TID. The
614           mode can either be a number n between 0 and 3 or one of the
615           keywords 'none' (same as n=0), 'right' (same as n=1), 'left' (same
616           as n=2) or 'both' (same as n=3).
617
618       --compression TID:method
619           Selects the compression method to be used for the VobSub track.
620           Note that the player also has to support this method. Valid values
621           are 'none', 'zlib', 'lzo'/'lxo1x', 'bz2'/'bzlib' and
622           'mpeg4_p2'/'mpeg4p2'. The values 'lzo'/'lxo1x' and 'bz2'/'bzlib'
623           are only available if mkvmerge(1) has been compiled with support
624           for the liblzo(TM) respectively bzlib(TM) compression libraries.
625
626           The compression method 'mpeg4_p2'/'mpeg4p2' is a special
627           compression method called 'header removal' that is only available
628           for MPEG4 part 2 video tracks. The other methods are general
629           compression methods that can be used with any type of track.
630
631           The default is 'zlib' compression. This compression method is also
632           the one that most if not all playback applications support. Support
633           for other compression methods other than 'none' is not assured.
634
635       Options that only apply to text subtitle tracks:
636
637       --sub-charset TID:character-set
638           Sets the character set for the conversion to UTF-8 for UTF-8
639           subtitles for the given track ID. If not specified the charset will
640           be derived from the current locale settings. Note that a charset is
641           not needed for subtitles read from Matroska(TM) files or from Kate
642           streams, as these are always stored in UTF-8. See the section about
643           text files and character sets for an explanation how mkvmerge(1)
644           converts between character sets.
645
646           This option can be used multiple times for an input file applying
647           to several tracks by selecting different track IDs each time.
648
649       Other options:
650
651       -i, --identify file-name
652           Will let mkvmerge(1) probe the single file and report its type, the
653           tracks contained in the file and their track IDs. If this option is
654           used then the only other option allowed is the filename.
655
656       -l, --list-types
657           Lists supported input file types.
658
659       --list-languages
660           Lists all languages and their ISO639-2 code which can be used with
661           the --language option.
662
663       --priority priority
664           Sets the process priority that mkvmerge(1) runs with. Valid values
665           are 'lowest', 'lower', 'normal', 'higher' and 'highest'. If nothing
666           is given then 'normal' is used. On Unix like systems mkvmerge(1)
667           will use the nice(2) function. Therefore only the super user can
668           use 'higher' and 'highest'. On Windows all values are useable for
669           every user.
670
671       --command-line-charset character-set
672           Sets the character set to convert strings given on the command line
673           from. It defaults to the character set given by system's current
674           locale. This settings applies to arguments of the following
675           options: --title, --track-name and --attachment-description.
676
677       --output-charset character-set
678           Sets the character set to which strings are converted that are to
679           be output. It defaults to the character set given by system's
680           current locale.
681
682       -r, --redirect-output file-name
683           Writes all messages to the file file-name instead of to the
684           console. While this can be done easily with output redirection
685           there are cases in which this option is needed: when the terminal
686           reinterprets the output before writing it to a file. The character
687           set set with --output-charset is honored.
688
689       --ui-language code
690           Forces the translations for the language code to be used (e.g.
691           'de_DE' for the German translations). It is preferable to use the
692           environment variables LANG, LC_MESSAGES and LC_ALL though. Entering
693           'list' as the code will cause mkvmerge(1) to output a list of
694           available translations.
695
696       @options-file
697           Reads additional command line arguments from the file options-file.
698           Lines whose first non-whitespace character is a hash mark ('#') are
699           treated as comments and ignored. White spaces at the start and end
700           of a line will be stripped. Each line must contain exactly one
701           option. There is no meta character escaping.
702
703           The command line 'mkvmerge -o "my file.mkv" -A "a movie.avi"
704           sound.ogg' could be converted into the following option file:
705
706               # Write to the file "my file.mkv".
707               -o
708               my file.mkv
709               # Only take the video from "a movie.avi".
710               -A
711               a movie.avi
712               sound.ogg
713
714
715       --capabilities
716           Lists information about optional features that have been compiled
717           in and exit. The first line output will be the version information.
718           All following lines contain exactly one word whose presence
719           indicates that the feature has been compiled in. These features
720           are:
721
722           ·   'BZ2' -- the bzlib(TM) compression library. Affects the
723               available compression methods for the --compression option.
724
725           ·   'LZO' -- the lzo(TM) compression library. Affects the available
726               compression methods for the --compression option.
727
728           ·   'FLAC' -- reading raw FLAC files and handling FLAC tracks in
729               other containers, e.g.  Ogg(TM) or Matroska(TM).
730
731       -h, --help
732           Show usage information and exit.
733
734       -V, --version
735           Show version information and exit.
736

USAGE

738       For each file the user can select which tracks mkvmerge(1) should take.
739       They are all put into the file specified with -o. A list of known (and
740       supported) source formats can be obtained with the -l option.
741

EXAMPLES

743       Let's assume you have a file called MyMovie.avi and the audio track in
744       a separate file, e.g. 'MyMovie.wav'. First you want to encode the audio
745       to OggVorbis(TM):
746
747           $ oggenc -q4 -oMyMovie.ogg MyMovie.wav
748
749       After a couple of minutes you can join video and audio:
750
751           $ mkvmerge -o MyMovie-with-sound.mkv MyMovie.avi MyMovie.ogg
752
753       If your AVI already contains an audio track then it will be copied as
754       well (if mkvmerge(1) supports the audio format). To avoid that simply
755       do
756
757           $ mkvmerge -o MyMovie-with-sound.mkv -A MyMovie.avi MyMovie.ogg
758
759       After some minutes of consideration you rip another audio track, e.g.
760       the director's comments or another language to 'MyMovie-add-audio.wav'.
761       Encode it again and join it up with the other file:
762
763           $ oggenc -q4 -oMyMovie-add-audio.ogg MyMovie-add-audio.wav
764           $ mkvmerge -o MM-complete.mkv MyMovie-with-sound.mkv MyMovie-add-audio.ogg
765
766
767       The same result can be achieved with
768
769           $ mkvmerge -o MM-complete.mkv -A MyMovie.avi MyMovie.ogg MyMovie-add-audio.ogg
770
771       Now fire up mplayer(TM) and enjoy. If you have multiple audio tracks
772       (or even video tracks) then you can tell mplayer(TM) which track to
773       play with the '-vid' and '-aid' options. These are 0-based and do not
774       distinguish between video and audio.
775
776       If you need an audio track synchronized you can do that easily. First
777       find out which track ID the Vorbis track has with
778
779           $ mkvmerge --identify outofsync.ogg
780
781       Now you can use that ID in the following command line:
782
783           $ mkvmerge -o goodsync.mkv -A source.avi -y 12345:200 outofsync.ogg
784
785       This would add 200ms of silence at the beginning of the audio track
786       with the ID 12345 taken from 'outofsync.ogg'.
787
788       Some movies start synced correctly but slowly drift out of sync. For
789       these kind of movies you can specify a delay factor that is applied to
790       all timestamps -- no data is added or removed. So if you make that
791       factor too big or too small you'll get bad results. An example is that
792       an episode I transcoded was 0.2 seconds out of sync at the end of the
793       movie which was 77340 frames long. At 29.97fps 0.2 seconds correspond
794       to approx.  6 frames. So I did
795
796           $ mkvmerge -o goodsync.mkv -y 23456:0,77346/77340 outofsync.mkv
797
798       The result was fine.
799
800       The sync options can also be used for subtitles in the same manner.
801
802       For text subtitles you can either use some Windows software (like
803       SubRipper(TM)) or the subrip(TM) package found in transcode(1)'s
804       sources in the 'contrib/subrip' directory. The general process is:
805
806        1. extract a raw subtitle stream from the source:
807
808               $ tccat -i /path/to/copied/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o mymovie
809
810        2. convert the resulting PGM images to text with gocr:
811
812               $ pgm2txt mymovie
813
814        3. spell-check the resulting text files:
815
816               $ ispell -d american *txt
817
818        4. convert the text files to a SRT file:
819
820               $ srttool -s -w -i mymovie.srtx -o mymovie.srt
821
822       The resulting file can be used as another input file for mkvmerge(1):
823
824           $ mkvmerge -o mymovie.mkv mymovie.avi mymovie.srt
825
826       If you want to specify the language for a given track then this is
827       easily done. First find out the ISO639-2 code for your language.
828       mkvmerge(1) can list all of those codes for you:
829
830           $ mkvmerge --list-languages
831
832       Search the list for the languages you need. Let's assume you have put
833       two audio tracks into a Matroska(TM) file and want to set their
834       language codes and that their track IDs are 2 and 3. This can be done
835       with
836
837           $ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut without-lang-codes.mkv
838
839       As you can see you can use the --language switch multiple times.
840
841       Maybe you'd also like to have the player use the Dutch language as the
842       default language. You also have extra subtitles, e.g. in English and
843       French, and want to have the player display the French ones by default.
844       This can be done with
845
846           $ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut --default-track 3 without-lang-codes.mkv --language 0:eng english.srt --default-track 0 --language 0:fre french.srt
847
848       If you do not see the language or default track flags that you've
849       specified in mkvinfo(1)'s output then please read the section about
850       default values.
851

TRACK IDS

853       Some of the options for mkvmerge(1) need a track ID to specify which
854       track they should be applied to. Those track IDs are printed by the
855       readers when demuxing the current input file, or if mkvmerge(1) is
856       called with the --identify option. An example for such output:
857
858           $ mkvmerge -i v.mkv
859           File 'v.mkv': container: Matroska(TM)
860           Track ID 1: video (V_MS/VFW/FOURCC, DIV3)
861           Track ID 2: audio (A_MPEG/L3)
862
863
864       Track IDs are assigned like this:
865
866       ·    AVI files: The video track has the ID 0. The audio tracks get IDs
867           in ascending order starting at 1.
868
869       ·    AAC, AC3, MP3, SRT and WAV files: The one 'track' in that file
870           gets the ID 0.
871
872       ·   Ogg/OGM files: The track IDs are assigned in order the tracks are
873           found in the file starting at 0.
874
875       ·    Matroska(TM) files: The track's ID is the track number as reported
876           by mkvinfo(1). It is not the track UID.
877
878       The special track ID '-1' is a wild card and applies the given switch
879       to all tracks that are read from an input file.
880
881       The options that use the track IDs are the ones whose description
882       contains 'TID'. The following options use track IDs as well: --atracks,
883       --vtracks, --stracks and --btracks.
884

TEXT FILES AND CHARACTER SET CONVERSIONS

886           Note
887           This section applies to all programs in MKVToolNix even if it only
888           mentions mkvmerge(1).
889
890       All text in a Matroska(TM) file is encoded in UTF-8. This means that
891       mkvmerge(1) has to convert every text file it reads as well as every
892       text given on the command line from one character set into UTF-8. In
893       return this also means that mkvmerge(1)'s output has to be converted
894       back to that character set from UTF-8, e.g. if a non-English
895       translation is used with --ui-language or for text originating from a
896       Matroska(TM) file.
897
898       mkvmerge(1) does this conversion automatically based on the presence of
899       a byte order marker (short: BOM) or the system's current locale. How
900       the character set is inferred from the locale depends on the operating
901       system that mkvmerge(1) is run on.
902
903       Text files that start with a BOM are already encoded in one
904       representation of UTF.  mkvmerge(1) supports the following five modes:
905       UTF-8, UTF-16 Little and Big Endian, UTF-32 Little and Big Endian. Text
906       files with a BOM are automatically converted to UTF-8. Any of the
907       parameters that would otherwise set the character set for such a file
908       (e.g.  --sub-charset) is silently ignored.
909
910       On Unix-like systems mkvmerge(1) uses the setlocale(3) system call
911       which in turn uses the environment variables LANG, LC_ALL and LC_CYPE.
912       The resulting character set is often one of UTF-8 or the ISO-8859-*
913       family and is used for all text file operations and for encoding
914       strings on the command line and for output to the console.
915
916       On Windows there are actually two different character sets that
917       mkvmerge(1) uses due to the way the Windows shell program cmd.exe is
918       implemented. The first character set is determined by a call to the
919       GetCP() system call. This character set is used as the default for text
920       file conversions and for all elements displayed by the GUI programs in
921       the MKVToolNix package.  cmd.exe uses another character set which is
922       determined by a call to the GetACP() system call. This is the default
923       character set for all strings read from the command line and for all
924       strings output to the console.
925
926       The following options exist that allow specifying the character sets:
927
928       ·    --sub-charset for text subtitle files and for text subtitle tracks
929           stored in container formats for which the character set cannot be
930           determined unambiguously (e.g. Ogg files),
931
932       ·    --chapter-charset for chapter text files and for chapters and file
933           titles stored in container formats for which the character set
934           cannot be determined unambiguously (e.g. Ogg files for chapter
935           information, track and file titles etc; MP4 files for chapter
936           information),
937
938       ·    --command-line-charset for all strings on the command line,
939
940       ·    --output-charset for all strings written to the console or to a
941           file if the output has been redirected with the --redirect-output
942           option.
943

SUBTITLES

945       There are several text subtitle formats that can be embedded into
946       Matroska(TM). At the moment mkvmerge(1) supports only text, VobSub and
947       Kate subtitle formats. Text subtitles must be recoded to UTF-8 so that
948       they can be displayed correctly by a player (see the section about text
949       files and character sets for an explanation how mkvmerge(1) converts
950       between character sets). Kate subtitles are already encoded in UTF-8
951       and do not have to be re-encoded.
952
953       The following subtitle formats are supported at the moment:
954
955       ·   Subtitle Ripper (SRT) files
956
957       ·   Substation Alpha (SSA) / Advanced Substation Alpha scripts (ASS)
958
959       ·   OggKate streams
960
961       ·   VobSub bitmap subtitle files
962

FILE LINKING

964       Matroska(TM) supports file linking which simply says that a specific
965       file is the predecessor or successor of the current file. To be
966       precise, it's not really the files that are linked but the Matroska(TM)
967       segments. As most files will probably only contain one Matroska(TM)
968       segment the following explanations use the term 'file linking' although
969       'segment linking' would be more appropriate.
970
971       Each segment is identified by a unique 128 bit wide segment UID. This
972       UID is automatically generated by mkvmerge(1). The linking is done
973       primarily via putting the segment UIDs (short: SID) of the
974       previous/next file into the segment header information.  mkvinfo(1)
975       prints these SIDs if it finds them.
976
977       If a file is split into several smaller ones and linking is used then
978       the timecodes will not start at 0 again but will continue where the
979       last file has left off. This way the absolute time is kept even if the
980       previous files are not available (e.g. when streaming). If no linking
981       is used then the timecodes should start at 0 for each file. By default
982       mkvmerge(1) does not use file linking. If you want that you can turn it
983       on with the --link option. This option is only useful if splitting is
984       activated as well.
985
986       Regardless of whether splitting is active or not the user can tell
987       mkvmerge(1) to link the produced files to specific SIDs. This is
988       achieved with the options --link-to-previous and --link-to-next. These
989       options accept a segment SID in the format that mkvinfo(1) outputs: 16
990       hexadecimal numbers between 0x00 and 0xff prefixed with '0x' each, e.g.
991       '0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 0x5e 0xca
992       0xb3 0x93'. Alternatively a shorter form can be used: 16 hexadecimal
993       numbers between 0x00 and 0xff without the '0x' prefixes and without the
994       spaces, e.g. '41da7366d9cfb21eae78ebb45ecab393'.
995
996       If splitting is used then the first file is linked to the SID given
997       with --link-to-previous and the last file is linked to the SID given
998       with --link-to-next. If splitting is not used then the one output file
999       will be linked to both of the two SIDs.
1000

DEFAULT VALUES

1002       The Matroska(TM) specification states that some elements have a default
1003       value. Usually an element is not written to the file if its value is
1004       equal to its default value in order to save space. The elements that
1005       the user might miss in mkvinfo(1)'s output are the language and the
1006       default track flag elements. The default value for the language is
1007       English ('eng'), and the default value for the default track flag is
1008       true. Therefore if you used --language 0:eng for a track then it will
1009       not show up in mkvinfo(1)'s output.
1010

ATTACHMENTS

1012       Maybe you also want to keep some photos along with your Matroska(TM)
1013       file, or you're using SSA subtitles and need a special TrueType(TM)
1014       font that's really rare. In these cases you can attach those files to
1015       the Matroska(TM) file. They will not be just appended to the file but
1016       embedded in it. A player can then show those files (the 'photos' case)
1017       or use them to render the subtitles (the 'TrueType(TM) fonts' case).
1018
1019       Here's an example how to attach a photo and a TrueType(TM) font to the
1020       output file:
1021
1022           $ mkvmerge -o output.mkv -A video.avi sound.ogg --attachment-description "Me and the band behind the stage in a small get-together" --attachment-mime-type image/jpeg --attach-file me_and_the_band.jpg --attachment-description "The real rare and unbelievably good looking font" --attachment-type application/octet-stream --attach-file really_cool_font.ttf
1023
1024
1025       If a Matroska(TM) containing attachments file is used as an input file
1026       then mkvmerge(1) will copy the attachments into the new file. The
1027       selection which attachments are copied and which are not can be changed
1028       with the options --attachments and --no-attachments.
1029

CHAPTERS

1031       The Matroska(TM) chapter system is more powerful than the old known
1032       system used by OGM files. The full specifications can be found at the
1033       Matroska(TM) website[1].
1034
1035       mkvmerge(1) supports two kinds of chapter files as its input. The first
1036       format, called 'simple chapter format', is the same format that the OGM
1037       tools expect. The second format is a XML based chapter format which
1038       supports all of Matroska(TM)'s chapter functionality.
1039
1040   The simple chapter format
1041       This formmat consists of pairs of lines that start with 'CHAPTERxx='
1042       and 'CHAPTERxxNAME=' respectively. The first one contains the start
1043       timecode while the second one contains the title. Here's an example:
1044
1045           CHAPTER01=00:00:00.000
1046           CHAPTER01NAME=Intro
1047           CHAPTER02=00:02:30.000
1048           CHAPTER02NAME=Baby prepares to rock
1049           CHAPTER03=00:02:42.300
1050           CHAPTER03NAME=Baby rocks the house
1051
1052
1053       mkvmerge(1) will transform every pair or lines into one Matroska(TM)
1054       ChapterAtom. It does not set any ChapterTrackNumber which means that
1055       the chapters all apply to all tracks in the file.
1056
1057       As this is a text file character set conversion may need to be done.
1058       See the section about text files and character sets for an explanation
1059       how mkvmerge(1) converts between character sets.
1060
1061   The XML based chapter format
1062       The XML based chapter format looks like this example:
1063
1064           <?xml version="1.0" encoding="ISO-8859-1"?>
1065           <!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
1066           <Chapters>
1067             <EditionEntry>
1068               <ChapterAtom>
1069                 <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
1070                 <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
1071                 <ChapterDisplay>
1072                   <ChapterString>A short chapter</ChapterString>
1073                   <ChapterLanguage>eng</ChapterLanguage>
1074                 </ChapterDisplay>
1075                 <ChapterAtom>
1076                   <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
1077                   <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
1078                   <ChapterDisplay>
1079                     <ChapterString>A part of that short chapter</ChapterString>
1080                     <ChapterLanguage>eng</ChapterLanguage>
1081                   </ChapterDisplay>
1082                 </ChapterAtom>
1083               </ChapterAtom>
1084             </EditionEntry>
1085           </Chapters>
1086
1087
1088       With this format three things are possible that are not possible with
1089       the simple chapter format:
1090
1091        1. The timestamp for the end of the chapter can be set,
1092
1093        2. chapters can be nested,
1094
1095        3. the language and country can be set.
1096
1097       The mkvtoolnix distribution contains some sample files in the doc
1098       subdirectory which can be used as a basis.
1099
1100   General notes
1101       When splitting files mkvmerge(1) will correctly adjust the chapters as
1102       well. This means that each file only includes the chapter entries that
1103       apply to it, and that the timecodes will be offset to match the new
1104       timecodes of each output file.
1105
1106       mkvmerge(1) is able to copy chapters from Matroska(TM) source files
1107       unless this is explicitly disabled with the --no-chapters option. The
1108       chapters from all sources (Matroska(TM) files, Ogg files, MP4 files,
1109       chapter text files) are usually not merged but end up in separate
1110       ChapterEditions. Only if chapters are read from several Matroska(TM) or
1111       XML files that share the same edition UIDs will chapters be merged into
1112       a single ChapterEdition. If such a merge is desired in other situations
1113       as well then the user has to extract the chapters from all sources with
1114       mkvextract(1) first, merge the XML files manually and mux them
1115       afterwards.
1116

TAGS

1118   Introduction
1119       Matroska(TM) supports an extensive set of tags that is deprecated and a
1120       new, simpler system like it is is used in most other containers:
1121       KEY=VALUE. However, in Matroska(TM) these tags can also be nested, and
1122       both the KEY and the VALUE are elements of their own. The example file
1123       example-tags-2.xml shows how to use this new system.
1124
1125   Scope of the tags
1126       Matroska(TM) tags do not automatically apply to the complete file. They
1127       can, but they also may apply to different parts of the file: to one or
1128       more tracks, to one or more chapters, or even to a combination of both.
1129       The the Matroska(TM) specification[3] gives more details about this
1130       fact.
1131
1132       One important fact is that tags are linked to tracks or chapters with
1133       the Targets Matroska(TM) tag element, and that the UIDs used for this
1134       linking are not the track IDs mkvmerge(1) uses everywhere. Instead the
1135       numbers used are the UIDs which mkvmerge(1) calculates automatically
1136       (if the track is taken from a file format other than Matroska(TM)) or
1137       which are copied from the source file if the track's source file is a
1138       Matroska(TM) file. Therefore it is difficult to know which UIDs to use
1139       in the tag file before the file is handed over to mkvmerge(1).
1140
1141       mkvmerge(1) knows two options with which you can add tags to
1142       Matroska(TM) files: The --global-tags and the --tags options. The
1143       difference is that the former option, --global-tags, will make the tags
1144       apply to the complete file by removing any of those Targets elements
1145       mentioned above. The latter option, --tags, automatically inserts the
1146       UID that mkvmerge(1) generates for the tag specified with the TID part
1147       of the --tags option.
1148
1149   Example
1150       Let's say that you want to add tags to a video track read from an AVI.
1151       mkvmerge --identify file.avi tells you that the video track's ID (do
1152       not mix this ID with the UID!) is 0. So you create your tag file, leave
1153       out all Targets elements and call mkvmerge(1):
1154
1155           $ mkvmerge -o file.mkv --tags 0:tags.xml file.avi
1156
1157
1158   Tag file format
1159       mkvmerge(1) supports a XML based tag file format. The format is very
1160       closely modeled after the Matroska(TM) specification[3]. Both the
1161       binary and the source distributions of MKVToolNix come with a sample
1162       file called example-tags-2.xml which simply lists all known tags and
1163       which can be used as a basis for real life tag files.
1164
1165       The basics are:
1166
1167       ·   The outermost element must be <Tags>.
1168
1169       ·   One logical tag is contained inside one pair of <Tag> XML tags.
1170
1171       ·   White spaces directly before and after tag contents are ignored.
1172
1173   Data types
1174       The new Matroska(TM) tagging system only knows two data types, a UTF-8
1175       string and a binary type. The first is used for the tag's name and the
1176       <String> element while the binary type is used for the <Binary>
1177       element.
1178
1179       As binary data itself would not fit into a XML file mkvmerge(1)
1180       supports two other methods of storing binary data. If the contents of a
1181       XML tag starts with '@' then the following text is treated as a file
1182       name. The corresponding file's content is copied into the Matroska(TM)
1183       element.
1184
1185       Otherwise the data is expected to be Base64 encoded. This is an
1186       encoding that transforms binary data into a limited set of ASCII
1187       characters and is used e.g. in email programs.  mkvextract(1) will
1188       output Base64 encoded data for binary elements.
1189
1190       The deprecated tagging system knows some more data types which can be
1191       found in the official Matroska(TM) tag specs. As mkvmerge(1) does not
1192       support this system anymore these types aren't described here.
1193

MATROSKA(TM) FILE LAYOUT

1195       The Matroska(TM) file layout is quite flexible.  mkvmerge(1) will
1196       render a file in a predefined way. The resulting file looks like this:
1197
1198       [EBML head] [segment {meta seek #1} [segment information] [track
1199       information] {attachments} {chapters} [cluster 1] {cluster 2} ...
1200       {cluster n} {cues} {meta seek #2} {tags}]
1201
1202       The elements in curly braces are optional and depend on the contents
1203       and options used. A couple of notes:
1204
1205       ·   meta seek #1 includes only a small number of level 1 elements, and
1206           only if they actually exist: attachments, chapters, cues, tags,
1207           meta seek #2. Older versions of mkvmerge(1) used to put the
1208           clusters into this meta seek element as well. Therefore some
1209           imprecise guessing was necessary to reserve enough space. It often
1210           failed. Now only the clusters are stored in meta seek #2, and meta
1211           seek #1 refers to the meta seek element #2.
1212
1213       ·   Attachment, chapter and tag elements are only present if they were
1214           added.
1215
1216       The shortest possible Matroska file would look like this:
1217
1218       [EBML head] [segment [segment information] [track information] [cluster
1219       1]]
1220
1221       This might be the case for audio-only files.
1222

EXTERNAL TIMECODE FILES

1224       mkvmerge(1) allows the user to chose the timecodes for a specific track
1225       himself. This can be used in order to create files with variable frame
1226       rate video or include gaps in audio. A frame in this case is the unit
1227       that mkvmerge(1) creates separately per Matroska(TM) block. For video
1228       this is exactly one frame, for audio this is one packet of the specific
1229       audio type. E.g. for AC3 this would be a packet containing 1536
1230       samples.
1231
1232       Timecode files that are used when tracks are appended to each other
1233       must only be specified for the first part in a chain of tracks. For
1234       example if you append two files, v1.avi and v2.avi, and want to use
1235       timecodes then your command line must look something like this:
1236
1237           mkvmerge ... --timecodes 0:my_timecodes.txt v1.avi +v2.avi
1238
1239
1240       There are four formats that are recognized by mkvmerge(1). The first
1241       line always contains the version number. Empty lines, lines containing
1242       only whitespace and lines beginning with '#' are ignored.
1243
1244   Timecode file format v1
1245       This format starts with the version line. The second line declares the
1246       default number of frames per second. All following lines contain three
1247       numbers separated by commas: the start frame (0 is the first frame),
1248       the end frame and the number of frames in this range. The FPS is a
1249       floating point number with the dot '.' as the decimal point. The ranges
1250       can contain gaps for which the default FPS is used. An example:
1251
1252           # timecode format v1
1253           assume 27.930
1254           800,1000,25
1255           1500,1700,30
1256
1257
1258   Timecode file format v2
1259       In this format each line contains a timecode for the corresponding
1260       frame. This timecode must be given in millisecond precision. It can be
1261       a floating point number, but it doesn't have to be. You have to give at
1262       least as many timecode lines as there are frames in the track. The
1263       timecodes in this file must be sorted. Example for 25fps:
1264
1265           # timecode format v2
1266           0
1267           40
1268           80
1269
1270
1271   Timecode file format v3
1272       In this format each line contains a duration in seconds followed by an
1273       optional number of frames per second. Both can be floating point
1274       numbers. If the number of frames per second is not present the default
1275       one is used. For audio you should let the codec calculate the frame
1276       timecodes itself. For that you should be using 0.0 as the number of
1277       frames per second. You can also create gaps in the stream by using the
1278       'gap' keyword followed by the duration of the gap. Example for an audio
1279       file:
1280
1281           # timecode format v3
1282           assume 0.0
1283           25.325
1284           7.530,38.236
1285           gap, 10.050
1286           2.000,38.236
1287
1288
1289   Timecode file format v4
1290       This format is identical to the v2 format. The only difference is that
1291       the timecodes do not have to be sorted. This format should almost never
1292       be used.
1293

EXIT CODES

1295       mkvmerge(1) exits with one of three exit codes:
1296
1297       ·    0 -- This exit codes means that muxing has completed successfully.
1298
1299       ·    1 -- In this case mkvmerge(1) has output at least one warning, but
1300           muxing did continue. A warning is prefixed with the text
1301           'Warning:'. Depending on the issues involved the resulting file
1302           might be ok or not. The user is urged to check both the warning and
1303           the resulting file.
1304
1305       ·    2 -- This exit code is used after an error occurred.  mkvmerge(1)
1306           aborts right after outputting the error message. Error messages
1307           range from wrong command line arguments over read/write errors to
1308           broken files.
1309

SEE ALSO

1311       mkvinfo(1), mkvextract(1), mkvpropedit(1), mmg(1)
1312

WWW

1314       The latest version can always be found at the MKVToolNix homepage[4].
1315

AUTHOR

1317       Moritz Bunkus <moritz@bunkus.org>
1318           Developer
1319

NOTES

1321        1. the Matroska(TM) website
1322           http://www.matroska.org/
1323
1324        2. the IANA homepage
1325           http://www.iana.org/assignments/media-types/
1326
1327        3. the Matroska(TM) specification
1328           http://matroska.org/technical/specs/index.html
1329
1330        4. the MKVToolNix homepage
1331           http://www.bunkus.org/videotools/mkvtoolnix/
1332
1333
1334
1335MKVToolNix 4.4.0                  2010-10-31                       MKVMERGE(1)
Impressum