MKVMERGE(1) MKVMERGE(1) mkvmerge - Matroska(TM) mkvmerge [] {-o } [1] {1} [[2] {2}] [@.json] Matroska(TM)Matroska(TM)[1] -v, --verbose -q, --quiet -o, --output --split -w, --webm WebM "webm" VP8VP9OpusVorbis "webm" mkvmerge(1) --title : --default-language --language The default language code is 'und' for 'undetermined'. () --segmentinfo .xml XMLUIDUIDUIDMKVToolNixDTD XML --segment-uid SID1,SID2,... UIDUID128UIDUID"0x" 3216 SID=UIDMatroska(TM) UIDUIDUIDUIDUID --chapter-language ISO 639-2 'eng' MP4OGM --generate-chapters --chapter-charset UTF-8mkvmerge(1) : OggOGMMP4 --chapter-sync d[,o[/p]] d--syncID-2ID) o/p: o/pp1op : d = 0o/p = 1.0) ID --generate-chapters mkvmerge(1): o when-appending 'parts:' 'parts-frames:' '+' mkvmerge(1) o interval:time-spectime-specHH:MM:SS.nnnnnnnnn's''ms'us : --generate-chapters interval:45s --generate-chapters-name-template--chapter-language--generate-chapters --generate-chapters-name-template --generate-chapters 'Chapter ' '' '' The strings '' and '' are only filled when generating chapters for appended files. They will be replaced by the appended file's name without respectively with its extension. Note that only the file's base name and extension are inserted, not its directory or drive components. >: >%H:%M:%S: o %h - o %H - 2 o %m - o %M - 2 o %s - o %S - 2 o %n - 9 o %<1-9>n - 9: 3%3n --cue-chapter-name-format mkvmerge(1)CUECUEPERFORMERTITLEmkvmerge(1) '%p - %t' o %pPERFORMER o %tTITLE o %n o %N100 --chapters --global-tags --track-order FID1:TID1,FID2:TID2,... ID0ID(FID1)ID(TID1) If this option isn't given, tracks will be sorted by their type first & the order of their source file second. Video tracks come first followed by audio & subtitle tracks. Other rarely used track types come last. --cluster-length specn'ms'd n65535 dmsmkvmerge(1)dd100ms32000ms mkvmerge(1)655355000ms --clusters-in-meta-seek Matroska(TM) --timestamp-scale 100010000000-1 mkvmerge(1)100000011mkvmerge(1)1 -1 --enable-durations --no-cues AVIMatroska(TM)--cues --no-date mkvmerge(1) "date" --disable-lacing --disable-track-statistics-tags Normally mkvmerge(1) will write certain tags with statistics for each track. If such tags are already present then they will be overwritten. The tags are BPS, DURATION, NUMBER_OF_BYTES and NUMBER_OF_FRAMES. Enabling this option prevents mkvmerge(1) from writing those tags and from touching any existing tags with same names. --disable-language-ietf Normally mkvmerge(1) will write the new IETF BCP 47 language elements in addition to the legacy language elements in track headers, chapters and tags. If this option is used, only the legacy elements are written. --normalize-language-ietf mode Enables normalizing all IETF BCP 47 language tags to either their canonical form with mode 'canonical', to their extended language subtags form with mode 'extlang' or turns it off with mode 'off'. By default normalization to the canonical form is applied. In the canonical form all subtags for which preferred values exist are replaced by those preferred values. This converts e.g. 'zh-yue-jyutping' to 'yue-jyutping' or 'fr-FX' to 'fr-FR'. For the extended language subtags form the canonical form is built first. Afterwards all primary languages for which an extended language subtag exists are replaced by that extended language subtag and its prefix. This converts e.g. 'yue-jyutping' back to 'zh-yue-jyutping' but has no effect on 'fr-FR' as 'fr' is not an extended language subtag. --stop-after-video-ends Stops processing after the primary video track ends, discarding any remaining packets of other tracks. --split specification Splits the output file after a given size or a given time. Please note that tracks can only be split right before a key frame. Therefore the split point may be a bit off from what the user has specified. At the moment mkvmerge(1) supports the following modes: 1. : --split [size:]d[k|m|g] : --split size:700m or --split 150000000 d'k''m''g'KBMBGB 'size:' 2. : --split [duration:]HH:MM:SS.nnnnnnnnn|ds : --split duration:00:60:00.000 or --split 3600s HH:MM:SS.nnnnnnnnnd's'HHMMSSnnnnnnnnn9 'duration:' 3. : --split timestamps:A[,B[,C...]] : --split timestamps:00:45:00.000,01:20:00.250,6300s ABC... 'timestamps:' 4. : --split parts:1-1[,[+]2-2[,[+]3-3...]] : 1. --split parts:00:01:20-00:02:45,00:05:50-00:10:30 2. --split parts:00:01:20-00:02:45,+00:05:50-00:10:30 3. --split parts:-00:02:45,00:05:50- The parts mode tells mkvmerge(1) to keep certain ranges of timestamps while discarding others. The ranges to keep have to be listed after the parts: keyword and be separated by commas. A range itself consists of a start and an end timestamp in the same format the other variations of --split accept (e.g. both 00:01:20 and 80s refer to the same timestamp). If a start timestamp is left out then it defaults to the previous range's end timestamp. If there was no previous range then it defaults to the start of the file (see example 3). If an end timestamp is left out then it defaults to the end of the source files which basically tells mkvmerge(1) to keep the rest (see example 3). Normally each range will be written to a new file. This can be changed so that consecutive ranges are written to the same file. For that the user has to prefix the start timestamp with a +. This tells mkvmerge(1) not to create a new file and instead append the range to the same file the previous range was written to. Timestamps will be adjusted so that there will be no gap in the output file even if there was a gap in the two ranges in the input file. In example 1 mkvmerge(1) will create two files. The first will contain the content starting from 00:01:20 until 00:02:45. The second file will contain the content starting from 00:05:50 until 00:10:30. In example 2 mkvmerge(1) will create only one file. This file will contain both the content starting from 00:01:20 until 00:02:45 and the content starting from 00:05:50 until 00:10:30. In example 3 mkvmerge(1) will create two files. The first will contain the content from the start of the source files until 00:02:45. The second file will contain the content starting from 00:05:50 until the end of the source files. Note that mkvmerge(1) only makes decisions about splitting at key frame positions. This applies to both the start and the end of each range. So even if an end timestamp is between two key frames mkvmerge(1) will continue outputting the frames up to but excluding the following key frame. 5. Keeping specific parts by specifying frame/field number ranges while discarding others. Syntax: --split parts-frames:start1-end1[,[+]start2-end2[,[+]start3-end3...]] : 1. --split parts-frames:137-258,548-1211 2. --split parts-frames:733-912,+1592-2730 3. --split parts-frames:-430,2512- The parts-frames mode tells mkvmerge(1) to keep certain ranges of frame/field numbers while discarding others. The ranges to keep have to be listed after the parts-frames: keyword and be separated by commas. A range itself consists of a start and an end frame/field number. Numbering starts at 1. If a start number is left out then it defaults to the previous range's end number. If there was no previous range then it defaults to the start of the file (see example 3). If an end number is left out then it defaults to the end of the source files which basically tells mkvmerge(1) to keep the rest (see example 3). Normally each range will be written to a new file. This can be changed so that consecutive ranges are written to the same file. For that the user has to prefix the start number with a +. This tells mkvmerge(1) not to create a new file and instead append the range to the same file the previous range was written to. Timestamps will be adjusted so that there will be no gap in the output file even if there was a gap in the two ranges in the input file. Note that mkvmerge(1) only makes decisions about splitting at key frame positions. This applies to both the start and the end of each range. So even if an end frame/field number is between two key frames mkvmerge(1) will continue outputting the frames up to but excluding the following key frame. In example 1 mkvmerge(1) will create two files. The first will contain the content starting from the first key frame at or after 137 up to but excluding the first key frame at or after 258. The second file will contain the content starting from 548 until 1211. In example 2 mkvmerge(1) will create only one file. This file will contain both the content starting from 733 until 912 and the content starting from 1592 until 2730. In example 3 mkvmerge(1) will create two files. The first will contain the content from the start of the source files until 430. The second file will contain the content starting from 2512 until the end of the source files. This mode considers only the first video track that is output. If no video track is output no splitting will occur. The numbers given with this argument are interpreted based on the number of Matroska(TM) blocks that are output. A single Matroska(TM) block contains either a full frame (for progressive content) or a single field (for interlaced content). mkvmerge does not distinguish between those two and simply counts the number of blocks. For example: If one wanted to split after the 25th full frame with interlaced content one would have to use 50 (two fields per full frame) as the split point. 6. Splitting after specific frames/fields. Syntax: --split frames:A[,B[,C...]] Example: --split frames:120,237,891 The parameters A, B, C etc must all be positive integers. Numbering starts at 1. The list of frame/field numbers is separated by commas. After the input stream has reached the current split point's frame/field number a new file is created. Then the next split point given in this list is used. frames: This mode considers only the first video track that is output. If no video track is output no splitting will occur. The numbers given with this argument are interpreted based on the number of Matroska(TM) blocks that are output. A single Matroska(TM) block contains either a full frame (for progressive content) or a single field (for interlaced content). mkvmerge does not distinguish between those two and simply counts the number of blocks. For example: If one wanted to split after the 25th full frame with interlaced content one would have to use 50 (two fields per full frame) as the split point. 7. : --split chapters:all--split chapters:A[,B[,C...]] : --split chapters:5,8 A, B, C10 all chapters: The Matroska(TM) file format supports arbitrary deeply nested chapter structures called 'edition entries' and 'chapter atoms'. However, this mode only considers the top-most level of chapters across all edition entries. printf'%d''%02d''-%03d''-o output.mkv''output-001.mkv''-%03d' Another possible pattern is '%c' which will be replaced by the name of the first chapter in the file. Note that when '%c' is present, the pattern '-%03d' will not be added automatically. --link --link-to-previous segment-UID segment-UIDUID SID=UIDMatroska(TM) --link-to-next segment-UID segment-UIDUID SID=UIDMatroska(TM) --append-mode mode mode'file'()'track mkvmerge('file2')('track2_1')('file1')('track1_1')'track2_1''file''file1''track1_1''track''track1_1' mkvmerge'file''file'AVIMP4'track'VOBEVO 'track''file' --append-to SFID1:STID1:DFID1:DTID1[,...] IDIDIDID4IDIDIDIDID IDIDmkvmerge -o output.mkv part1.mkv +part2.mkv + '+''+'2 $ mkvmerge -o full.mkv file1.mkv + file2.mkv $ mkvmerge -o full.mkv file1.mkv +file2.mkv [ file1 file2 ] If multiple file names are contained in a pair of square brackets then the second and all following files will be appended to the first file named within the brackets. This is an alternative syntax to using '+' between the file names. Therefore the following two commands are equivalent: $ mkvmerge -o full.mkv file1.mkv + file2.mkv $ mkvmerge -o full.mkv '[' file1.mkv file2.mkv ']' = For certain file types (MPEG program streams = VOBs) mkvmerge(1) normally looks for files in the same directory as an input file that have the same base name and only differ in their running number (e.g. 'VTS_01_1.VOB', 'VTS_01_2.VOB', 'VTS_01_3.VOB' etc) and treats all of those files as if they were concatenated into a single big file. This option, a single '=', causes mkvmerge not to look for those additional files. '='2 $ mkvmerge -o full.mkv = file1.vob $ mkvmerge -o full.mkv =file1.vob ( file1 file2 ) 1 DVDVOBMPEGAVIMP4 =mkvmerge(1) 2 $ mkvmerge -o out.mkv = file.mkv $ mkvmerge -o out.mkv '(' file.mkv ')' 1. 2. 3. --attachment-description description --attach-file--attach-file-once --attachment-mime-type MIME type MIME--attach-file--attach-file-onceMIMEIANA[2]MIME If no MIME type is given a for an attachment, its type will be detected automatically. --attachment-name name --attach-file--attach-file-once --attach-file file-name, --attach-file-once file-name Matroska(TM)MIME--attach-file--attach-file-once2 mkvextract(1)Matroska(TM) --enable-legacy-font-mime-types Enables the use of legacy MIME types for certain types of font attachments. For example, 'application/x-truetype-font' will be used for TrueType fonts instead of 'fonts/ttf'. This affects both new attachments if its MIME type is detected automatically and existing attachments whose stored MIME types will be remapped to the legacy ones. The affected MIME types are 'font/sfnt', 'font/ttf' and 'font/collection' which are all mapped to 'application/x-truetype-fonts' and 'font/otf' which is mapped to 'application/vnd.ms-opentype'. -a, --audio-tracks [!]n,m,... nm...--identifyIDID: Instead of track IDs you can also provide ISO 639-2 language codes. This will only work for source files that provide language tags for their tracks. Default: copy all tracks of this kind. If the IDs are prefixed with ! then the meaning is reversed: copy all tracks of this kind but the ones listed after the !. -d, --video-tracks [!]n,m,... nm...--identifyIDID: Instead of track IDs you can also provide ISO 639-2 language codes. This will only work for source files that provide language tags for their tracks. If the IDs are prefixed with ! then the meaning is reversed: copy all tracks of this kind but the ones listed after the !. -s, --subtitle-tracks [!]n,m,... nm...--identifyIDID: Instead of track IDs you can also provide ISO 639-2 language codes. This will only work for source files that provide language tags for their tracks. If the IDs are prefixed with ! then the meaning is reversed: copy all tracks of this kind but the ones listed after the !. -b, --button-tracks [!]n,m,... nm...--identifyIDID: Instead of track IDs you can also provide ISO 639-2 language codes. This will only work for source files that provide language tags for their tracks. If the IDs are prefixed with ! then the meaning is reversed: copy all tracks of this kind but the ones listed after the !. --track-tags [!]n,m,... nm...--identifyIDID: ID!!ID -m, --attachments [!]n[:all|first],m[:all|first],... IDnm...ID':all'()':first'':all'ID':first' ID!!ID -A, --no-audio -D, --no-video -S, --no-subtitles -B, --no-buttons -T, --no-track-tags --no-chapters -M, --no-attachments --no-global-tags -y, --sync TID:d[,o[/p]] IDTIDdID--identifyID o/p: o/pp1op : d = 0o/p = 1.0) ID --cues TID:none|iframes|all IDnoneiframesIallmkvmerge(1) The default is 'iframes' for video and subtitle tracks and 'none' for audio tracks. See also option --no-cues which inhibits the creation of cue entries regardless of the --cues options used. ID --default-track-flag TID[:bool] Sets the "default track" flag for the given track (see section track IDs) if the optional argument bool is set to 1 or if it isn't present. The flag will be set if the source container doesn't provide that information and the user doesn't specify it via this option. If the user does not explicitly select a track during playback, the player should select one of the tracks that has its "default track" flag set, taking user preferences such as their preferred language into account. ID --track-enabled-flag TID[:bool] Sets the "track enabled" flag for the given track (see section track IDs) to the given value bool (0 or 1; defaults to 1 if not specified). Tracks are enabled by default if no option is specified for them and the source container doesn't provide this information either. Only tracks whose "track enabled" flag is set should be considered for playback. ID --forced-display-flag TID[:] 1ID ID --hearing-impaired-flag TID[:bool] Sets the "hearing impaired" flag for the given track (see section track IDs) if the optional argument bool is set to 1 or if it isn't present. This flag can be set if the track is suitable for users with hearing impairments. ID --visual-impaired-flag TID[:] bool1ID ID --text-descriptions-flag TID[:] Sets the "text descriptions" flag for the given track (see section track IDs) if the optional argument bool is set to 1 or if it isn't present. This flag can be set if the track contains textual descriptions of video content suitable for playback via a text-to-speech system for a visually-impaired user. ID --original-flag TID[:bool] Sets the "original language" flag for the given track (see section track IDs) if the optional argument bool is set to 1 or if it isn't present. This flag can be set if the track is in the content's original language (not a translation). ID --commentary-flag TID[:bool] Sets the "commentary" flag for the given track (see section track IDs) if the optional argument bool is set to 1 or if it isn't present. This flag can be set if the track contains commentary. ID --track-name TID:name name(ID) --language TID:language (ID)ISO 639-2 ISO 639-1 ISO 639-2 --list-languages ID -t, --tags TID:file-name file-name --aac-is-sbr TID[:0|1] mkvmerge(1)IDTIDSBR AAC (HE-AACAAC+) a) (Matroska(TM))AAC b) AACSBR AACAACSBR AACAACAACmkvmerge(1)SBR AAC Matroska(TM)CodecIDSBR AACCodecID mkvmergeAACSBRID':0' --audio-emphasis TID:n|symbolic-name Sets the emphasis for the audio track with the track ID TID. The mode can either be a number n (certain values between 0 and 16) or a symbolic name. All valid numbers & symbolic names can be listed with the --list-audio-emphasis option. --reduce-to-core TID Some audio codecs have a lossy core and optional extensions that implement lossless decoding. This option tells mkvmerge(1) to only copy the core but not the extensions. By default mkvmerge(1) copies both the core and the extensions. Currently only DTS tracks are affected by this option. TrueHD tracks that contain an embedded AC-3 core are instead presented as two separate tracks for which the user can select which track to copy. For DTS such a scheme would not work as the HD extensions cannot be decoded by themselves - unlike the TrueHD data. --remove-dialog-normalization-gain TID Some audio codecs contain header fields that tell the decoder or player to apply a (usually negative) gain for dialog normalization. This option tells mkvmerge(1) to remove or minimize that gain by modifying the corresponding header fields. Currently only AC-3, DTS and TrueHD tracks are affected by this option. --timestamps TID:file-name IDfile-namemkvmerge(1) --default-duration TID:x default duration default duration x's''ms''us''ns''fps'p''i default duration 'fps'11x mkvmergeAVC/H.264MPEG-2 FPS --fix-bitstream-timing-information TID[:0|1] Normally mkvmerge(1) does not change the timing information (frame/field rate) stored in the video bitstream. With this option that information is adjusted to match the container timing information. The container timing information can come from various sources: from the command line (see option --default-duration), the source container or derived from the bitstream. This has only been implemented for AVC/H.264 video tracks so far. --compression TID:n Selects the compression method to be used for the track. Note that the player also has to support this method. Valid values are 'none', 'zlib' and 'mpeg4_p2'/'mpeg4p2'. 'mpeg4_p2'/'mpeg4p2' MPEG4 part2 'header removal' The default for some subtitle types is 'zlib' compression. This compression method is also the one that most if not all playback applications support. Support for other compression methods other than 'none' is not assured. -f, --fourcc TID:FourCC FourCC'MS' --display-dimensions TID:widthxheight Matroska(TM)'1:640x480' --aspect-ratio--aspect-ratio-factor() --aspect-ratio TID:ratio|width/height Matroska(TM)'1:640x480'mkvmerge(1)ratio'width/height'(: '16/9') --aspect-ratio-factor--display-dimensions() --aspect-ratio-factor TID:factor|n/d factor --aspect-ratio--display-dimensions() --cropping TID:left,top,right,bottom --color-matrix-coefficients TID:n Sets the matrix coefficients of the video used to derive luma and chroma values from red, green and blue color primaries. The parameter n is an integer rangeing from 0 and 10. Valid values and their meaning are: 0: GBR, 1: BT709, 2: unspecified, 3: reserved, 4: FCC, 5: BT470BG, 6: SMPTE 170M, 7: SMPTE 240M, 8: YCOCG, 9: BT2020 non-constant luminance, 10: BT2020 constant luminance --color-bits-per-channel TID:n Sets the number of coded bits for a color channel. A value of 0 indicates that the number of bits is unspecified. --chroma-subsample TID:hori,vert The amount of pixels to remove in the Cr and Cb channels for every pixel not removed horizontally/vertically. Example: For video with 4:2:0 chroma subsampling, the parameter should be set to TID:1,1. --cb-subsample TID:hori,vert The amount of pixels to remove in the Cb channel for every pixel not removed horizontally/vertically. This is additive with --chroma-subsample. Example: For video with 4:2:1 chroma subsampling, the parameter --chroma-subsample should be set to TID:1,0 and Cb-subsample should be set to TID:1,0. --chroma-siting TID:hori,vert Sets how chroma is sited horizontally/vertically (0: unspecified, 1: top collocated, 2: half). --color-range TID:n Sets the clipping of the color ranges (0: unspecified, 1: broadcast range, 2: full range (no clipping), 3: defined by MatrixCoefficients/TransferCharacteristics). --color-transfer-characteristics TID:n The transfer characteristics of the video. Valid values and their meaning are: 0: reserved, 1: ITU-R BT.709, 2: unspecified, 3: reserved, 4: gamma 2.2 curve, 5: gamma 2.8 curve, 6: SMPTE 170M, 7: SMPTE 240M, 8: linear, 9: log, 10: log sqrt, 11: IEC 61966-2-4, 12: ITU-R BT.1361 extended color gamut, 13: IEC 61966-2-1, 14: ITU-R BT.2020 10 bit, 15: ITU-R BT.2020 12 bit, 16: SMPTE ST 2084, 17: SMPTE ST 428-1; 18: ARIB STD-B67 (HLG) --color-primaries TID:n Sets the color primaries of the video. Valid values and their meaning are: 0: reserved, 1: ITU-R BT.709, 2: unspecified, 3: reserved, 4: ITU-R BT.470M, 5: ITU-R BT.470BG, 6: SMPTE 170M, 7: SMPTE 240M, 8: FILM, 9: ITU-R BT.2020, 10: SMPTE ST 428-1, 22: JEDEC P22 phosphors --max-content-light TID:n Sets the maximum brightness of a single pixel (Maximum Content Light Level) in candelas per square meter (cd/m^2). The value of n should be a non-negtive integer. --max-frame-light TID:n Sets the maximum brightness of a single full frame (Maximum Frame-Average Light Level) in candelas per square meter (cd/m^2). The value of n should be a non-negtive integer. --chromaticity-coordinates TID:red-x,red-y,green-x,green-y,blue-x,blue-y Sets the red/green/blue chromaticity coordinates as defined by CIE 1931. --white-color-coordinates TID:x,y Sets the white color chromaticity coordinates as defined by CIE 1931. --max-luminance TID:float Sets the maximum luminance in candelas per square meter (cd/m^2). The value should be less than 9999.99. --min-luminance TID:float Sets the minimum luminance in candelas per square meter (cd/m^2). The value should be less than 999.9999. --projection-type TID:method Sets the video projection method used. Valid values are 0 (rectangular projection), 1 (equirectangular projection), 2 (cubemap projection) and 3 (mesh projection). --projection-private TID:data Sets private data that only applies to a specific projection. Data must be given as hex numbers with or without the "0x" prefix, with or without spaces. --projection-pose-yaw TID:float Specifies a yaw rotation to the projection. --projection-pose-pitch TID:float Specifies a pitch rotation to the projection. --projection-pose-roll TID:float Specifies a roll rotation to the projection. --field-order TID:n Sets the field order for the video track with the track ID TID. The order must be one of the following numbers: 0: progressive; 1: interlaced with top field displayed first and top field stored first; 2: undetermined field order; 6: interlaced with bottom field displayed first and bottom field stored first; 9: interlaced with bottom field displayed first and top field stored first; 14: interlaced with top field displayed first and bottom field stored first --stereo-mode TID:n|symbolic-name Sets the stereo mode for the video track with the track ID TID. The mode can either be a number n between 0 and 14 or a symbolic name. All valid numbers & names can be listed with the --list-stereo-modes option. --sub-charset TID:character-set IDUTF-8UTF-8mkvmerge(1) ID -i, --identify file-name mkvmerge(1)ID The output format used for the result can be changed with the option --identification-format. -J file-name This is a convenient alias for "--identification-format json --identify file-name". -F, --identification-format --identify : textjson 1. text mkvmerge(1)--ui-language 2. jsonJSONJSON: mkvmerge-identification-output-schema-v18.json[3] JSONWeb --probe-range-percentage MPEG (.vob, .m2ts) 0.3%10MB 10MB --list-audio-emphasis Lists all valid numbers & their corresponding symbolic names for the --audio-emphasis option. --list-languages --languageISO 639-2 --list-stereo-modes Lists all valid numbers & their corresponding symbolic names for the --stereo-mode option. -l, --list-types --priority mkvmerge(1)'lowest''lower''normal''higher' 'highest''normal'Unixmkvmerge(1)nice(2)'higher' 'highest'Windows 'lowest' mkvmerge(1) --command-line-charset : --title--track-name--attachment-description --output-charset -r, --redirect-output :--output-charset --flush-on-close (flush) mkvmergeMKVToolNix24692480 --ui-language de_DElist --abort-on-warnings 1 --deterministic mkvmerge(1): "data" : 1. mkvmerge(1)libEBMLlibMatroska 2. 3. : --output ... mkvmerge(1) --debug --engage mkvmerge --engage list --gui-mode GUIGUI '#GUI#' '#GUI##1=1#2=2...' @.json options-file --capabilities : o 'FLAC' -- FLAC: Ogg(TM)Matroska(TM)FLAC -h, --help -V, --version mkvmerge(1)-o()-l : 1. --command-line-charset--output--title 2. 111--no-chapters--chapter-charset1--default-duration--language 12"Something else" $ mkvmerge -o output.mkv --title 'This and that' input.avi --title 'Something else' --language2ID $ mkvmerge -o output.mkv --language 0:fre francais.ogg --language 0:deu deutsch.ogg MyMovie.avi 'MyMovie.wav'OggVorbis(TM) $ oggenc -q4 -oMyMovie.ogg MyMovie.wav $ mkvmerge -o MyMovie-with-sound.mkv MyMovie.avi MyMovie.ogg AVImkvmerge(1) $ mkvmerge -o MyMovie-with-sound.mkv -A MyMovie.avi MyMovie.ogg ()'MyMovie-add-audio.wav $ oggenc -q4 -oMyMovie-add-audio.ogg MyMovie-add-audio.wav $ mkvmerge -o MM-complete.mkv MyMovie-with-sound.mkv MyMovie-add-audio.ogg $ mkvmerge -o MM-complete.mkv -A MyMovie.avi MyMovie.ogg MyMovie-add-audio.ogg mplayer(TM)()'-vid''-aid'mplayer(TM)ID VorbisID $ mkvmerge --identify outofsync.ogg ID $ mkvmerge -o goodsync.mkv -A source.avi -y 12345:200 outofsync.ogg 'outofsync.ogg'ID 12345 200ms 773400.229.97fps0.26 $ mkvmerge -o goodsync.mkv -y 23456:0,77346/77340 outofsync.mkv SubRipper(TM)Windowstranscode(1)contrib/subrip'subrip(TM) 1. : $ tccat -i /path/to/copied/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o mymovie 2. PGMgocr: $ pgm2txt mymovie 3. : $ ispell -d american *txt 4. SRT: $ srttool -s -w -i mymovie.srtx -o mymovie.srt mkvmerge(1): $ mkvmerge -o mymovie.mkv mymovie.avi mymovie.srt ISO 639-2mkvmerge(1) $ mkvmerge --list-languages Matroska(TM)ID23 $ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut without-lang-codes.mkv --language $ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut --default-track-flag 3 without-lang-codes.mkv --language 0:eng english.srt --default-track-flag 0 --language 0:fre french.srt mkvinfo(1) $ mkvmerge -o no-compression.mkv --compression -1:none MyMovie.avi --compression -1:none mymovie.srt ID Regular track IDs mkvmerge(1)IDIDdemuxmkvmerge(1)--identify $ mkvmerge -i v.mkv File 'v.mkv': container: Matroska(TM) Track ID 0: video (V_MS/VFW/FOURCC, DIV3) Track ID 1: audio (A_MPEG/L3) MKVIDIDID ID'mkvmerge --identify''file1.ext'ID'file1.ext' ID: o AVI: ID0ID1 o AACAC-3MP3SRTWAV: ID 0 o ID0 ID'TID'--audio-tracks--video-tracks--subtitle-tracks--button-tracks--track-tagsID ID ID ID '-1' ID '-2' --syncID--sync -2:...--chapter-sync ... LANGUAGE HANDLING Matroska(TM) has support for two different types of language elements: the old, deprecated "Language" element containing ISO 639-2 alpha 3 codes and the new "LanguageIETF" tags containing IETF BCP 47 language tags. All of mkvmerge(1)'s options that accept a language accept a BCP 47 language tag. mkvmerge(1) will derive the value for the deprecated "Language" element from the BCP 47 language tags wherever possible. When identifying a file in JSON mode, existing "LanguageIETF" track header elements will be output as the language_ietf track property. When writing a file mkvmerge(1) will always write the "LanguageIETF", "ChapLanguageIETF" and "TagLanguageIETF" elements (the latter two only if chapters or tags are written respectively). In addition to those elements the corresponding old elements will be written; they'll be set to the ISO 639-2 code portion of the BCP 47 language tag. For example, when the track language is set to sr-Cyrl-RS "LanguageIETF" will be set to sr-Cyrl-RS and the old "Language" element will be set to srp. When reading existing files (Matroska files, XML chapter or tag files etc.) that already contain "...LanguageIETF" elements the existing elements will be kept. Otherwise "...LanguageIETF" elements will be added based on command-line options and other existing deprecated "...Language" elements. The creation of the new elements can be disabled completely with the command-line option --disable-language-ietf which operates on all three new elements. You can chose the normalization method applied to extended language sub-tags with the parameter --normalize-language-ietf. mkvmerge(1)MKVToolNix Matroska(TM)UTF-8mkvmerge(1)UTF-8mkvmerge(1)--ui-languageMatroska(TM)UTF-8 mkvmerge(1)(BOM)mkvmerge(1) (BOM) BOMUTFmkvmerge(1)UTF-8UTF-16UTF-32BOMUTF-8(: --sub-charset) LinuxmacOSUnix UNIXmkvmerge(1)setlocale(3)LANGLC_ALLLC_CYPEUTF-8ISO-8859-* Windows WindowsGetACP() Reading the command line is done with the GetCommandLineW() function which already returns a Unicode string. Therefore the option --command-line-charset is ignored on Windows. Output to the console consists of three scenarios: 1. If the output is redirected with the option --redirect-output then the default charset is UTF-8. This can be changed with --output-charset. 2. If the output is redirected with cmd.exe itself, e.g. with mkvinfo file.mkv > info.txt, then the charset is always UTF-8 and cannot be changed. 3. Otherwise (when writing directly to the console) the Windows function WriteConsoleW() is used and the option --output-charset is ignored. The console should be able to output all Unicode characters for which the corresponding language support is installed (e.g. Chinese characters might not be displayed on English Windows versions). Command line options o --sub-charset(: Ogg) o --chapter-charset(: OggMP4) o --command-line-charset o --output-charset for all strings written to the console or to a file if the output has been redirected with the --redirect-output option. On non-Windows systems the default for the output charset is the system's current charset. On Windows it defaults to UTF-8 both for redirecting with --redirect-output and with cmd.exe itself, e.g. mkvinfo file.mkv > info.txt. mkvmerge(1) An option file contains JSON-formatted data. Its content must be a valid JSON array consisting solely of JSON strings. The file's encoding must be UTF-8. The file should not start with a byte order marker (BOM), but if one exists, it will be skipped. The rules for escaping special characters inside JSON are the ones in the official JSON specification, RFC 7159[4]. The option file's name itself must be specified as a command line argument prefixed with a '@' character. The command line 'mkvmerge -o "my file.mkv" -A "a movie.avi" sound.ogg' could be converted into the following JSON option file called e.g. 'options.json': [ "-o", "c:\\Matroska\\my file.mkv", "--title", "#65", "-A", "a movie.avi", "sound.ogg" ] The corresponding command would then be 'mkvmerge @options.json'. Matroska(TM)Matroska(TM)Matroska(TM)'''' 128-bitUIDUIDmkvmerge(1)UID(SID)mkvinfo(1)SID 0(: )0mkvmerge(1)--link mkvmerge(1)SID--link-to-previous--link-to-nextmkvinfo(1)(160x000xff'0x'16)SID(: '0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 0x5e 0xca 0xb3 0x93')'0x'0x000xff16: '41da7366d9cfb21eae78ebb45ecab393' --link-to-previousSID--link-to-nextSIDSID Matroska(TM)mkvinfo(1)('eng')true--language: 0:engmkvinfo(1) Matroska(TM)SSATrueType(TM)Matroska(TM)Matroska(TM)()() TrueType(TM) $ 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-mime-type application/octet-stream \ --attach-file really_cool_font.ttf Matroska(TM)mkvmerge(1)--attachments--no-attachments Matroska(TM)OGMMatroska(TM)[5] mkvmerge(1)2''OGM toolsXMLMatroska(TM) Apart from dedicated chapter files mkvmerge(1) can also read chapters from other file formats (e.g. MP4, Ogg, Blu-rays or DVDs). 'CHAPTERxx=''ChapterxxNAME=' CHAPTER01=00:00:00.000 CHAPTER01NAME=Intro CHAPTER02=00:02:30.000 CHAPTER02NAME=Baby prepares to rock CHAPTER03=00:02:42.300 CHAPTER03NAME=Baby rocks the house mkvmerge(1) will transform every pair or lines into one Matroska(TM) ChapterAtom. It does not set any ChapterTrackNumber which means that all chapters apply to all tracks in the file. mkvmerge(1) XML XML 00:00:30.000 00:01:20.000 A short chapter eng 00:00:46.000 00:01:10.000 A part of that short chapter eng 3 1. 2. 3. mkvtoolnixdoc XML Chapters (master) EditionEntry (master) EditionUID (unsigned integer, valid range: 1 <= value) EditionFlagHidden (unsigned integer, valid range: 0 <= value <= 1) EditionFlagDefault (unsigned integer, valid range: 0 <= value <= 1) EditionFlagOrdered (unsigned integer, valid range: 0 <= value <= 1) ChapterAtom (master) ChapterAtom (master) ChapterUID (unsigned integer, valid range: 1 <= value) ChapterTimeStart (unsigned integer) ChapterTimeEnd (unsigned integer) ChapterFlagHidden (unsigned integer, valid range: 0 <= value <= 1) ChapterFlagEnabled (unsigned integer, valid range: 0 <= value <= 1) ChapterSegmentUID (binary, valid range: 1 <= length in bytes) ChapterSegmentEditionUID (unsigned integer, valid range: 1 <= value) ChapterPhysicalEquiv (unsigned integer) ChapterTrack (master) ChapterTrackNumber (unsigned integer, valid range: 1 <= value) ChapterDisplay (master) ChapterString (UTF-8 string) ChapterLanguage (UTF-8 string) ChapterCountry (UTF-8 string) ChapterProcess (master) ChapterProcessCodecID (unsigned integer) ChapterProcessPrivate (binary) ChapterProcessCommand (master) ChapterProcessTime (unsigned integer) ChapterProcessData (binary) Reading chapters from Blu-rays mkvmerge(1) can read chapters from unencrypted Blu-rays. For that you can use the path to one of the MPLS play lists with the --chapters parameter. Example: --chapters /srv/blurays/BigBuckBunny/BDMV/PLAYLIST/00001.mpls Reading chapters from DVDs When MKVToolNix is compiled with the libdvdread(TM) library, mkvmerge(1) can read chapters from DVDs. For that you can use the path to one of the folders or files on the DVD with the --chapters parameter. As DVDs can contain more than one title and each title has its own set of chapters, you can append a colon and the desired title number to the end of the file name argument. The title number defaults to 1. Example: --chapters /srv/dvds/BigBuckBunny/VIDEO_TS:2 mkvmerge(1) mkvmerge(1)--no-chaptersMatroska(TM)Matroska(TM)OggMP4ChapterEditionsUIDMatroska(TM)XMLChapterEditionmkvextract(1)XML Matroska(TM)'s tag system is similar to that of other containers: a set of KEY=VALUE pairs. However, in Matroska(TM) these tags can also be nested, and both the KEY and the VALUE are elements of their own. The example file example-tags-2.xml shows how to use this system. Matroska(TM)Matroska(TM)[6] TargetsMatroska(TM)UIDmkvmerge(1)IDMatroska(TM)UIDMatroska(TM)UIDmkvmerge(1)UID mkvmerge(1)Matroska(TM)--global-tags--tags--global-tagsTargets--tagsmkvmerge(1) of the --tagsTIDUID AVImkvmerge --identify file.aviID(IDUID!)0Targetsmkvmerge(1) $ mkvmerge -o file.mkv --tags 0:tags.xml file.avi mkvmerge(1)XMLMatroska(TM)[6]MKVToolNixexample-tags-2.xml o o XML o Matroska(TM)UTF-8 XMLmkvmerge(1)XML@Matroska(TM) Base64ASCIIEmkvextract(1)Base64 Matroska(TM)mkvmerge(1) XML XML Tags (master) Tag (master) Targets (master) TargetTypeValue (unsigned integer) TargetType (UTF-8 string) TrackUID (unsigned integer) EditionUID (unsigned integer) ChapterUID (unsigned integer) AttachmentUID (unsigned integer) Simple (master) Simple (master) Name (UTF-8 string) TagLanguage (UTF-8 string) DefaultLanguage (unsigned integer) String (UTF-8 string) Binary (binary) Matroska(TM)XML XML--title--timestamp-scale XMLDateUTC "muxing date"MuxingAppWritingAppDurationmkvmerge(1) XML Info () SegmentUID (: 16) SegmentFilename (UTF-8) PreviousSegmentUID (: 16) PreviousSegmentFilename (UTF-8) NextSegmentUID (: 16) NextSegmentFilename (UTF-8) SegmentFamily (: 16) ChapterTranslate () ChapterTranslateEditionUID () ChapterTranslateCodec () ChapterTranslateID () MATROSKA(TM) Matroska(TM)mkvmerge(1): [EBML] [ {#1} [] [] {} {} [ 1] { 2} ... { n} {} {#2} {}] o #11#2mkvmerge(1)#2#1#2 o The shortest possible Matroska(TM) file would look like this: [EBML] [ [] [] [1]] mkvmerge(1)Matroska(TM)11AC-315361 v1.aviv2.avi $ mkvmerge ... --timestamps 0:my_timestamps.txt v1.avi +v2.avi mkvmerge(1)41'#' v1 23(0)FPS'.'FPS # timestamp format v1 assume 27.930 800,1000,25 1500,1700,30 v2 25fps # timestamp format v2 0 40 80 v3 0.0'gap' # timestamp format v3 assume 0.0 25.325 7.530,38.236 gap, 10.050 2.000,38.236 v4 v2 mkvmerge(1)3 o 0 -- MUX o 1 -- ':' o 2 -- mkvmerge(1)I/O mkvmerge(1)LANGLC_* MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG and its short form MTX_DEBUG --debug MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE and its short form MTX_ENGAGE --engage mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) MKVToolNix[7] Bunkus Moritz[FAMILY Given] 1. Matroska(TM) https://www.matroska.org/ 2. IANA https://www.iana.org/assignments/media-types/ 3. mkvmerge-identification-output-schema-v18.json https://mkvtoolnix.download/doc/mkvmerge-identification-output- schema-v18.json 4. RFC 7159 https://tools.ietf.org/html/rfc7159 5. Matroska(TM) https://www.matroska.org 6. Matroska(TM) https://www.matroska.org/technical/specs/index.html 7. MKVToolNix https://mkvtoolnix.download/ MKVToolNix 83.0 2024-03-10 MKVMERGE(1)