mkvpropedit -- Modify properties of existing Matroska(tm) files without a complete remux

Table of contents

1. Короткий опис

mkvpropedit [options] {source-filename} {actions}

2. Опис

This program analyses an existing Matroska(tm) 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).

Options:

Option Description
-l, --list-property-names

Lists all known and editable property names, their type (string, integer, boolean etc) and a short description. The program exits afterwards. Therefore the source-filename parameter does not have to be supplied.

-p, --parse-mode mode

Sets the parse mode. The parameter 'mode' can either be 'fast' (which is also the default) or 'full'. The 'fast' mode does not parse the whole file but uses the meta seek elements for locating the required elements of a source file. In 99% of all cases this is enough. But for files that do not contain meta seek elements or which are damaged the user might have to set the 'full' parse mode. A full scan of a file can take a couple of minutes while a fast scan only takes seconds.

Actions:

Option Description
-e, --edit selector

Sets the Matroska(tm) file section (segment information or a certain track's headers) that all following add, set and delete actions operate on. This option can be used multiple times in order to make modifications to more than one element.

By default mkvpropedit(1) will edit the segment information section.

See the section about edit selectors for a full description of the syntax.

-a, --add name=value

Adds a property name with the value value. The property will be added even if such a property exists already. Note that most properties are unique and cannot occur more than once.

-s, --set name=value

Sets all occurrences of the property name to the value value. If no such property exists then it will be added.

-d, --delete name

Deletes all occurrences of the property name. Note that some properties are required and cannot be deleted.

-t, --tags selector:filename

Add or replace tags in the file with the ones from filename or remove them if filename is empty. mkvpropedit(1) reads the same XML tag format that mkvmerge(1) reads as well.

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.

-c, --chapters filename

Add or replace chapters in the file with the ones from filename or remove them if filename is empty. mkvpropedit(1) reads the same XML and simple chapter formats that mkvmerge(1) reads as well.

Other options:

Option Description
--command-line-charset character-set

Встановлює набір символів заданого в командному рядку для конвертації. Типово використовується набір символів згідно поточної локалі системи.

--output-charset character-set

Встановлює вихідний набір символів заданого в командному рядку для конвертації. Типово використовується набір символів згідно поточної локалі системи.

-r, --redirect-output file-name

Writes all messages to the file file-name instead of to the console. While this can be done easily with output redirection there are cases in which this option is needed: when the terminal reinterprets the output before writing it to a file. The character set set with --output-charset is honored.

--ui-language code

Задає примусове використання мовного перекладу code інтерфейсу (наприклад, 'de_DE' для німецького перекладу). Тому, краще використовувати змінні середовища LANG, LC_MESSAGES і LC_ALL. Після введення list' як code mkvextract(1) відобразить список доступних перекладів.

-v, --verbose

Задає відображення розширеної інформації про важливі елементи Matroska(tm).

-h, --help

Відображається інформація про використання додатку і відбувається завершення роботи додатку.

-V, --version

Відображається інформація про версію додатку і відбувається завершення роботи додатку.

--check-for-updates

Відбувається перевірка на наявність нової версії шляхом завантаження з URL http://mkvtoolnix-releases.bunkus.org/latest-release.xml. Буде відображено чотири рядка у key=value стилі: URL, звідки отримана інформація (key version_check_url), поточна запущена версія (key running_version), остання випущена версія (key available_version) і URL для завантаження (key download_url).

Після чого додаток завершує роботу з кодом повернення 0, якщо немає нової версії, і з кодом 2, якщо виникла помилка (наприклад, коли не було отримано інформації про оновлення взагалі).

Дана опція наявна лише тоді, коли додаток компілювався з підтримкою libcurl.

@options-file

Зчитує додаткові параметри командного рядка з файла options-file. Рядки, які містять зразу після символу переносу рядка мітку хеша ('#') сприймаються як коментарі і ігноруються. Символи переносу на початку і в кінці рядка опускаються. Кожний рядок має містити лише один параметр.

Several chars can be escaped, e.g. if you need to start a non-comment line with '#'. The rules are described in the section about escaping text.

The command line 'mkvpropedit source.mkv --edit track:a2 --set name=Comments' could be converted into the following option file:

# Modify source.mkv
source.mkv
# Edit the second audio track
--edit
track:a2
# and set the title to 'Comments'
--set
title=Comments

3. Edit selectors

The --edit option sets the Matroska(tm) 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.

By default mkvpropedit(1) will edit the segment information section.

3.1. Segment information

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.

3.2. Track headers

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.

Option Description
track:n

If the parameter n is a number then the nth track will be selected. The track order is the same that mkvmerge(1)'s --identify option outputs.

track:tn

If the parameter starts with a single character t followed by a n then the nth track of a specific track type will be selected. The track type parameter t must be one of these four characters: 'a' for an audio track, 'b' for a button track, 's' for a subtitle track and 'v' for a video track. The track order is the same that mkvmerge(1)'s --identify option outputs.

track:=uid

If the parameter starts with a '=' followed by a number uid then the track whose track UID element equals this uid. Track UIDs can be obtained with mkvinfo(1).

track:@number

If the parameter starts with a '@' followed by a number number then the track whose track number element equals this number. Track number can be obtained with mkvinfo(1).

3.3. Notes

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.

4. Examples

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 movie.mkv --edit info --set "title=The movie" --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 movie.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1

Replacing the tags for the second subtitle track in a file looks like this:

$ mkvpropedit movie.mkv --tags track:s2:new-subtitle-tags.xml

Removing all tags requires leaving out the file name:

$ mkvpropedit movie.mkv --tags all:

Replacing the chapters in a file looks like this:

$ mkvpropedit movie.mkv --chapters new-chapters.xml

Removing all chapters requires leaving out the file name:

$ mkvpropedit movie.mkv --chapters ''

5. Коди завершення

mkvpropedit(1) exits with one of three exit codes:

6. Виокремлення спеціальних символів у тексті

Є декілька місць, де спеціальні символи у тексті мають або повинні бути виокремлені. Правила для виокремлювання прості: кожен символ, що потребує виокремлення, замінюється на зворотній слеш з деяким символом, що йде після нього.

The rules are: ' ' (a space) becomes '\s', '"' (double quotes) becomes '\2', ':' becomes '\c', '#' becomes '\h' and '\' (a single backslash) itself becomes '\\'.

7. Дивіться також

mkvmerge(1), mkvinfo(1), mkvextract(1), mmg(1)

8. WWW

Остання версія завжди може бути знайдена на веб-сторінці the MKVToolNix homepage.