mkvpropedit (1) Linux Manual Page
NAME
mkvpropedit – Modify properties of existing Matroska(TM) files without a complete remux
SYNOPSIS
-
mkvpropedit[options] {source-filename} {actions}
DESCRIPTION
Options:
-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 that deal with track and segment info properties:
-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.
Actions that deal with tags and chapters:
-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 thatmkvmerge(1) reads as well.The selector must be one of the words
all,globalortrack. Forallmkvpropedit(1) will replace or remove all tags in a file. Withglobalonly global tags will be replaced or removed.With
trackmkvpropedit(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 thatmkvmerge(1) reads as well.
Actions for handling attachments:
–add-attachment filename
- Adds a new attachment from filename.
If the option
–attachment-namehas 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-typehas 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-descriptionhas been used prior to this option then its value is used as the new attachment’s description. Otherwise no description will be set.
–replace-attachment selector:filename
- Replaces one or more attachments that match selector with the file filename. If more than one existing attachment matches selector then all of their contents will be replaced by the content of filename.
The selector can have one of four forms. They’re exlained below in the section attachment selectors.
If the option
–attachment-namehas been used prior to this option then its value is used as the replaced attachment’s name. Otherwise the name is not changed.If the option
–attachment-mime-typehas been used prior to this option then its value is used as the replaced attachment’s MIME type. Otherwise the MIME type is not changed.If the option
–attachment-descriptionhas been used prior to this option then its value is used as the replaced attachment’s description. Otherwise no description is not changed.
–delete-attachment selector
- Deletes one or more attachments that match selector.
The selector can have one of four forms. They’re exlained below in the section attachment selectors.
Options for attachment actions:
–attachment-name name
- Sets the name to use for the following
–add-attachmentor–replace-attachmentoperation.
–attachment-mime-type mime-type
- Sets the MIME type to use for the following
–add-attachmentor–replace-attachmentoperation.
–attachment-description description
- Sets the description to use for the following
–add-attachmentor–replace-attachmentoperation.
Other options:
–command-line-charset character-set
- Sets the character set to convert strings given on the command line from. It defaults to the character set given by system’s current locale.
–output-charset character-set
- Sets the character set to which strings are converted that are to be output. It defaults to the character set given by system’s current locale.
-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-charsetis honored.
–ui-language code
- Forces the translations for the language code to be used (e.g. ‘de_DE’ for the German translations). It is preferable to use the environment variables LANG, LC_MESSAGES and LC_ALL though. Entering ‘list’ as the code will cause
mkvextract(1) to output a list of available translations.
–debug topic
- Turn on debugging for a specific feature. This option is only useful for developers.
–engage feature
- Turn on experimental features. A list of available features can be requested with
mkvpropedit –engage list. These features are not meant to be used in normal situations.
–gui-mode
- Turns on GUI mode. In this mode specially-formatted lines may be output that can tell a controlling GUI what’s happening. These messages follow the format ‘#GUI#message’. The message may be followed by key/value pairs as in ‘#GUI#message#key1=value1#key2=value2…’. Neither the messages nor the keys are ever translated and always output in English.
-v, –verbose
- Be verbose and show all the important Matroska(TM) elements as they’re read.
-h, –help
- Show usage information and exit.
-V, –version
- Show version information and exit.
–check-for-updates
- Checks online for new releases by downloading the URL m[blue]
http://mkvtoolnix-releases.bunkus.org/latest-release.xmlm[]. Four lines will be output in key=value style: the URL from where the information was retrieved (key version_check_url), the currently running version (key running_version), the latest release’s version (key available_version) and the download URL (key download_url).Afterwards the program exists with an exit code of 0 if no newer release is available, with 1 if a newer release is available and with 2 if an error occured (e.g. if the update information could not be retrieved).
This option is only available if the program was built with support for libcurl.
@options-file
- Reads additional command line arguments from the file options-file. Lines whose first non-whitespace character is a hash mark (‘#’) are treated as comments and ignored. White spaces at the start and end of a line will be stripped. Each line must contain exactly one option.
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 name=Comments
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.
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.
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.
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–identifyoption outputs.Numbering starts at 1.
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–identifyoption outputs.Numbering starts at 1.
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).
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.
ATTACHMENT SELECTORS
An attachment selector is used with the two actions –replace-attachment and –delete-attachment. It can have one of the following four forms:
- 1. Selection by attachment ID. In this form the selector is simply a number, the attachment’s ID as output by
mkvmerge(1)’s identification command.
- 2. Selection by attachment UID (unique ID). In this form the selector is the equal sign = followed by a number, the attachment’s unique ID as output by
mkvmerge(1)’s verbose identification command.
- 3. Selection by attachment name. In this form the selector is the literal word name: followed by the existing attachment’s name. If this selector is used with
–replace-attachmentthen colons within the name to match must be escaped as
