2009-12-26 21:16:03 +00:00
'\" t
2009-08-16 11:33:27 +00:00
. \" Title: mkvpropedit
. \" Author: Moritz Bunkus <moritz@bunkus.org>
2010-05-26 15:30:20 +00:00
. \" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
2012-04-06 16:28:41 +00:00
. \" Date: 2012-04-06
2009-08-16 11:33:27 +00:00
. \" Manual: User Commands
2012-04-06 16:28:41 +00:00
. \" Source: MKVToolNix 5.5.0
2009-12-26 21:16:03 +00:00
. \" Language: English
2009-08-16 11:33:27 +00:00
. \"
2012-04-06 16:28:41 +00:00
.TH "MKVPROPEDIT" "1" "2012\-04\-06" "MKVToolNix 5\&.5\&.0" "User Commands"
2009-12-26 21:16:03 +00:00
. \" -----------------------------------------------------------------
2010-05-26 15:30:20 +00:00
. \" * Define some portability stuff
. \" -----------------------------------------------------------------
. \" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
. \" http://bugs.debian.org/507673
. \" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
. \" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n (.g .ds Aq \(aq
.el .ds Aq '
. \" -----------------------------------------------------------------
2009-12-26 21:16:03 +00:00
. \" * set default formatting
. \" -----------------------------------------------------------------
2009-08-16 11:33:27 +00:00
. \" disable hyphenation
.nh
. \" disable justification (adjust text to left margin only)
.ad l
2009-12-26 21:16:03 +00:00
. \" -----------------------------------------------------------------
. \" * MAIN CONTENT STARTS HERE *
. \" -----------------------------------------------------------------
2009-08-16 11:33:27 +00:00
.SH "NAME"
2009-12-26 21:16:03 +00:00
mkvpropedit \- Modify properties of existing Matroska(TM) files without a complete remux
2009-08-16 11:33:27 +00:00
.SH "SYNOPSIS"
2009-12-26 21:16:03 +00:00
.HP \w '\fBmkvpropedit\fR\ 'u
2009-08-16 11:33:27 +00:00
\fB mkvpropedit\fR [options] {source\- filename} {actions}
.SH "DESCRIPTION"
.PP
This program analyses an existing
Matroska(TM)
2010-05-26 15:30:20 +00:00
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, \* (Aqdefault track\* (Aq flag or the name)\& .
2009-08-16 11:33:27 +00:00
.PP
Options:
.PP
\fB \- l\fR , \fB \- \- list\- property\- names\fR
.RS 4
Lists all known and editable property names, their type (string, integer, boolean etc) and a short description\& . The program exits afterwards\& . Therefore the
\fI source\- filename\fR
parameter does not have to be supplied\& .
.RE
.PP
\fB \- p\fR , \fB \- \- parse\- mode\fR \fI mode\fR
.RS 4
2010-05-26 15:30:20 +00:00
Sets the parse mode\& . The parameter \* (Aq\fI mode\fR \* (Aq can either be \* (Aqfast\* (Aq (which is also the default) or \* (Aqfull\* (Aq\& . The \* (Aqfast\* (Aq 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 \* (Aqfull\* (Aq parse mode\& . A full scan of a file can take a couple of minutes while a fast scan only takes seconds\& .
2009-08-16 11:33:27 +00:00
.RE
.PP
Actions:
.PP
\fB \- e\fR , \fB \- \- edit\fR \fI selector\fR
.RS 4
Sets the
Matroska(TM)
2010-05-26 15:30:20 +00:00
file section (segment information or a certain track\* (Aqs headers) that all following
2009-08-16 11:33:27 +00:00
add,
set
and
delete
actions operate on\& . This option can be used multiple times in order to make modifications to more than one element\& .
.sp
2010-11-18 10:25:09 +00:00
By default
\fB mkvpropedit\fR (1)
will edit the segment information section\& .
.sp
2009-08-16 11:33:27 +00:00
See the section about
edit selectors
for a full description of the syntax\& .
.RE
.PP
\fB \- a\fR , \fB \- \- add\fR \fI name\fR =\fI value\fR
.RS 4
Adds a property
\fI name\fR
with the value
\fI value\fR \& . The property will be added even if such a property exists already\& . Note that most properties are unique and cannot occur more than once\& .
.RE
.PP
\fB \- s\fR , \fB \- \- set\fR \fI name\fR =\fI value\fR
.RS 4
2010-03-29 11:39:24 +00:00
Sets all occurrences of the property
2009-08-16 11:33:27 +00:00
\fI name\fR
to the value
\fI value\fR \& . If no such property exists then it will be added\& .
.RE
.PP
\fB \- d\fR , \fB \- \- delete\fR \fI name\fR
.RS 4
2010-03-29 11:39:24 +00:00
Deletes all occurrences of the property
2009-08-16 11:33:27 +00:00
\fI name\fR \& . Note that some properties are required and cannot be deleted\& .
.RE
.PP
2011-02-15 07:38:59 +00:00
\fB \- t\fR , \fB \- \- tags\fR \fI selector\fR :\fI filename\fR
.RS 4
Add or replace tags in the file with the ones from
filename
or remove them if
filename
is empty\& .
\fB mkvpropedit\fR (1)
reads the same XML tag format that
\fB mkvmerge\fR (1)
reads as well\& .
.sp
The
\fI selector\fR
must be one of the words
\fB all\fR ,
\fB global\fR
or
\fB track\fR \& . For
\fB all\fR
\fB mkvpropedit\fR (1)
will replace or remove all tags in a file\& . With
\fB global\fR
only global tags will be replaced or removed\& .
.sp
With
\fB track\fR
\fB mkvpropedit\fR (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\& .
.RE
.PP
2011-05-11 19:41:07 +00:00
\fB \- c\fR , \fB \- \- chapters\fR \fI filename\fR
.RS 4
Add or replace chapters in the file with the ones from
filename
or remove them if
filename
is empty\& .
\fB mkvpropedit\fR (1)
reads the same XML and simple chapter formats that
\fB mkvmerge\fR (1)
reads as well\& .
.RE
.PP
2009-08-16 11:33:27 +00:00
Other options:
.PP
\fB \- \- command\- line\- charset\fR \fI character\- set\fR
.RS 4
2010-05-26 15:30:20 +00:00
Sets the character set to convert strings given on the command line from\& . It defaults to the character set given by system\* (Aqs current locale\& .
2009-08-16 11:33:27 +00:00
.RE
.PP
\fB \- \- output\- charset\fR \fI character\- set\fR
.RS 4
2010-05-26 15:30:20 +00:00
Sets the character set to which strings are converted that are to be output\& . It defaults to the character set given by system\* (Aqs current locale\& .
2009-08-16 11:33:27 +00:00
.RE
.PP
\fB \- r\fR , \fB \- \- redirect\- output\fR \fI file\- name\fR
.RS 4
Writes all messages to the file
\fI file\- name\fR
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
\fB \- \- output\- charset\fR
is honored\& .
.RE
.PP
\fB \- \- ui\- language\fR \fI code\fR
.RS 4
Forces the translations for the language
\fI code\fR
2010-05-26 15:30:20 +00:00
to be used (e\& .g\& . \* (Aqde_DE\* (Aq for the German translations)\& . It is preferable to use the environment variables
2009-08-16 11:33:27 +00:00
\fI LANG\fR ,
\fI LC_MESSAGES\fR
and
\fI LC_ALL\fR
2010-05-26 15:30:20 +00:00
though\& . Entering \* (Aqlist\* (Aq as the
2009-08-16 11:33:27 +00:00
\fI code\fR
will cause
\fB mkvextract\fR (1)
to output a list of available translations\& .
.RE
.PP
2012-02-25 11:44:18 +00:00
\fB \- \- debug\fR \fI topic\fR
.RS 4
Turn on debugging for a specific feature\& . This option is only useful for developers\& .
.RE
.PP
\fB \- \- engage\fR \fI feature\fR
.RS 4
Turn on experimental features\& . A list of available features can be requested with
\fB mkvpropedit \- \- engage list\fR \& . These features are not meant to be used in normal situations\& .
.RE
.PP
2009-08-16 11:33:27 +00:00
\fB \- v\fR , \fB \- \- verbose\fR
.RS 4
Be verbose and show all the important
Matroska(TM)
2010-05-26 15:30:20 +00:00
elements as they\* (Aqre read\& .
2009-08-16 11:33:27 +00:00
.RE
.PP
\fB \- h\fR , \fB \- \- help\fR
.RS 4
Show usage information and exit\& .
.RE
.PP
\fB \- V\fR , \fB \- \- version\fR
.RS 4
Show version information and exit\& .
2010-12-23 15:07:34 +00:00
.RE
.PP
\fB \- \- check\- for\- updates\fR
.RS 4
Checks online for new releases by downloading the URL
2010-12-26 00:50:33 +00:00
http://mkvtoolnix\- releases\& .bunkus\& .org/latest\- release\& .xml\& . Four lines will be output in
2010-12-23 15:07:34 +00:00
key=value
style: the URL from where the information was retrieved (key
version_check_url), the currently running version (key
2010-12-26 00:50:33 +00:00
running_version), the latest release\* (Aqs version (key
available_version) and the download URL (key
download_url)\& .
2010-12-23 15:07:34 +00:00
.sp
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)\& .
.sp
This option is only available if the program was built with support for libcurl\& .
2009-08-16 11:33:27 +00:00
.RE
.PP
2011-11-06 16:58:35 +00:00
\fB @\fR \fI options\- file\fR
2009-08-16 11:33:27 +00:00
.RS 4
Reads additional command line arguments from the file
2010-12-20 19:12:59 +00:00
\fI options\- file\fR \& . Lines whose first non\- whitespace character is a hash mark (\* (Aq#\* (Aq) 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\& .
.sp
Several chars can be escaped, e\& .g\& . if you need to start a non\- comment line with \* (Aq#\* (Aq\& . The rules are described in
the section about escaping text\& .
2009-08-16 11:33:27 +00:00
.sp
2010-05-26 15:30:20 +00:00
The command line \* (Aq\fB mkvpropedit source\& .mkv \- \- edit track:a2 \- \- set name=Comments\fR \* (Aq could be converted into the following option file:
2009-08-16 11:33:27 +00:00
.sp
2009-12-26 21:16:03 +00:00
.if n \{ \
2009-08-16 11:33:27 +00:00
.RS 4
2009-12-26 21:16:03 +00:00
. \}
2009-08-16 11:33:27 +00:00
.nf
# Modify source\& .mkv
source\& .mkv
# Edit the second audio track
\- \- edit
track:a2
2010-05-26 15:30:20 +00:00
# and set the title to \* (AqComments\* (Aq
2009-08-16 11:33:27 +00:00
\- \- set
title=Comments
.fi
2009-12-26 21:16:03 +00:00
.if n \{ \
2009-08-16 11:33:27 +00:00
.RE
2009-12-26 21:16:03 +00:00
. \}
2009-08-16 11:33:27 +00:00
.RE
.SH "EDIT SELECTORS"
.PP
The
\fB \- \- edit\fR
option sets the
Matroska(TM)
2010-05-26 15:30:20 +00:00
file section (segment information or a certain track\* (Aqs headers) that all following
2009-08-16 11:33:27 +00:00
add,
set
and
delete
actions operate on\& . This stays valid until the next
\fB \- \- edit\fR
option is found\& . The argument to this option is called the edit selector\& .
2010-11-18 10:25:09 +00:00
.PP
By default
\fB mkvpropedit\fR (1)
will edit the segment information section\& .
2009-08-16 11:33:27 +00:00
.SS "Segment information"
.PP
2010-05-26 15:30:20 +00:00
The segment information can be selected with one of these three words: \* (Aqinfo\* (Aq, \* (Aqsegment_info\* (Aq or \* (Aqsegmentinfo\* (Aq\& . It contains properties like the segment title or the segment
2009-08-16 11:33:27 +00:00
UID\& .
.SS "Track headers"
.PP
2010-05-26 15:30:20 +00:00
Track headers can be selected with a slightly more complex selector\& . All variations start with \* (Aqtrack:\* (Aq\& . The track header properties include elements like the language code, \* (Aqdefault track\* (Aq flag or the track\* (Aqs name\& .
2009-08-16 11:33:27 +00:00
.PP
\fB track:\fR \fI n\fR
.RS 4
If the parameter
\fI n\fR
is a number then the
\fI n\fR th track will be selected\& . The track order is the same that
2010-05-26 15:30:20 +00:00
\fB mkvmerge\fR (1)\* (Aqs
2009-08-16 11:33:27 +00:00
\fB \- \- identify\fR
option outputs\& .
2012-04-24 07:57:36 +00:00
.sp
Numbering starts at 1\& .
2009-08-16 11:33:27 +00:00
.RE
.PP
\fB track:\fR \fI t\fR \fI n\fR
.RS 4
If the parameter starts with a single character
\fI t\fR
followed by a
\fI n\fR
then the
\fI n\fR th track of a specific track type will be selected\& . The track type parameter
\fI t\fR
2010-05-26 15:30:20 +00:00
must be one of these four characters: \* (Aqa\* (Aq for an audio track, \* (Aqb\* (Aq for a button track, \* (Aqs\* (Aq for a subtitle track and \* (Aqv\* (Aq for a video track\& . The track order is the same that
\fB mkvmerge\fR (1)\* (Aqs
2009-08-16 11:33:27 +00:00
\fB \- \- identify\fR
option outputs\& .
2012-04-24 07:57:36 +00:00
.sp
Numbering starts at 1\& .
2009-08-16 11:33:27 +00:00
.RE
.PP
\fB track:\fR =\fI uid\fR
.RS 4
2010-05-26 15:30:20 +00:00
If the parameter starts with a \* (Aq=\* (Aq followed by a number
2009-08-16 11:33:27 +00:00
\fI uid\fR
then the track whose track
UID
element equals this
\fI uid\fR \& . Track
UIDs
can be obtained with
\fB mkvinfo\fR (1)\& .
.RE
.PP
\fB track:\fR @\fI number\fR
.RS 4
2010-05-26 15:30:20 +00:00
If the parameter starts with a \* (Aq@\* (Aq followed by a number
2009-08-16 11:33:27 +00:00
\fI number\fR
then the track whose track number element equals this
\fI number\fR \& . Track number can be obtained with
\fB mkvinfo\fR (1)\& .
.RE
.SS "Notes"
.PP
2010-05-26 15:30:20 +00:00
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\* (Aqre given on the command line\& .
2009-08-16 11:33:27 +00:00
.SH "EXAMPLES"
.PP
2010-05-26 15:30:20 +00:00
The following example edits a file called \* (Aqmovie\& .mkv\* (Aq\& . 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
2009-08-16 11:33:27 +00:00
\fB \- \- edit\fR
option because editing the segment information element is the default for all options found before the first
\fB \- \- edit\fR
option anyway\& .
.sp
2009-12-26 21:16:03 +00:00
.if n \{ \
2009-08-16 11:33:27 +00:00
.RS 4
2009-12-26 21:16:03 +00:00
. \}
2009-08-16 11:33:27 +00:00
.nf
$ mkvpropedit movie\& .mkv \- \- edit info \- \- set "title=The movie" \- \- edit track:a1 \- \- set language=fre \- \- edit track:a2 \- \- set language=ita
2010-02-08 07:56:26 +00:00
.fi
.if n \{ \
.RE
. \}
.PP
2010-05-26 15:30:20 +00:00
The second example removes the \* (Aqdefault track flag\* (Aq from the first subtitle track and sets it for the second one\& . Note that
2010-02-08 07:56:26 +00:00
\fB mkvpropedit\fR (1), unlike
2010-05-26 15:30:20 +00:00
\fB mkvmerge\fR (1), does not set the \* (Aqdefault track flag\* (Aq of other tracks to \* (Aq0\* (Aq if it is set to \* (Aq1\* (Aq for a different track automatically\& .
2010-02-08 07:56:26 +00:00
.sp
.if n \{ \
.RS 4
. \}
.nf
2010-09-24 06:53:17 +00:00
$ mkvpropedit movie\& .mkv \- \- edit track:s1 \- \- set flag\- default=0 \- \- edit track:s2 \- \- set flag\- default=1
2011-02-15 07:38:59 +00:00
.fi
.if n \{ \
.RE
. \}
.PP
Replacing the tags for the second subtitle track in a file looks like this:
.sp
.if n \{ \
.RS 4
. \}
.nf
$ mkvpropedit movie\& .mkv \- \- tags track:s2:new\- subtitle\- tags\& .xml
.fi
.if n \{ \
.RE
. \}
.PP
Removing all tags requires leaving out the file name:
.sp
.if n \{ \
.RS 4
. \}
.nf
$ mkvpropedit movie\& .mkv \- \- tags all:
2011-05-11 19:41:07 +00:00
.fi
.if n \{ \
.RE
. \}
.PP
Replacing the chapters in a file looks like this:
.sp
.if n \{ \
.RS 4
. \}
.nf
$ mkvpropedit movie\& .mkv \- \- chapters new\- chapters\& .xml
.fi
.if n \{ \
.RE
. \}
.PP
Removing all chapters requires leaving out the file name:
.sp
.if n \{ \
.RS 4
. \}
.nf
$ mkvpropedit movie\& .mkv \- \- chapters \* (Aq\* (Aq
2009-08-16 11:33:27 +00:00
.fi
2009-12-26 21:16:03 +00:00
.if n \{ \
2009-08-16 11:33:27 +00:00
.RE
2009-12-26 21:16:03 +00:00
. \}
2009-08-16 11:33:27 +00:00
.SH "EXIT CODES"
.PP
\fB mkvpropedit\fR (1)
exits with one of three exit codes:
.sp
.RS 4
2009-12-26 21:16:03 +00:00
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2009-08-16 11:33:27 +00:00
\fB 0\fR
\- \- This exit codes means that the modification has completed successfully\& .
.RE
.sp
.RS 4
2009-12-26 21:16:03 +00:00
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2009-08-16 11:33:27 +00:00
\fB 1\fR
\- \- In this case
\fB mkvpropedit\fR (1)
2010-05-26 15:30:20 +00:00
has output at least one warning, but the modification did continue\& . A warning is prefixed with the text \* (AqWarning:\* (Aq\& . Depending on the issues involved the resulting files might be ok or not\& . The user is urged to check both the warning and the resulting files\& .
2009-08-16 11:33:27 +00:00
.RE
.sp
.RS 4
2009-12-26 21:16:03 +00:00
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2009-08-16 11:33:27 +00:00
\fB 2\fR
2010-03-29 11:39:24 +00:00
\- \- This exit code is used after an error occurred\& .
2009-08-16 11:33:27 +00:00
\fB mkvpropedit\fR (1)
aborts right after outputting the error message\& . Error messages range from wrong command line arguments over read/write errors to broken files\& .
.RE
2010-12-20 19:12:59 +00:00
.SH "ESCAPING SPECIAL CHARS IN TEXT"
.PP
There are a few places in which special characters in text must or should be escaped\& . The rules for escaping are simple: each character that needs escaping is replaced with a backslash followed by another character\& .
.PP
2011-11-06 16:58:35 +00:00
The rules are: \* (Aq \* (Aq (a space) becomes \* (Aq\e s\* (Aq, \* (Aq"\* (Aq (double quotes) becomes \* (Aq\e 2\* (Aq, \* (Aq:\* (Aq becomes \* (Aq\e c\* (Aq, \* (Aq#\* (Aq becomes \* (Aq\e h\* (Aq and \* (Aq\e \* (Aq (a single backslash) itself becomes \* (Aq\e \e \* (Aq\& .
2012-02-25 11:44:18 +00:00
.SH "ENVIRONMENT VARIABLES"
.PP
\fB mkvpropedit\fR (1)
uses the default variables that determine the system\* (Aqs locale (e\& .g\& .
\fI LANG\fR
and the
\fI LC_*\fR
family)\& . Additional variables:
.PP
\fI MKVTOOLNIX_DEBUG\fR and its short form \fI MTX_DEBUG\fR
.RS 4
The content is treated as if it had been passed via the
\fB \- \- debug\fR
option\& .
.RE
.PP
\fI MKVTOOLNIX_ENGAGE\fR and its short form \fI MTX_ENGAGE\fR
.RS 4
The content is treated as if it had been passed via the
\fB \- \- engage\fR
option\& .
.RE
2012-02-25 14:09:02 +00:00
.PP
\fI MKVTOOLNIX_OPTIONS\fR and its short form \fI MTX_OPTIONS\fR
.RS 4
The content is split on white space\& . The resulting partial strings are treated as if it had been passed as command line options\& . If you need to pass special characters (e\& .g\& . spaces) then you have to escape them (see
the section about escaping special characters in text)\& .
.RE
2009-08-16 11:33:27 +00:00
.SH "SEE ALSO"
.PP
\fB mkvmerge\fR (1),
\fB mkvinfo\fR (1),
\fB mkvextract\fR (1),
\fB mmg\fR (1)
.SH "WWW"
.PP
The latest version can always be found at
2009-12-26 21:16:03 +00:00
\m[blue]\fBthe MKVToolNix homepage\fR\m[]\&\s-2\u[1] \d \s +2\& .
2009-08-16 11:33:27 +00:00
.SH "AUTHOR"
.PP
\fB Moritz Bunkus\fR <\& moritz@bunkus\& .org\& >
2009-12-26 21:16:03 +00:00
.RS 4
2009-08-16 11:33:27 +00:00
Developer
2009-12-26 21:16:03 +00:00
.RE
2009-08-16 11:33:27 +00:00
.SH "NOTES"
.IP " 1." 4
the MKVToolNix homepage
.RS 4
\% http://www.bunkus.org/videotools/mkvtoolnix/
.RE