mkvmerge(1) mkvmerge - ' Matroska(TM) mkvmerge [global options] {-o out} [options1] {file1} [[options2] {file2}] [@options-file.json] - ' ( ) Matroska(TM); . - Matroska(TM)[1]. . , " ", . -v, --verbose -q, --quiet . -o, --output file-name file-name. , . . --split. -w, --webm , WebM. , "webm". . VP8, VP9 Opus, Vorbis. DocType "webm". . mkvmerge(1) , . --title title , . . --default-language language-code , , --language, . 'und' ' '. ( ) --segmentinfo filename.xml XML. UID, UID, UID. DTD MKVToolNix. . " XML ". --segment-uid SID1,SID2,... UID . 128- UID UID: "0x" , 32 >>. SID "=", ' Matroska, UID . , UID . UID , , UID . UID, , UID. ( ) --chapter-language language-code ISO 639-2, . 'eng'. "" , . , , , , MP4 OGM. , , , --generate-chapters. --chapter-charset character-set , UTF-8 . , , mkvmerge(1) . , , Ogg/OGM MP4. . . --chapter-sync d[,o[/p]] d . , --sync -2 (. ID ). o/p: o/p, . p 1, . o, p . : ( , d = 0 o/p = 1.0). , , . --generate-chapters mode mkvmerge(1) . : o 'when-appending' - , . 'parts:' 'parts-frames:'. (, '+'). mkvmerge(1) , , . , . . o 'interval:time-spec' - , time-spec. HH:MM:SS.nnnnnnnnn , 's', 'ms' 'us'. : --generate-chapters interval:45s --generate-chapters-name-template. --chapter-language, --generate-chapters. --generate-chapters-name-template template , --generate-chapters. , << >>. , , . '' . '' . 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 - , o %m - o %M - , o %s - o %S - , o %n - , ' o %<1-9>n - ' (. %3n) --cue-chapter-name-format format mkvmerge(1) CUE . CUE PERFORMER TITLE . mkvmerge(1) . , . , mkvmerge(1) '%p - %t' (, , , ). , , , , : o %p PERFORMER , o %t TITLE , o %n o %N , , < 10. --chapters file-name file-name. , . --global-tags file-name file-name. . . ( ) --track-order FID1:TID1,FID2:TID2,... , . ID , . ID (FID1), , 0 ID (TID1) . ID , , , . 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 spec . spec n d 'ms'. , mkvmerge(1) n . - 65535. d 'ms', mkvmerge(1) d . d -- '100 ' '32000 '. mkvmerge(1) 65535 5000 . , , , . . --clusters-in-meta-seek mkvmerge(1) - , . Matroska(TM). --timestamp-scale factor factor. 1000..10000000 -1. mkvmerge(1) 1000000, , 1 . , , mkvmerge(1) , . , . -1, mkvmerge(1) , . --enable-durations . . --no-cues mkvmerge(1) cue, AVI. Matroska(TM) cue, , , . , . --cues, . --no-date mkvmerge(1) "" . . --disable-lacing . , . . --disable-track-statistics-tags mkvmerge(1) . , . : BPS, DURATION, NUMBER_OF_BYTES NUMBER_OF_FRAMES. mkvmerge(1) - . --disable-language-ietf mkvmerge(1) IETF BCP 47 , . , . --normalize-language-ietf mode IETF BCP 47 'canonical', 'extlang' 'off'. . , , . , , 'zh-yue-jyutping' 'yue-jyutping' 'fr-FX' 'fr-FR'. . , , . , , 'yue-jyutping' 'zh-yue-jyutping', 'fr-FR', 'fr' . --stop-after-video-ends Stops processing after the primary video track ends, discarding any remaining packets of other tracks. , ', ( ) --split specification . , . , . mkvmerge(1) : 1. . : --split [size:]d[k|m|g] : --split size:700m or --split 150000000 d 'k', 'm' 'g', , , . . , . 'size:' . 2. . : --split [duration:]HH:MM:SS.nnnnnnnnn|ds : --split duration:00:60:00.000 or --split 3600s HH:MM:SS.nnnnnnnn d, 's' . HH - , MM - , SS - nnnnnnnn - . , . ' . , , . 'duration:' . 3. . : --split timestamps:A[,B[,C...]] : --split timestamps:00:45:00.000,01:20:00.250,6300s A, B, C , , (. ). . , , . , . 'timestamps:'. 4. , . : --split parts:start1-end1[,[+]start2-end2[,[+]start3-end3...]] : 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- parts mkvmerge(1) , . , , parts: . , --split (, 00:01:20 80s ). , . , (. 3). , , mkvmerge(1) (. 3). . , . +. mkvmerge(1) , , . , , . 1 mkvmerge(1) . , 00:01:20 00:02:45. , 00:05:50 00:10:30. 2 mkvmerge(1) . , 00:01:20 00:02:45, , 00:05:50 00:10:30. 3 mkvmerge(1) . 00:02:45. , 00:05:50 . , mkvmerge(1) . , . , mkvmerge(1) , . 5. /, . : --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- parts-frames mkvmerge(1) /, . , , parts-frames: . /. 1. , . , (. 3). , , mkvmerge(1) (. 3). . , . +. mkvmerge(1) , , . , , . , mkvmerge(1) . , . , / mkvmerge(1) , . 1 mkvmerge(1) . , 137 258. 548 1211. 2 mkvmerge(1) . , 733 912, , 1592 2730. 3 mkvmerge(1) . 430. , 2512 . , . , . , , Matroska(TM), . Matroska(TM) ( ) ( ). mkvmerge . : 25- , 50 ( ). 6. /. : --split frames:A[,B[,C...]] : --split frames:120,237,891 A, B, C . 1. / . , / , . , . 'frames:'. , . , . , , Matroska(TM), . Matroska(TM) ( ) ( ). mkvmerge . : 25- , 50 ( ). 7. . : --split chapters:all or --split chapters:A[,B[,C...]] : --split chapters:5,8 A, B, C . 1. . , , . , 0s, . all , . 'chapters:' Matroska(TM) , << >> << >>. . ' , . printf, , '%d', ' , . '%02d'. , . , '-%03d': '-o output.mkv' 'output-001.mkv' . , '-%03d'. '%c', . , '%c', '-%03d' . --link ' . . ' --link-to-previous segment-UID ' UID , segment-UID. . ' . SID "=", ' Matroska, UID . --link-to-next segment-UID ' UID , segment-UID. . ' . SID "=", ' Matroska, UID . --append-mode mode , . mode : 'file' ( ) 'track'. mkvmerge ( 'track2_1') ( 'file2') ( 'track1_1') ( 'file1'), 'track2_1' . 'file' , 'file1', , 'track1_1'. 'track1_1'. , mkvmerge , . 'file'. 'file' , ; . AVI MP4. 'track' , , . VOB EVO. , 'file' , 'track' . --append-to SFID1:STID1:DFID1:DTID1[,...] , . ID: ID , ID , ID ID . , "ID " "ID ", , . , "ID " "ID ", , . , . ID . , ID mkvmerge -o output.mkv part1.mkv +part2.mkv. + '+' , . '+' ' . : $ mkvmerge -o full.mkv file1.mkv + file2.mkv $ mkvmerge -o full.mkv file1.mkv +file2.mkv [ file1 file2 ] , , . '+' . : $ mkvmerge -o full.mkv file1.mkv + file2.mkv $ mkvmerge -o full.mkv '[' file1.mkv file2.mkv ']' = ( MPEG, VOB-) mkvmerge(1) , , ' (, 'VTS_01_1.VOB', 'VTS_01_2.VOB', 'VTS_01_3.VOB' ) , ' . , '=', mkvmerge . '=' ' . : $ mkvmerge -o full.mkv = file1.mkv $ mkvmerge -o full.mkv =file1.mkv ( file1 file2 ) , , ' , . , , VOB, DVD MPEG. , , , AVI MP4. mkvmerge; , =. : $ 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-once. MIME , , IANA[2]. MIME ' . MIME, . --attachment-name name ', . , ' , --attach-file --attach-file-once. --attach-file file-name, --attach-file-once file-name Matroska(TM). , MIME. , , --attach-file, , , --attach-file-once, . , . mkvextract(1) Matroska(TM). --enable-legacy-font-mime-types MIME . , 'application/x-truetype-font' TrueType 'fonts/ttf'. , MIME , , MIME . MIME, , 'font/sfnt', 'font/ttf' 'font/collection', 'application/x-truetype-fonts' 'font/otf', 'application/vnd .ms-opentype'. , -a, --audio-tracks [!]n,m,... n, m . - , --identify. (. ). : . ISO 639-2. , . : . !, : , , ! -d, --video-tracks [!]n,m,... n, m . - , --identify. (. ). : . ISO 639-2. , . !, : , , ! -s, --subtitle-tracks [!]n,m,... n, m . - , --identify. (. ). : . ISO 639-2. , . !, : , , ! -b, --button-tracks [!]n,m,... n, m . - , --identify. (. ). : . ISO 639-2. , . !, : , , ! --track-tags [!]n,m,... n, m . - , --identify. (. ). : . !, : , , ! -m, --attachments [!]n[:all|first],m[:all|first],... n, m . . . ':all' ( , ) ':first'. , , ':all', , . , . . !, : , , ! -A, --no-audio . -D, --no-video . -S, --no-subtitles . -B, --no-buttons DVD . -T, --no-track-tags , . --no-chapters . -M, --no-attachments . --no-global-tags . -y, --sync TID:d[,o[/p]] TID d . , , --identify (. ). o/p: o/p, . p 1, . o, p . : ( , d = 0 o/p = 1.0). , , . --cues TID:none|iframes|all , cue () , (. ). 'none' cue. 'iframes' (= I- ) cue. 'all' mkvmerge(1) cue , . - 'iframes' 'none' . --no-cues, cue, --cues. , , . --default-track-flag TID[:bool] " " (. ), ' bool 1 . , . , , << >>, , , , . , , . --track-enabled-flag TID[:bool] " " (. ) bool (0 1; 1, ). , , . , << >>. , , . --forced-display-flag TID[:bool] " " (. ), ' bool 1 . , . , , . --forced-track TID[:bool] " " (. ), ' bool 1 . , . , , . --forced-track TID[:bool] " " (. ), ' bool 1 . , . , , . --default-track TID[:bool] " " (. ), ' bool 1 . , , . , , . --forced-track TID[:bool] " " (. ), ' bool 1 . , ( ). , , . --forced-track TID[:bool] "" (. ), ' bool 1 . , . , , . --track-name TID:name (. ) name. --language TID:language (. ). ISO 639-2, ISO 639-1. . , ISO 639-2, --list-languages. , , . -t, --tags TID:file-name TID file-name. . --aac-is-sbr TID[:0|1] mkvmerge(1) ID TID SBR AAC ( HE-AAC AAC+). , ) AAC ( Matroska(TM)) ) AAC SBR AAC. , AAC SBR AAC AAC. AAC mkvmerge(1) . SBR AAC '. , . Matroska(TM), CodecID SBR AAC. , CodecID , , . mkvmerge , AAC SBR, ':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 , . mkvmerge(1) , . mkvmerge(1) , . DTS. TrueHD, AC-3, , , . DTS , HD - TrueHD. --remove-dialog-normalization-gain TID , , , . mkvmerge(1) (gain), . AC-3, DTS TrueHD. --timestamps TID:file-name , file-name. , mkvmerge(1) . . --default-duration TID:x . , . x 's', 'ms', 'us', 'ns', 'fps', 'p' 'i', , , , , , >> . x . , mkvmerge / , , AVC/H.264 MPEG-2. FPS . --fix-bitstream-timing-information TID[:0|1] mkvmerge(1) ( /), . . : (. --default-duration), . AVC/H.264. --compression TID:n , . , . : 'none', 'zlib' 'mpeg4_p2'/'mpeg4p2'. 'mpeg4_p2'/'mpeg4p2' , << >>, MPEG4 part 2. 'zlib'. , . , 'none', . , -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) , , : . mkvmerge(1) , . , '/', . '16/9'. --aspect-ratio-factor --display-dimensions (. ). . --aspect-ratio-factor TID:factor|n/d - . , . --aspect-ratio --display-dimensions (. ). . --cropping TID:left,top,right,bottom . --color-matrix TID:n , , . n 0 10. : 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 . 0 , . --chroma-subsample TID:hori,vert Cr Cb , /. : 4:2:0 TID:1,1. --cb-subsample TID:hori,vert Cb , /. --chroma-subsample. : 4:2:1, --chroma-subsample TID:1,0 Cb TID:1,0. --chroma-siting TID:hori,vert , / (0: , 1: , 2: ). --color-range TID:n (0: , 1: , 2: ( ), 3: MatrixCoefficients/TransferCharacteristics). --color-transfer-characteristics TID:n . : 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 . : 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 (Maximum Content Light Level) (/^2). n ' . --max-frame-light TID:n (Maximum Frame-Average Light Level) (/^2). n ' . --chromaticity-coordinates TID:red-x,red-y,green-x,green-y,blue-x,blue-y //, CIE 1931. --white-color-coordinates TID:x,y , CIE 1931. --max-luminance TID:float (/^2). 9999,99. --min-luminance TID:float (/^2). 999,99. --projection-type TID:method . : 0 ( ), 1 ( ), 2 ( ) 3 ( ). --projection-private TID:data , . "0x" , . --projection-pose-yaw TID:float . --projection-pose-pitch TID:float . --projection-pose-roll TID:float . --field-order TID:n TID. : 0: ; 1: , ; 2: ; 6: , ; 9: , ; 14: , --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 UTF-8 UTF-8 . , . , Matroska(TM) Kate, UTF-8. , , mkvmerge(1) . , , . -i, --identify file-name mkvmerge(1) , , , . , ' . , , --identification-format. -J file-name "--identification-format json --identify file-name". -F, --identification-format format , --identify. : text ( , ) json. 1. text . (, , ). . , mkvmerge(1) ( --ui-language). 2. json JSON. JSON, : mkvmerge-identification-output-schema-v18.json[3] JSON , . --probe-range-percentage percentage MPEG (.vob, .m2ts) , , . 0,3% 10 , , . , , , . 10 . --list-audio-emphasis Lists all valid numbers & their corresponding symbolic names for the --audio-emphasis option. --list-languages ISO 639-2, --language . --list-stereo-modes Lists all valid numbers & their corresponding symbolic names for the --stereo-mode option. -l, --list-types . --priority priority , mkvmerge(1). 'lowest', 'lower', 'normal', 'higher' 'highest'. , 'normal'. Unix- mkvmerge(1) nice(2). 'higher' 'highest'. Windows . '' mkvmerge(1) - . --command-line-charset character-set . . : --title, --track-name --attachment-description. --output-charset character-set . . -r, --redirect-output file-name file-name, . , , : . --output-charset . --flush-on-close ' , . , . , , mkvmerge , , . 2469 2480 - MKVToolNix . --ui-language code code (, 'de_DE' ). list' code . --abort-on-warnings . 1. --deterministic seed , mkvmerge(1) , . , <<>> . ' . : 1. mkvmerge(1) libEBML libMatroska. 2. . 3. ( --output...). mkvmerge(1) , , . --debug topic . . --engage feature . mkvinfo --engage list. . --gui-mode . , , . '#GUI#message'. /, '#GUI#message#key1=value1#key2=value2...'. , . @options-file.json options-file. . --capabilities , . . , , . : o 'FLAC' -- FLAC FLAC , Ogg(TM) Matroska(TM). -h, --help . -V, --version . , mkvmerge(1) . , -o. ( ) -l. . , " ", . . : 1. , ' . , --command-line-charset, --output --title. - . 2. , . . , ( ), - , ' . : --no-chapters --chapter-charset. : --default-duration --language. . ' , . " " : $ mkvmerge -o output.mkv --title 'This and that' input.avi --title 'Something else' --language , , . , , , , : $ 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 AVI , ( mkvmerge(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) . ( ), mplayer(TM)- , '-vid' '-aid'. 0 . , . , Vorbis $ mkvmerge --identify outofsync.ogg ID : $ mkvmerge -o goodsync.mkv -A source.avi -y 12345:200 outofsync.ogg 200 12345, 'outofsync.ogg'. , . , - . , . , 0.2 77340 . 29.97fps 0.2 6 . $ mkvmerge -o goodsync.mkv -y 23456:0,77346/77340 outofsync.mkv . . Windows ( SubRipper(TM)) subrip(TM), transcode(1) 'contrib/subrip'. : 1. : $ tccat -i /path/to/copied/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o mymovie 2. PGM gocr: $ 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-2 . mkvmerge(1) : $ mkvmerge --list-languages . , Matroska(TM) , 2 3. $ 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 mkvmerge(1) . , mkvmerge(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) , MKV, . , , . , . 'file1.ext' 'mkvmerge --identify' , 'file1.ext' . : o AVI: 0. , 1. o AAC, AC-3, MP3, SRT WAV: ID 0. o : , 0. , , 'TID'. : --audio-tracks, --video-tracks, --subtitle-tracks, --button-tracks --track-tags. , . '-1' , . '-2' . --sync . --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. MKVToolNix, mkvmerge(1). Matroska(TM) UTF-8. , mkvmerge(1) , , , , - UTF-8. , mkvmerge(1) UTF-8, - --ui-language , Matroska(TM). mkvmerge(1) (: BOM) . , mkvmerge(1) . (BOM) , BOM, UTF. mkvmerge(1) ' : UTF-8, UTF-16 Little Big Endian, UTF-32 Little Big Endian. BOM UTF-8. - ( --sub-charset) . Linux Unix- , macOS Unix- mkvmerge(1) setlocale(3), , , LANG, LC_ALL LC_CYPE. UTF-8 ISO-8859-* . Windows Windows , , GetACP(). GetCommandLineW(), Unicode. --command-line-charset Windows. : 1. --redirect-output, UTF-8. --output-charset. 2. cmd.exe , mkvinfo file.mkv > info.txt, UTF-8 . 3. ( ) Windows WriteConsoleW() --output-charset . Unicode, (, Windows). , : o --sub-charset , , (, Ogg), o --chapter-charset , , (, Ogg , ; MP4 ), o --command-line-charset , o --output-charset , , --redirect-output. , Windows, . Windows UTF-8 --redirect-output cmd.exe, mkvinfo file.mkv > info.txt. , mkvmerge(1) . , , , . JSON. JSON, JSON. UTF-8. (BOM), , . JSON JSON, RFC 7159[4]. ' '@'. 'mkvextract tracks source.mkv --raw 1:destination.raw' : [ "-o", "c:\\Matroska\\my file.mkv", "--title", "#65", "-A", "a movie.avi", "sound.ogg" ] 'mkvmerge @options.json'. ' Matroska(TM) ' , , . , ' , Matroska(TM). , , Matroska(TM), <<' >>, <<' >> . 128- UID . UID mkvmerge(1). ' UID (: SID) / . mkvinfo(1) SID, . ', 0, , . , (, ). ' , 0 . mkvmerge(1) ' . , --link. , . , , mkvmerge(1) ' SIDs. --link-to-previous --link-to-next. SID , mkvinfo(1): 16 0x00 0xff, '0x', '0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 0x5e 0xca 0xb3 0x93'. : 16 0x00 0xff '0x' , '41da7366d9cfb21eae78ebb45ecab393'. , ' SID, --link-to-previous, ' SID, --link-to-next. , ' SID. Matroska(TM) , . , , . , mkvinfo(1), . ('eng'), . , --language 0:eng , mkvinfo(1). , Matroska(TM), SSA TrueType(TM), . Matroska(TM). , . ( <<>>) ( ' TrueType(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) OGM. Matroska(TM)[1]. mkvmerge(1) . , << >>, , OGM. XML, Matroska(TM). mkvmerge(1) (, MP4, Ogg, Blu-ray DVD). , '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 , : 1. , 2. 3. . mkvtoolnix doc, . 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) Blu-ray mkvmerge(1) Blu-ray. MPLS --chapters. : --chapters /srv/blurays/BigBuckBunny/BDMV/PLAYLIST/00001.mpls DVD MKVToolNix libdvdread(TM), mkvmerge(1) DVD-. DVD --chapters. DVD- , , . 1. : --generate-chapters interval:45s mkvmerge(1) . , , , . mkvmerge(1) Matroska(TM), --no-chapters. ( Matroska(TM), Ogg, MP4, ) ', ChapterEditions. Matroska(TM) XML , UID , ' ChapterEdition. ' , mkvextract(1) ' XML, . Matroska(TM) : KEY=VALUE. Matroska(TM) , KEY, VALUE . example-tags-2.xml , . Matroska(TM) . , : , . Matroska(TM)[5] . , ' Targets Matroska(TM) , UID-, ', , mkvmerge(1) . UID, mkvmerge(1) ( , Matroska(TM)) , Matroska(TM). , UID , mkvmerge(1). mkvmerge(1) , Matroska(TM): --global-tags --tags. , , --global-tags, , - Targets. , --tags, UID, mkvmerge(1) , TID --tags. , , AVI. mkvmerge --identify file.avi , ID ( UID!) 0. , Targets mkvmerge(1): $ mkvmerge -o file.mkv --tags 0:tags.xml file.avi mkvmerge(1) XML. Matroska(TM)[5]. , MKVToolNix example-tags-2.xml, . : o <>. o <> XML. o . Matroska(TM) : UTF-8 . , . XML mkvmerge(1) . XML '@', ' . Matroska(TM). , Base64. , ASCII , , . mkvextract(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) XML " " Matroska(TM). . " " , XML. , --title --timestamp-scale. , , XML. : DateUTC ( " "), MuxingApp, WritingApp Duration. mkvmerge(1) . XML, , , : Info (master) SegmentUID (binary, valid range: length in bytes == 16) SegmentFilename (UTF-8 string) PreviousSegmentUID (binary, valid range: length in bytes == 16) PreviousSegmentFilename (UTF-8 string) NextSegmentUID (binary, valid range: length in bytes == 16) NextSegmentFilename (UTF-8 string) SegmentFamily (binary, valid range: length in bytes == 16) ChapterTranslate (master) ChapterTranslateEditionUID (unsigned integer) ChapterTranslateCodec (unsigned integer) ChapterTranslateID (binary) Matroska(TM) Matroska(TM) . mkvmerge(1) . : [EBML head] [segment {meta seek #1} [segment information] [track information] {attachments} {chapters} [cluster 1] {cluster 2} ... {cluster n} {cues} {meta seek #2} {tags}] ' , . : o 1 1, : , , cue, , 2. mkvmerge(1) - . , . . 2, 1 2. o , , . Matroska(TM) : [EBML head] [segment [segment information] [track information] [cluster 1]] . mkvmerge(1) . . , mkvmerge(1) Matroska(TM). , . AC-3 , 1536 . , , , . , , v1.avi v2.avi, , : $ mkvmerge ... --timestamps 0:my_timestamps.txt v1.avi +v2.avi , mkvmerge(1). . , , , , '#', . 1 . . , : (0 -- ), . FPS -- '.' . , FPS. : # 1 assume 27.930 800,1000,25 1500,1700,30 2 . . , '. , . . 25 : # timestamp format v2 0 40 80 3 , ' . . , . . 0,0 . , 'gap', . : # timestamp format v3 assume 0.0 25.325 7.530,38.236 gap, 10.050 2.000,38.236 4 v2. , . . mkvmerge(1) : o 0 -- , . o 1 -- mkvmerge(1) , . 'Warning:'. , , , . , . o 2 -- , . mkvmerge(1) . / . mkvmerge(1) , (, LANG LC_*). : MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG MTX_DEBUG , --debug. MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE MTX_ENGAGE , --engage. mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) WWW - MKVToolNix[6]. Moritz Bunkus 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/technical/specs/index.html 6. MKVToolNix https://mkvtoolnix.download/ MKVToolNix 83.0 2024-03-10 mkvmerge(1)