mkvpropedit(1) | Команды пользователя | mkvpropedit(1) |
mkvpropedit - Изменяет свойства существующих файлов Matroska без сложного ремультиплексирования
mkvpropedit [параметры] {имя-исходного-файла} {действия}
This program analyses an existing Matroska file and modifies some of its properties. Then it writes those modifications to the existing file. Among the properties that can be changed are the segment information elements (e.g. the title) and the track headers (e.g. the language code, 'default track' flag or the name).
Параметры:
-l, --list-property-names
-p, --parse-mode режим
Действия для работы с дорожками и свойствами информационных сегментов:
-e, --edit selector
По умолчанию mkvpropedit(1) будет править секцию информации о сегменте.
Смотрите секцию редактирование селекторов для полного описания синтаксиса.
-a, --add name=значение
-s, --set name=значение
-d, --delete name
Действия для работы с тегами и главами:
-t, --tags selector:имя-файла
The selector must be one of the words all, global or track. For all mkvpropedit(1) will replace or remove all tags in a file. With global only global tags will be replaced or removed.
With track mkvpropedit(1) will replace tags for a specific track. Additionally the tags read from filename will be assigned to the same track. The track is specified in the same way edit selectors are specified (see below), e.g. --tags track:a1:new-audio-tags.xml.
--add-track-statistics-tags
--delete-track-statistics-tags
-c, --chapters имя-файла
Действия для обработки вложений:
--add-attachment имя-файла
If the option --attachment-name has been used prior to this option then its value is used as the new attachment's name. Otherwise it is derived from filename.
If the option --attachment-mime-type has been used prior to this option then its value is used as the new attachment's MIME type. Otherwise it is auto-detected from the content of filename.
If the option --attachment-description has been used prior to this option then its value is used as the new attachment's description. Otherwise no description will be set.
If the option --attachment-uid has been used prior to this option then its value is used as the new attachment's UID. Otherwise a random UID will be generated automatically.
--replace-attachment селектор:имя-файла
The selector can have one of four forms. They're explained below in the section attachment selectors.
If the option --attachment-name has been used prior to this option then its value is set as the new name for each modified attachment. Otherwise the names aren't changed.
If the option --attachment-mime-type has been used prior to this option then its value is set as the new MIME type for each modified attachment. Otherwise the MIME types aren't changed.
If the option --attachment-description has been used prior to this option then its value is set as the new description for each modified attachment. Otherwise the descriptions aren't changed.
If the option --attachment-uid has been used prior to this option then its value is set as the new UID for each modified attachment. Otherwise the UIDs aren't changed.
--update-attachment селектор
The selector can have one of four forms. They're explained below in the section attachment selectors.
If the option --attachment-name has been used prior to this option then its value is set as the new name for each modified attachment. Otherwise the names aren't changed.
If the option --attachment-mime-type has been used prior to this option then its value is set as the new MIME type for each modified attachment. Otherwise the MIME types aren't changed.
If the option --attachment-description has been used prior to this option then its value is set as the new description for each modified attachment. Otherwise the descriptions aren't changed.
If the option --attachment-uid has been used prior to this option then its value is set as the new UID for each modified attachment. Otherwise the UIDs aren't changed.
--delete-attachment селектор
The selector can have one of four forms. They're explained below in the section attachment selectors.
Параметры действий над вложениями:
--attachment-name имя
--attachment-mime-type тип-mime
--attachment-description описание
Прочие параметры:
--disable-language-ietf
This option does not affect changes requested via the 'language-ietf' track header property.
--command-line-charset кодировка
--output-charset кодировка
-r, --redirect-output имя-файла
--ui-language код
--abort-on-warnings
--debug тематика
--engage функция
--gui-mode
-v, --verbose
-h, --help
-V, --version
@файл-параметров.json
The --edit option sets the Matroska file section (segment information or a certain track's headers) that all following add, set and delete actions operate on. This stays valid until the next --edit option is found. The argument to this option is called the edit selector.
По умолчанию mkvpropedit(1) будет править секцию информации о сегменте.
The segment information can be selected with one of these three words: 'info', 'segment_info' or 'segmentinfo'. It contains properties like the segment title or the segment UID.
Track headers can be selected with a slightly more complex selector. All variations start with 'track:'. The track header properties include elements like the language code, 'default track' flag or the track's name.
track:n
Нумерация начинается с 1.
track:tn
Нумерация начинается с 1.
track:=uid
track:@номер
Due to the nature of the track edit selectors it is possible that several selectors actually match the same track headers. In such cases all actions for those edit selectors will be combined and executed in the order in which they're given on the command line.
An attachment selector is used with the two actions --replace-attachment and --delete-attachment. It can have one of the following four forms:
The following example edits a file called 'movie.mkv'. It sets the segment title and modifies the language code of an audio and a subtitle track. Note that this example can be shortened by leaving out the first --edit option because editing the segment information element is the default for all options found before the first --edit option anyway.
$ mkvpropedit фильм.mkv --edit info --set "title=Фильм" --edit track:a1 --set language=fre --edit track:a2 --set language=ita
The second example removes the 'default track flag' from the first subtitle track and sets it for the second one. Note that mkvpropedit(1), unlike mkvmerge(1), does not set the 'default track flag' of other tracks to '0' if it is set to '1' for a different track automatically.
$ mkvpropedit фильм.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
Замена тегов во второй дорожке субтитров файла выглядит так:
$ mkvpropedit фильм.mkv --tags track:s2:new-subtitle-tags.xml
Удаление всех тегов требует указания имени файла:
$ mkvpropedit фильм.mkv --tags all:
Замена глав в файле выглядит так:
$ mkvpropedit фильм.mkv --chapters новые-главы.xml
Удаление всех глав происходит без указания имени выходного файла:
$ mkvpropedit фильм.mkv --chapters ''
Добавление файла шрифта (Arial.ttf) в виде вложения:
$ mkvpropedit фильм.mkv --add-attachment Arial.ttf
Добавление файла шрифта (89719823.ttf) в виде вложения и описание информации, что это Arial:
$ mkvpropedit фильм.mkv --attachment-name Arial.ttf --attachment-description 'Шрифт Arial в виде шрифта TrueType' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
Замена вложенного файла шрифта (Comic.ttf) другим (Arial.ttf):
$ mkvpropedit фильм.mkv --attachment-name Arial.ttf --attachment-description 'Шрифт Arial в виде шрифта TrueType' --replace-attachment name:Comic.ttf:Arial.ttf
Удаление второго вложенного файла, неважно какого именно:
$ mkvpropedit фильм.mkv --delete-attachment 2
Удаление всех вложенных шрифтов по типу MIME:
$ mkvpropedit фильм.mkv --delete-attachment mime-type:application/x-truetype-font
mkvpropedit(1) завершается с одним из трёх кодов:
For an in-depth discussion about how all tools in the MKVToolNix suite handle character set conversions, input/output encoding, command line encoding and console encoding please see the identically-named section in the mkvmerge(1) man page.
mkvpropedit(1) использует стандартные переменные, определяющие системный язык (например: LANG и семейство LC_*). Дополнительные переменные:
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG и его краткая форма MTX_DEBUG
MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE и его краткая форма MTX_ENGAGE
Последняя версия программы всегда доступна на домашней странице MKVToolNix[1].
Мориц Бункус <moritz@bunkus.org>
2021-01-04 | MKVToolNix 52.0.0 |