table of contents
- НАЗВАНИЕ
- РЕЗЮМЕ
- ОПИСАНИЕ
- УПОТРЕБА
- РЕД НА ОПЦИИТЕ
- ПРИМЕРИ
- ID-ТА НА ПЪТЕЧКИ
- Language handling
- ТЕКСТОВИ ФАЙЛОВЕ И КОНВЕРТИРАНИЯ НА НАБОРИ ОТ СИМВОЛИ
- ФАЙЛОВЕ С ОПЦИИ
- СВЪРЗВАНЕ НА ФАЙЛОВЕ
- СТОЙНОСТИ ПО ПОДРАЗБИРАНЕ
- ПРИКАЧЕНИ ФАЙЛОВЕ
- ЕПИЗОДИ (chapters)
- ТАГОВЕ
- ИНФОРМАЦИЯ ЗА СЕГМЕНТА
- ОФОРМЛЕНИЕ НА Matroska(TM) ФАЙЛОВЕ
- ВЪНШНИ ФАЙЛОВЕ С ВРЕМЕВИ КЛЕЙМА
- КОДОВЕ ЗА ИЗХОД
- ПРОМЕНЛИВИ НА СРЕДАТА
- ВИЖ СЪЩО
- УЕБСАЙТ
- АВТОР
- ЗАБЕЛЕЖКИ
mkvmerge(1) | Потребителски команди | mkvmerge(1) |
НАЗВАНИЕ¶
mkvmerge - Обединяване на мултимедийни потоци в Matroska(TM) файл
РЕЗЮМЕ¶
mkvmerge [глобални опции] {-o out} [опции1] {файл1} [[опции2] {файл2}] [@файл-с-опции.json]
ОПИСАНИЕ¶
Тази програма приема входни данни от няколко медийни файла и обединява техните потоци (всички или само избраните) в Matroska(TM) файл; виж уебсайта на Matroska(TM)[1].
Важно
Редът на параметрите в командния ред е от съществено значение. Моля, прочетете раздела „Ред на опциите“, ако нямате опит с програмата.
Глобални опции¶
-v, --verbose
-q, --quiet
-o, --output име на файла
-w, --webm
За епизоди и тагове само някои елементи са разрешени. mkvmerge(1) автоматично ще премахне всички неразрешени от спецификацията елементи.
--title заглавие
--default-language езиков-код
Езиковият код по подразбиране е „und“, което означава „undetermined“ (неопределен).
Боравене с информация за сегмента (глобални опции)¶
--segmentinfo име-на-файла.xml
Виж секцията за XML файлове с информация за сегмента по-долу за повече информация.
--segment-uid SID1,SID2,...
If SID starts with = then its rest is interpreted as the name of a Matroska file whose segment UID is read and used.
Each file created contains one segment, and each segment has one segment UID. If more segment UIDs are specified than segments are created then the surplus UIDs are ignored. If fewer UIDs are specified than segments are created then random UIDs will be created for them.
Боравене с епизоди и тагове (глобални опции)¶
--chapter-language езиков-код
This option can be used both for simple chapter files and for source files that contain chapters but no information about the chapters' language, e.g. MP4 and OGM files.
Езикът, зададен с тази опция, също се използва и при генериране на епизоди с опцията --generate-chapters.
--chapter-charset набор-от-символи
This switch does also apply to chapters that are copied from certain container types, e.g. Ogg/OGM and MP4 files. See the section about chapters below for details.
--chapter-sync d[,o[/p]]
o/p: adjust the timestamps by o/p to fix linear drifts. p defaults to 1 if omitted. Both o and p can be floating point numbers.
По подразбиране: без ръчна корекция на синхронизацията (което съответства на d = 0 и o/p = 1.0).
This option can be used multiple times for an input file applying to several tracks by selecting different track IDs each time.
--generate-chapters режим
Този режим работи също и при режимите за разделяне „parts:“ и „parts-frames:“. При тези режими един епизод (chapter) ще бъде генериран за всяко следващо разширение от диапазон с времеви клейма (тези, преди чиито времеви клейма има „+“).
Забележка
mkvmerge(1) requires a video or an audio track to be present in order to be able to determine when a new file is appended. If one or more video tracks are muxed the first one is used. Otherwise the first audio track is used.
Пример: --generate-chapters interval:45s
The names for the new chapters are controlled by the option --generate-chapters-name-template. The language is set with --chapter-language which must occur before --generate-chapters.
--generate-chapters-name-template шаблон
There are several variables that can be used in the template that are replaced by their actual values when a chapter is generated. The string '<NUM>' will be replaced by the chapter number. The string '<START>' will be replaced by the chapter's start timestamp.
The strings '<FILE_NAME>' and '<FILE_NAME_WITH_EXT>' 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.
You can specify a minimum number of places for the chapter number with '<NUM:places>', e.g. '<NUM:3>'. The resulting number will be padded with leading zeroes if the number of places is less than specified.
Може да контролирате формата, използван за началното времево клеймо, със <START:формат>. Форматът по подразбиране е „%H:%M:%S“, ако не е посочено друго. Валидни кодове за формата са:
--cue-chapter-name-format формат
If this option is not given then mkvmerge(1) defaults to the format '%p - %t' (the performer, followed by a space, a dash, another space and the title).
If the format is given then everything except the following meta characters is copied as-is, and the meta characters are replaced like this:
--chapters име на файла
--global-tags име на файла
Общ контрол на изхода (разширени глобални опции)¶
--track-order FID1:TID1,FID2:TID2,...
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
If no unit is used then mkvmerge(1) will put at most n data blocks into each cluster. The maximum number of blocks is 65535.
If the number d is postfixed with 'ms' then mkvmerge(1) puts at most d milliseconds of data into each cluster. The minimum for d is '100ms', and the maximum is '32000ms'.
mkvmerge(1) defaults to putting at most 65535 data blocks and 5000ms of data into a cluster.
Programs trying to find a certain frame can only seek directly to a cluster and have to read the whole cluster afterwards. Therefore creating larger clusters may lead to imprecise or slow seeking.
--clusters-in-meta-seek
--timestamp-scale factor
Normally mkvmerge(1) will use a value of 1000000 which means that timestamps and durations will have a precision of 1ms. For files that will not contain a video track but at least one audio track mkvmerge(1) will automatically chose a timestamp scale factor so that all timestamps and durations have a precision of one audio sample. This causes bigger overhead but allows precise seeking and extraction.
If the special value -1 is used then mkvmerge(1) will use sample precision even if a video track is present.
--enable-durations
--no-cues
--no-date
--disable-lacing
--disable-track-statistics-tags
Enabling this option prevents mkvmerge(1) from writing those tags and from touching any existing tags with same names.
--disable-language-ietf
--normalize-language-ietf режим
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
Разделяне, свързване, разширяване и залепяне на файлове (още глобални опции)¶
--split specification
Към момента, mkvmerge(1) поддържа следните режими:
Синтаксис: --split [size:]d[k|m|g]
Примери: --split size:700m или --split 150000000
The parameter d may end with 'k', 'm' or 'g' to indicate that the size is in KB, MB or GB respectively. Otherwise a size in bytes is assumed. After the current output file has reached this size limit a new one will be started.
Префиксът „size:“ може да бъде пропуснат (от съображения за съвместимост).
Синтаксис: --split [duration:]ЧЧ:ММ:СС.ннннннннн|ds
Примери: --split duration:00:60:00.000 или --split 3600s
The parameter must either have the form HH:MM:SS.nnnnnnnnn for specifying the duration in up to nano-second precision or be a number d followed by the letter 's' for the duration in seconds. HH is the number of hours, MM the number of minutes, SS the number of seconds and nnnnnnnnn the number of nanoseconds. Both the number of hours and the number of nanoseconds can be omitted. There can be up to nine digits after the decimal point. After the duration of the contents in the current output has reached this limit a new output file will be started.
Префиксът „duration:“ може да бъде пропуснат (от съображения за съвместимост).
Синтаксис: --split timestamps:A[,B[,C...]]
Пример: --split timestamps:00:45:00.000,01:20:00.250,6300s
The parameters A, B, C etc must all have the same format as the ones used for the duration (see above). The list of timestamps is separated by commas. After the input stream has reached the current split point's timestamp a new file is created. Then the next split point given in this list is used.
Префиксът „timestamps:“ не трябва да бъде пропуснат.
Синтаксис: --split parts:начало1-край1[,[+]начало2-край2[,[+]начало3-край3...]]
Примери:
Режимът parts казва на mkvmerge(1) да запази определени диапазони от времеви клейма, премахвайки други. Диапазоните за запазване трябва да бъдат изброени в списък непосредствено след ключовата дума parts: и да бъдат разделени със запетайки. Даден диапазон се състои от начално и крайно времево клеймо в същия формат, който и другите варианти на --split приемат (00:01:20 и 80s обозначават едно и също времево клеймо).
Ако начално времево клеймо бъде пропуснато, тогава по подразбиране се взима крайното времево клеймо от предходния диапазон. Ако няма предходен диапазон, тогава по подразбиране се взима началото на файла (виж пример 3).
Ако крайно времево клеймо бъде пропуснато, тогава по подразбиране се взима края на файловете източници, т.е. mkvmerge(1) запазва всичко до края (виж пример 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.
В пример 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 до края на файловете-източници.
Забележка
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.
Синтаксис: --split parts-frames:начало1-край1[,[+]начало2-край2[,[+]начало3-край3...]]
Примери:
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 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.
Синтаксис: --split frames:А[,Б[,В...]]
Пример: --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.
The 'frames:' prefix must not be omitted.
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.
Синтаксис: --split chapters:all или --split chapters:А[,Б[,В...]]
Пример: --split chapters:5,8
The parameters A, B, C etc must all be positive integers. Numbering starts at 1. The list of chapter numbers is separated by commas. Splitting will occur right before the first key frame whose timestamp is equal to or bigger than the start timestamp for the chapters whose numbers are listed. A chapter starting at 0s is never considered for splitting and discarded silently.
Може да бъде използвана ключовата дума all, вместо ръчно да се изреждат номерата на всички епизоди.
The 'chapters:' prefix must not be omitted.
Забележка
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.
For this splitting mode the output filename is treated differently than for the normal operation. It may contain a printf like expression '%d' including an optional field width, e.g. '%02d'. If it does then the current file number will be formatted appropriately and inserted at that point in the filename. If there is no such pattern then a pattern of '-%03d' is assumed right before the file's extension: '-o output.mkv' would result in 'output-001.mkv' and so on. If there's no extension then '-%03d' will be appended to the name.
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 UID-на-сегмент
If SID starts with = then its rest is interpreted as the name of a Matroska file whose segment UID is read and used.
--link-to-next UID-на-сегмент
If SID starts with = then its rest is interpreted as the name of a Matroska file whose segment UID is read and used.
--append-mode режим
When mkvmerge appends a track (called 'track2_1' from now on) from a second file (called 'file2') to a track (called 'track1_1') from the first file (called 'file1') then it has to offset all timestamps for 'track2_1' by an amount. For 'file' mode this amount is the highest timestamp encountered in 'file1' even if that timestamp was from a different track than 'track1_1'. In track mode the offset is the highest timestamp of 'track1_1'.
Unfortunately mkvmerge cannot detect which mode to use reliably. Therefore it defaults to 'file' mode. 'file' mode usually works better for files that have been created independently of each other; e.g. when appending AVI or MP4 files. 'track' mode may work better for sources that are essentially just parts of one big file, e.g. for VOB and EVO files.
Subtitle tracks are always treated as if 'file' mode were active even if 'track' mode actually is.
--append-to SFID1:STID1:DFID1:DTID1[,...]
If this option has been omitted then a standard mapping is used. This standard mapping appends each track from the current file to a track from the previous file with the same track ID. This allows for easy appending if a movie has been split into two parts and both file have the same number of tracks and track IDs with the command mkvmerge -o output.mkv part1.mkv +part2.mkv.
+
$ mkvmerge -o full.mkv file1.mkv + file2.mkv $ mkvmerge -o full.mkv file1.mkv +file2.mkv
[ файл1 файл2 ]
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 ']'
=
The '=' can also be put in front of the next file name. Therefore the following two commands are equivalent:
$ mkvmerge -o full.mkv = file1.vob $ mkvmerge -o full.mkv =file1.vob
( файл1 файл2 )
This can be used for e.g. VOB files coming from a DVD or MPEG transport streams. It cannot be used if each file contains its own set of headers which is usually the case with stand-alone files like AVI or MP4.
Putting a file name into parenthesis also prevents mkvmerge(1) from looking for additional files with the same base name as described in option =. Therefore these two command lines are equivalent:
$ mkvmerge -o out.mkv = file.mkv $ mkvmerge -o out.mkv '(' file.mkv ')'
Трябва да бъдат отбелязани няколко неща:
Поддръжка на прикачени файлове (още глобални опции)¶
--attachment-description описание
--attachment-mime-type MIME тип
If no MIME type is given a for an attachment, its type will be detected automatically.
--attachment-name име
--attach-file име на файла, --attach-file-once име на файла
mkvextract(1) can be used to extract attached files from a Matroska(TM) file.
--enable-legacy-font-mime-types
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 [!]н,м,...
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 [!]н,м,...
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 [!]н,м,...
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 [!]н,м,...
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 [!]н,м,...
If the IDs are prefixed with ! then the meaning is reversed: copy everything but the IDs listed after the !.
-m, --attachments [!]n[:all|first],m[:all|first],...
The default is to copy all attachments to all output files.
If the IDs are prefixed with ! then the meaning is reversed: copy everything but the IDs listed after the !.
-A, --no-audio
-D, --no-video
-S, --no-subtitles
-B, --no-buttons
-T, --no-track-tags
--no-chapters
-M, --no-attachments
--no-global-tags
--regenerate-track-uids
This behavior is enabled automatically for Matroska files created by the MakeMKV software. The reason is that MakeMKV uses consecutive numbers (1, 2, 3...) as UIDs instead of generating random ones.
-y, --sync TID:d[,o[/p]]
o/p: adjust the timestamps by o/p to fix linear drifts. p defaults to 1 if omitted. Both o and p can be floating point numbers.
По подразбиране: без ръчна корекция на синхронизацията (което съответства на d = 0 и o/p = 1.0).
This option can be used multiple times for an input file applying to several tracks by selecting different track IDs each time.
--cues TID:none|iframes|all
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.
This option can be used multiple times for an input file applying to several tracks by selecting different track IDs each time.
--default-track-flag TID[:bool]
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.
This option can be used multiple times for an input file applying to several tracks by selecting different track IDs each time.
--track-enabled-flag TID[:bool]
Само пътечки със зададен флаг „включено“ би трябвало да бъдат взимани предвид при възпроизвеждане.
This option can be used multiple times for an input file applying to several tracks by selecting different track IDs each time.
--forced-display-flag TID[:bool]
This option can be used multiple times for an input file applying to several tracks by selecting different track IDs each time.
--hearing-impaired-flag TID[:bool]
This option can be used multiple times for an input file applying to several tracks by selecting different track IDs each time.
--visual-impaired-flag TID[:bool]
This option can be used multiple times for an input file applying to several tracks by selecting different track IDs each time.
--text-descriptions-flag TID[:bool]
This option can be used multiple times for an input file applying to several tracks by selecting different track IDs each time.
--original-flag TID[:bool]
This option can be used multiple times for an input file applying to several tracks by selecting different track IDs each time.
--commentary-flag TID[:bool]
This option can be used multiple times for an input file applying to several tracks by selecting different track IDs each time.
--track-name TID:име
--language TID:език
This option can be used multiple times for an input file applying to several tracks by selecting different track IDs each time.
-t, --tags TID:име-на-файла
--aac-is-sbr TID[:0|1]
If the source file is a Matroska(TM) file then the CodecID should be enough to detect SBR AAC. However, if the CodecID is wrong then this switch can be used to correct that.
If mkvmerge wrongfully detects that an AAC file is SBR then you can add ':0' to the track ID.
--audio-emphasis TID:n|symbolic-name
--reduce-to-core TID
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
Към момента единствено AC-3, DTS и TrueHD пътечките са засегнати от тази опция.
--timestamps TID:име-на-файла
--default-duration TID:х
If the default duration is not forced then mkvmerge will try to derive the track's default duration from the container and/or the encoded bitstream for certain track types, e.g. AVC/H.264 or MPEG-2.
This option can also be used to change the FPS of video tracks without having to use an external timestamp file.
--fix-bitstream-timing-information TID[:0|1]
Забележка
Засега тази опция е имплементирана само за AVC/H.264 видео пътечки.
--compression TID:н
The compression method 'mpeg4_p2'/'mpeg4p2' is a special compression method called 'header removal' that is only available for MPEG4 part 2 video tracks.
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
--display-dimensions TID:широчинаxвисочина
Another way to specify the values is to use the --aspect-ratio or the --aspect-ratio-factor option (see below). These options are mutually exclusive.
--aspect-ratio TID:пропорция|широчина/височина
Another way to specify the values is to use the --aspect-ratio-factor or --display-dimensions options (see above and below). These options are mutually exclusive.
--aspect-ratio-factor TID:коефициент|n/d
Another way to specify the values is to use the --aspect-ratio or --display-dimensions options (see above). These options are mutually exclusive.
--cropping TID:ляво,горе,дясно,долу
--color-matrix-coefficients TID:n
Валидни стойности и техните значения са:
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:н
--chroma-subsample TID:хори,верт
Example: For video with 4:2:0 chroma subsampling, the parameter should be set to TID:1,1.
--cb-subsample TID:хори,верт
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:хори,верт
--color-range TID:н
--color-transfer-characteristics TID:н
Валидни стойности и техните значения са:
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:н
Валидни стойности и техните значения са:
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:н
--max-frame-light TID:н
--chromaticity-coordinates TID:red-x,red-y,green-x,green-y,blue-x,blue-y
--white-color-coordinates TID:x,y
--max-luminance TID:float
--min-luminance TID:float
--projection-type TID:метод
--projection-private TID:data
--projection-pose-yaw TID:float
--projection-pose-pitch TID:float
--projection-pose-roll TID:float
--field-order TID:н
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
Опции, които се прилагат само за пътечки с текстови субтитри¶
--sub-charset TID:набор-от-символи
This option can be used multiple times for an input file applying to several tracks by selecting different track IDs each time.
Други опции¶
-i, --identify име-на-файла
The output format used for the result can be changed with the option --identification-format.
-J име на файла
-F, --identification-format формат
This format is not meant to be parsed. The output will be translated into the language mkvmerge(1) uses (see also --ui-language).
mkvmerge-identification-output-schema-v20.json[3]
Всички версии на JSON схемата са налични и онлайн на сайта, и в архивите на изходния код на програмата.
--probe-range-percentage процент
If tracks are known to be present but not found then the percentage to probe can be changed with this option. The minimum of 10 MB is built-in and cannot be changed.
--list-audio-emphasis
--list-languages
--list-stereo-modes
-l, --list-types
--priority приоритет
Selecting 'lowest' also causes mkvmerge(1) to select idle I/O priority in addition to the lowest possible process priority.
--command-line-charset набор-от-символи
--output-charset набор-от-символи
-r, --redirect-output име на файла
--flush-on-close
--ui-language код
--abort-on-warnings
--deterministic seed
The seed can be an arbitrary string and does not have to be a number.
The result of byte-identical files is only guaranteed under the following conditions:
Using other versions of mkvmerge(1) or other command-line options may result in the same byte-identical file but is not guaranteed to do so.
--debug тема
--engage функция
--gui-mode
@файл-с-опции.json
--capabilities
-h, --help
-V, --version
УПОТРЕБА¶
За всеки файл потребителят може да избере кои пътечки да вземе mkvmerge(1). С -o всички биват сложени в посочения файл. Списък с известни (и поддържани) формати на източници може да бъде получен чрез опцията -l.
Важно
Редът на параметрите в командния ред е от съществено значение. Моля, прочетете раздела „Ред на опциите“, ако нямате опит с програмата.
РЕД НА ОПЦИИТЕ¶
Последователността, в която опциите биват въвеждани, е от съществено значение за някои опции. Опциите могат условно да се разделят на две категории:
Опциите се обработват от ляво надясно. Ако дадена опция се появи няколко пъти в рамките на един и същи обсег, тогава последното появяване ще бъде използвано. Следователно, заглавието в примера по-долу ще бъде зададено на „Нещо друго“:
$ mkvmerge -o изход.mkv --title 'Това онова' вход.avi --title 'Нещо друго'
The following example shows that using the --language option twice is OK because they're used in different scopes. Even though they apply to the same track ID they apply to different input files and therefore have different scopes:
$ mkvmerge -o изход.mkv --language 0:fre français.ogg --language 0:bul български.ogg
ПРИМЕРИ¶
Да предположим, че имаш файл с име МоятФилм.avi и аудиопътечка в отделен файл, например „МоятФилм.wav“. Първо искаш да преформатираш аудиото в OggVorbis(TM):
$ oggenc -q4 -o МоетоКлипче.ogg МоетоКлипче.wav
След няколко минути можеш да обединиш видеото и аудиото:
$ mkvmerge -o МоетоКлипче-със-звук.mkv МоетоКлипче.avi МоетоКлипче.ogg
Ако AVI файлът ти вече съдържа аудио пътечка, то тогава тя също ще бъде копирана (ако mkvmerge(1) поддържа аудио формата). За да избегнеш това, можеш просто да направиш
$ mkvmerge -o МоетоКлипче-със-звук.mkv -A МоетоКлипче.avi МоетоКлипче.ogg
След още обмисляне решаваш да извлечеш друга аудио пътечка, било то „коментарите на режисьора“ или друг език, в „МоетоКлипче-добави-аудио.wav“. Пак го преформатирай и обедини с другия файл:
$ oggenc -q4 -o МоетоКлипче-добави-аудио.ogg МоетоКлипче-добави-аудио.wav $ mkvmerge -o МК-завършено.mkv МоетоКлипче-със-звук.mkv МоетоКлипче-добави-аудио.ogg
Същият резултат може да бъде постигнат и с
$ mkvmerge -o МК-завършено.mkv -A МоетоКлипче.avi МоетоКлипче.ogg МоетоКлипче-добави-аудио.ogg
Now fire up mplayer(TM) and enjoy. If you have multiple audio tracks (or even video tracks) then you can tell mplayer(TM) which track to play with the '-vid' and '-aid' options. These are 0-based and do not distinguish between video and audio.
If you need an audio track synchronized you can do that easily. First find out which track ID the Vorbis track has with
$ mkvmerge --identify outofsync.ogg
Now you can use that ID in the following command line:
$ mkvmerge -o goodsync.mkv -A source.avi -y 12345:200 outofsync.ogg
This would add 200ms of silence at the beginning of the audio track with the ID 12345 taken from 'outofsync.ogg'.
Some movies start synced correctly but slowly drift out of sync. For these kind of movies you can specify a delay factor that is applied to all timestamps -- no data is added or removed. So if you make that factor too big or too small you'll get bad results. An example is that an episode I transcoded was 0.2 seconds out of sync at the end of the movie which was 77340 frames long. At 29.97fps 0.2 seconds correspond to approx. 6 frames. So I did
$ mkvmerge -o goodsync.mkv -y 23456:0,77346/77340 outofsync.mkv
Резултатът си беше наред.
Опциите за синхронизация могат да бъдат използвани и за субтитри по същия начин.
For text subtitles you can either use some Windows software (like SubRipper(TM)) or the subrip(TM) package found in transcode(1)'s sources in the 'contrib/subrip' directory. The general process is:
$ tccat -i /path/to/copied/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o mymovie
$ pgm2txt mymovie
$ ispell -d american *txt
$ srttool -s -w -i mymovie.srtx -o mymovie.srt
The resulting file can be used as another input file for mkvmerge(1):
$ mkvmerge -o mymovie.mkv mymovie.avi mymovie.srt
If you want to specify the language for a given track then this is easily done. First find out the ISO 639-2 code for your language. mkvmerge(1) can list all of those codes for you:
$ mkvmerge --list-languages
Search the list for the languages you need. Let's assume you have put two audio tracks into a Matroska(TM) file and want to set their language codes and that their track IDs are 2 and 3. This can be done with
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut without-lang-codes.mkv
As you can see you can use the --language switch multiple times.
Maybe you'd also like to have the player use the Dutch language as the default language. You also have extra subtitles, e.g. in English and French, and want to have the player display the French ones by default. This can be done with
$ 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
If you do not see the language or default track flags that you've specified in mkvinfo(1)'s output then please read the section about default values.
Turn off the compression for an input file.
$ mkvmerge -o no-compression.mkv --compression -1:none MyMovie.avi --compression -1:none mymovie.srt
ID-ТА НА ПЪТЕЧКИ¶
Обикновени ID-та на пътечки¶
Some of the options for mkvmerge(1) need a track ID to specify which track they should be applied to. Those track IDs are printed by the readers when demuxing the current input file, or if mkvmerge(1) is called with the --identify option. An example for such output:
$ 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)
Do not confuse the track IDs that are assigned to the tracks that are placed in the output MKV file with the track IDs of the input files. Only the input file track IDs are used for options needing these values.
Also note that each input file has its own set of track IDs. Therefore the track IDs for file 'file1.ext' as reported by 'mkvmerge --identify' do not change no matter how many other input files are there or in which position 'file1.ext' is used.
Track IDs are assigned like this:
The options that use the track IDs are the ones whose description contains 'TID'. The following options use track IDs as well: --audio-tracks, --video-tracks, --subtitle-tracks, --button-tracks and --track-tags.
Специални ID-та на пътечки¶
There are several IDs that have special meaning and do not occur in the identification output.
The special track ID '-1' is a wild card and applies the given switch to all tracks that are read from an input file.
The special track ID '-2' refers to the chapters in a source file. Currently only the --sync option uses this special ID. As an alternative to --sync -2:... the option --chapter-sync ... can be used.
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).
Въведение¶
All text in a Matroska(TM) file is encoded in UTF-8. This means that mkvmerge(1) has to convert every text file it reads as well as every text given on the command line from one character set into UTF-8. In return this also means that mkvmerge(1)'s output has to be converted back to that character set from UTF-8, e.g. if a non-English translation is used with --ui-language or for text originating from a Matroska(TM) file.
mkvmerge(1) does this conversion automatically based on the presence of a byte order marker (short: BOM) or the system's current locale. How the character set is inferred from the locale depends on the operating system that mkvmerge(1) is run on.
Byte order markers (BOM) – знакове за байтов порядък¶
Text files that start with a BOM are already encoded in one representation of UTF. mkvmerge(1) supports the following five modes: UTF-8, UTF-16 Little and Big Endian, UTF-32 Little and Big Endian. Text files with a BOM are automatically converted to UTF-8. Any of the parameters that would otherwise set the character set for such a file (e.g. --sub-charset) is silently ignored.
Linux и Unix-базирани операционни системи, в това число и macOS¶
On Unix-like systems mkvmerge(1) uses the setlocale(3) system call which in turn uses the environment variables LANG, LC_ALL and LC_CYPE. The resulting character set is often one of UTF-8 or the ISO-8859-* family and is used for all text file operations and for encoding strings on the command line and for output to the console.
Операционна система „Windows“¶
On Windows the default character set used for converting text files is determined by a call to the GetACP() system call.
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:
Опции в командния ред¶
Съществуват следните опции, които позволяват задаване на набори от символи:
ФАЙЛОВЕ С ОПЦИИ¶
An option file is a file mkvmerge(1) can read additional command line arguments from. This can be used in order to circumvent certain limitations of the shell or the operating system when executing external programs like a limited command line length.
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.
Командата 'mkvmerge -o "моят файл.mkv" -A "филмче.avi" звук.ogg' би могла да бъде преобразувана в следния JSON файл с опции, казващ се примерно 'опции.json':
[
"-o",
"c:\\Matroska\\моят файл.mkv",
"--title",
"#65",
"-A",
"филмче.avi",
"звук.ogg" ]
Съответстващата команда е 'mkvmerge @опции.json'.
СВЪРЗВАНЕ НА ФАЙЛОВЕ¶
Matroska(TM) supports file linking which simply says that a specific file is the predecessor or successor of the current file. To be precise, it's not really the files that are linked but the Matroska(TM) segments. As most files will probably only contain one Matroska(TM) segment the following explanations use the term 'file linking' although 'segment linking' would be more appropriate.
Each segment is identified by a unique 128 bit wide segment UID. This UID is automatically generated by mkvmerge(1). The linking is done primarily via putting the segment UIDs (short: SID) of the previous/next file into the segment header information. mkvinfo(1) prints these SIDs if it finds them.
If a file is split into several smaller ones and linking is used then the timestamps will not start at 0 again but will continue where the last file has left off. This way the absolute time is kept even if the previous files are not available (e.g. when streaming). If no linking is used then the timestamps should start at 0 for each file. By default mkvmerge(1) does not use file linking. If you want that you can turn it on with the --link option. This option is only useful if splitting is activated as well.
Regardless of whether splitting is active or not the user can tell mkvmerge(1) to link the produced files to specific SIDs. This is achieved with the options --link-to-previous and --link-to-next. These options accept a segment SID in the format that mkvinfo(1) outputs: 16 hexadecimal numbers between 0x00 and 0xff prefixed with '0x' each, e.g. '0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 0x5e 0xca 0xb3 0x93'. Alternatively a shorter form can be used: 16 hexadecimal numbers between 0x00 and 0xff without the '0x' prefixes and without the spaces, e.g. '41da7366d9cfb21eae78ebb45ecab393'.
If splitting is used then the first file is linked to the SID given with --link-to-previous and the last file is linked to the SID given with --link-to-next. If splitting is not used then the one output file will be linked to both of the two SIDs.
СТОЙНОСТИ ПО ПОДРАЗБИРАНЕ¶
Спецификацията на Matroska(TM) казва, че някои елементи имат стойност по подразбиране. Обикновено елемент, чиято стойност е равна на тази по подразбиране, не бива записван във файла, за да се спести място. Елементите, които потребителят може да пропусне в информацията от mkvinfo(1), са език и флаг „пътечка по подразбиране“. Стойността по подразбиране за език е английски („eng“), стойността по подразбиране за флаг „пътечка по подразбиране“ е true. Ето защо, ако се използва --language 0:eng за пътечка, то тя няма да се появи в изхода на mkvinfo(1).
ПРИКАЧЕНИ ФАЙЛОВЕ¶
Maybe you also want to keep some photos along with your Matroska(TM) file, or you're using SSA subtitles and need a special TrueType(TM) font that's really rare. In these cases you can attach those files to the Matroska(TM) file. They will not be just appended to the file but embedded in it. A player can then show those files (the 'photos' case) or use them to render the subtitles (the 'TrueType(TM) fonts' case).
Here's an example how to attach a photo and a TrueType(TM) font to the output file:
$ 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
If a Matroska(TM) containing attachments file is used as an input file then mkvmerge(1) will copy the attachments into the new file. The selection which attachments are copied and which are not can be changed with the options --attachments and --no-attachments.
ЕПИЗОДИ (chapters)¶
The Matroska(TM) chapter system is more powerful than the old known system used by OGM files. The full specifications can be found at the Matroska(TM) website[1].
mkvmerge(1) supports two kinds of chapter files as its input. The first format, called 'simple chapter format', is the same format that the OGM tools expect. The second format is a XML based chapter format which supports all of Matroska(TM)'s chapter functionality.
Apart from dedicated chapter files mkvmerge(1) can also read chapters from other file formats (e.g. MP4, Ogg, Blu-rays or DVDs).
Простият формат за епизоди¶
This format consists of pairs of lines that start with 'CHAPTERxx=' and 'CHAPTERxxNAME=' respectively. The first one contains the start timestamp while the second one contains the title. Here's an example:
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.
As this is a text file character set conversion may need to be done. See the section about text files and character sets for an explanation how mkvmerge(1) converts between character sets.
XML-базирания файлов формат за епизоди¶
XML-базираният файлов формат за епизоди изглежда по следния начин:
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Chapters SYSTEM "matroskachapters.dtd"> <Chapters>
<EditionEntry>
<ChapterAtom>
<ChapterTimeStart>00:00:30.000</ChapterTimeStart>
<ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
<ChapterDisplay>
<ChapterString>Кратък епизод</ChapterString>
<ChapterLanguage>bul</ChapterLanguage>
</ChapterDisplay>
<ChapterAtom>
<ChapterTimeStart>00:00:46.000</ChapterTimeStart>
<ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
<ChapterDisplay>
<ChapterString>Част от този кратък епизод</ChapterString>
<ChapterLanguage>bul</ChapterLanguage>
</ChapterDisplay>
</ChapterAtom>
</ChapterAtom>
</EditionEntry> </Chapters>
With this format three things are possible that are not possible with the simple chapter format:
The mkvtoolnix distribution contains some sample files in the doc subdirectory which can be used as a basis.
The following lists the supported XML tags, their data types and, where appropriate, the valid range for their values:
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/bluray-ове/BigBuckBunny/BDMV/PLAYLIST/00001.mpls
Четене на епизоди от DVD-та¶
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.
Пример: --chapters /srv/dvd-та/BigBuckBunny/VIDEO_TS:2
Общи бележки¶
When splitting files mkvmerge(1) will correctly adjust the chapters as well. This means that each file only includes the chapter entries that apply to it, and that the timestamps will be offset to match the new timestamps of each output file.
mkvmerge(1) is able to copy chapters from Matroska(TM) source files unless this is explicitly disabled with the --no-chapters option. The chapters from all sources (Matroska(TM) files, Ogg files, MP4 files, chapter text files) are usually not merged but end up in separate ChapterEditions. Only if chapters are read from several Matroska(TM) or XML files that share the same edition UIDs will chapters be merged into a single ChapterEdition. If such a merge is desired in other situations as well then the user has to extract the chapters from all sources with mkvextract(1) first, merge the XML files manually and mux them afterwards.
ТАГОВЕ¶
Въведение¶
Системата за тагове на Matroska(TM)'s е подобна на тази на другите контейнери: набор от КЛЮЧ=СТОЙНОСТ двойки. Обаче, при Matroska(TM) тези тагове могат да бъдат вложени – и КЛЮЧ и СТОЙНОСТ са си самостоятелни елементи. Примерният файл example-tags-2.xml показва как се използва тази система.
Обсег на таговете¶
Matroska(TM) tags do not automatically apply to the complete file. They can, but they also may apply to different parts of the file: to one or more tracks, to one or more chapters, or even to a combination of both. The Matroska(TM) specification[5] gives more details about this fact.
One important fact is that tags are linked to tracks or chapters with the Targets Matroska(TM) tag element, and that the UIDs used for this linking are not the track IDs mkvmerge(1) uses everywhere. Instead the numbers used are the UIDs which mkvmerge(1) calculates automatically (if the track is taken from a file format other than Matroska(TM)) or which are copied from the source file if the track's source file is a Matroska(TM) file. Therefore it is difficult to know which UIDs to use in the tag file before the file is handed over to mkvmerge(1).
mkvmerge(1) knows two options with which you can add tags to Matroska(TM) files: The --global-tags and the --tags options. The difference is that the former option, --global-tags, will make the tags apply to the complete file by removing any of those Targets elements mentioned above. The latter option, --tags, automatically inserts the UID that mkvmerge(1) generates for the tag specified with the TID part of the --tags option.
Пример¶
Let's say that you want to add tags to a video track read from an AVI. mkvmerge --identify file.avi tells you that the video track's ID (do not mix this ID with the UID!) is 0. So you create your tag file, leave out all Targets elements and call mkvmerge(1):
$ mkvmerge -o file.mkv --tags 0:tags.xml file.avi
Файлов формат за тагове¶
mkvmerge(1) supports a XML based tag file format. The format is very closely modeled after the Matroska(TM) specification[5]. Both the binary and the source distributions of MKVToolNix come with a sample file called example-tags-2.xml which simply lists all known tags and which can be used as a basis for real life tag files.
Основните неща са:
Типове данни¶
The new Matroska(TM) tagging system only knows two data types, a UTF-8 string and a binary type. The first is used for the tag's name and the <String> element while the binary type is used for the <Binary> element.
As binary data itself would not fit into a XML file mkvmerge(1) supports two other methods of storing binary data. If the contents of a XML tag starts with '@' then the following text is treated as a file name. The corresponding file's content is copied into the Matroska(TM) element.
Otherwise the data is expected to be Base64 encoded. This is an encoding that transforms binary data into a limited set of ASCII characters and is used e.g. in email programs. mkvextract(1) will output Base64 encoded data for binary elements.
The deprecated tagging system knows some more data types which can be found in the official Matroska(TM) tag specs. As mkvmerge(1) does not support this system anymore these types aren't described here.
Известни тагове за XML файловия формат¶
The following lists the supported XML tags, their data types and, where appropriate, the valid range for their values:
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)
ИНФОРМАЦИЯ ЗА СЕГМЕНТА¶
With a segment info XML file it is possible to set certain values in the "segment information" header field of a Matroska(TM) file. All of these values cannot be set via other command line options.
Other "segment information" header fields can be set via command line options but not via the XML file. This includes e.g. the --title and the --timestamp-scale options.
There are other elements that can be set neither via command line options nor via the XML files. These include the following elements: DateUTC (also known as the "muxing date"), MuxingApp, WritingApp and Duration. They're always set by mkvmerge(1) itself.
The following lists the supported XML tags, their data types and, where appropriate, the valid range for their values:
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) ФАЙЛОВЕ¶
The Matroska(TM) file layout is quite flexible. mkvmerge(1) will render a file in a predefined way. The resulting file looks like this:
[EBML head] [segment {meta seek #1} [segment information] [track information] {attachments} {chapters} [cluster 1] {cluster 2} ... {cluster n} {cues} {meta seek #2} {tags}]
The elements in curly braces are optional and depend on the contents and options used. A couple of notes:
The shortest possible Matroska(TM) file would look like this:
[EBML head] [segment [segment information] [track information] [cluster 1]]
This might be the case for audio-only files.
ВЪНШНИ ФАЙЛОВЕ С ВРЕМЕВИ КЛЕЙМА¶
mkvmerge(1) allows the user to chose the timestamps for a specific track himself. This can be used in order to create files with variable frame rate video or include gaps in audio. A frame in this case is the unit that mkvmerge(1) creates separately per Matroska(TM) block. For video this is exactly one frame, for audio this is one packet of the specific audio type. E.g. for AC-3 this would be a packet containing 1536 samples.
Timestamp files that are used when tracks are appended to each other must only be specified for the first part in a chain of tracks. For example if you append two files, v1.avi and v2.avi, and want to use timestamps then your command line must look something like this:
$ mkvmerge ... --timestamps 0:my_timestamps.txt v1.avi +v2.avi
Съществуват четири формата, които mkvmerge(1) разпознава. Първият ред винаги съдържа номера на версията. Празни редове, редове съдържащи единствено шпации и редове започващи с „#“ се игнорират.
Файлов формат с времеви клейма v1¶
This format starts with the version line. The second line declares the default number of frames per second. All following lines contain three numbers separated by commas: the start frame (0 is the first frame), the end frame and the number of frames in this range. The FPS is a floating point number with the dot '.' as the decimal point. The ranges can contain gaps for which the default FPS is used. An example:
# timestamp format v1 assume 27.930 800,1000,25 1500,1700,30
Файлов формат с времеви клейма v2¶
In this format each line contains a timestamp for the corresponding frame. This timestamp must be given in millisecond precision. It can be a floating point number, but it doesn't have to be. You have to give at least as many timestamp lines as there are frames in the track. The timestamps in this file must be sorted. Example for 25fps:
# timestamp format v2 0 40 80
Файлов формат с времеви клейма v3¶
In this format each line contains a duration in seconds followed by an optional number of frames per second. Both can be floating point numbers. If the number of frames per second is not present the default one is used. For audio you should let the codec calculate the frame timestamps itself. For that you should be using 0.0 as the number of frames per second. You can also create gaps in the stream by using the 'gap' keyword followed by the duration of the gap. Example for an audio file:
# timestamp format v3 assume 0.0 25.325 7.530,38.236 gap, 10.050 2.000,38.236
Файлов формат с времеви клейма v4¶
Този формат е идентичен на v2 формата. Единствената разлика е, че времевите клейма не е нужно да се сортират. Този формат почти никога не трябва да се използва.
КОДОВЕ ЗА ИЗХОД¶
mkvmerge(1) завършва с един от следните три изходни кода:
ПРОМЕНЛИВИ НА СРЕДАТА¶
mkvmerge(1) използва променливите по подразбиране, определящи езиковата променлива на системата (например LANG и от групата LC_*). Допълнителни променливи:
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG and its short form MTX_DEBUG
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE and its short form MTX_ENGAGE
ВИЖ СЪЩО¶
mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1)
УЕБСАЙТ¶
Най-новата версия винаги може да бъде намерена на началната страница на MKVToolNix[6].
АВТОР¶
Мориц Бънкас <moritz@bunkus.org>
ЗАБЕЛЕЖКИ¶
- 1.
- уебсайта на Matroska(TM)
- 2.
- the IANA homepage
- 3.
- mkvmerge-identification-output-schema-v20.json
- 4.
- RFC 7159
- 5.
- Matroska(TM) specification
- 6.
- началната страница на MKVToolNix
2024-10-19 | MKVToolNix 88.0 |