1MKVPROPEDIT(1)                   User Commands                  MKVPROPEDIT(1)
2
3
4

NAME

6       mkvpropedit - Modify properties of existing Matroska(TM) files without
7       a complete remux
8

SYNOPSIS

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

DESCRIPTION

13       This program analyses an existing Matroska(TM) file and modifies some
14       of its properties. Then it writes those modifications to the existing
15       file. Among the properties that can be changed are the segment
16       information elements (e.g. the title) and the track headers (e.g. the
17       language code, 'default track' flag or the name).
18
19       Options:
20
21       -l, --list-property-names
22           Lists all known and editable property names, their type (string,
23           integer, boolean etc) and a short description. The program exits
24           afterwards. Therefore the source-filename parameter does not have
25           to be supplied.
26
27       -p, --parse-mode mode
28           Sets the parse mode. The parameter 'mode' can either be 'fast'
29           (which is also the default) or 'full'. The 'fast' mode does not
30           parse the whole file but uses the meta seek elements for locating
31           the required elements of a source file. In 99% of all cases this is
32           enough. But for files that do not contain meta seek elements or
33           which are damaged the user might have to set the 'full' parse mode.
34           A full scan of a file can take a couple of minutes while a fast
35           scan only takes seconds.
36
37       Actions that deal with track and segment info properties:
38
39       -e, --edit selector
40           Sets the Matroska(TM) file section (segment information or a
41           certain track's headers) that all following add, set and delete
42           actions operate on. This option can be used multiple times in order
43           to make modifications to more than one element.
44
45           By default mkvpropedit(1) will edit the segment information
46           section.
47
48           See the section about edit selectors for a full description of the
49           syntax.
50
51       -a, --add name=value
52           Adds a property name with the value value. The property will be
53           added even if such a property exists already. Note that most
54           properties are unique and cannot occur more than once.
55
56       -s, --set name=value
57           Sets all occurrences of the property name to the value value. If no
58           such property exists then it will be added.
59
60       -d, --delete name
61           Deletes all occurrences of the property name. Note that some
62           properties are required and cannot be deleted.
63
64       Actions that deal with tags and chapters:
65
66       -t, --tags selector:filename
67           Add or replace tags in the file with the ones from filename or
68           remove them if filename is empty.  mkvpropedit(1) reads the same
69           XML tag format that mkvmerge(1) reads as well.
70
71           The selector must be one of the words all, global or track. For all
72           mkvpropedit(1) will replace or remove all tags in a file. With
73           global only global tags will be replaced or removed.
74
75           With track mkvpropedit(1) will replace tags for a specific track.
76           Additionally the tags read from filename will be assigned to the
77           same track. The track is specified in the same way edit selectors
78           are specified (see below), e.g.  --tags
79           track:a1:new-audio-tags.xml.
80
81       --add-track-statistics-tags
82           Calculates statistics for all tracks in a file and adds new
83           statistics tags for them. If the file already contains such tags
84           then they'll be updated.
85
86       --delete-track-statistics-tags
87           Deletes all existing track statistics tags from a file. If the file
88           doesn't contain track statistics tags then it won't be modified.
89
90       -c, --chapters filename
91           Add or replace chapters in the file with the ones from filename or
92           remove them if filename is empty.  mkvpropedit(1) reads the same
93           XML and simple chapter formats that mkvmerge(1) reads as well.
94
95       Actions for handling attachments:
96
97       --add-attachment filename
98           Adds a new attachment from filename.
99
100           If the option --attachment-name has been used prior to this option
101           then its value is used as the new attachment's name. Otherwise it
102           is derived from filename.
103
104           If the option --attachment-mime-type has been used prior to this
105           option then its value is used as the new attachment's MIME type.
106           Otherwise it is auto-detected from the content of filename.
107
108           If the option --attachment-description has been used prior to this
109           option then its value is used as the new attachment's description.
110           Otherwise no description will be set.
111
112           If the option --attachment-uid has been used prior to this option
113           then its value is used as the new attachment's UID. Otherwise a
114           random UID will be generated automatically.
115
116       --replace-attachment selector:filename
117           Replaces one or more attachments that match selector with the file
118           filename. If more than one existing attachment matches selector
119           then all of their contents will be replaced by the content of
120           filename.
121
122           The selector can have one of four forms. They're explained below in
123           the section attachment selectors.
124
125           If the option --attachment-name has been used prior to this option
126           then its value is set as the new name for each modified attachment.
127           Otherwise the names aren't changed.
128
129           If the option --attachment-mime-type has been used prior to this
130           option then its value is set as the new MIME type for each modified
131           attachment. Otherwise the MIME types aren't changed.
132
133           If the option --attachment-description has been used prior to this
134           option then its value is set as the new description for each
135           modified attachment. Otherwise the descriptions aren't changed.
136
137           If the option --attachment-uid has been used prior to this option
138           then its value is set as the new UID for each modified attachment.
139           Otherwise the UIDs aren't changed.
140
141       --update-attachment selector
142           Sets the properties of one or more attachments that match selector.
143           If more than one existing attachment matches selector then all of
144           their properties will be updated.
145
146           The selector can have one of four forms. They're explained below in
147           the section attachment selectors.
148
149           If the option --attachment-name has been used prior to this option
150           then its value is set as the new name for each modified attachment.
151           Otherwise the names aren't changed.
152
153           If the option --attachment-mime-type has been used prior to this
154           option then its value is set as the new MIME type for each modified
155           attachment. Otherwise the MIME types aren't changed.
156
157           If the option --attachment-description has been used prior to this
158           option then its value is set as the new description for each
159           modified attachment. Otherwise the descriptions aren't changed.
160
161           If the option --attachment-uid has been used prior to this option
162           then its value is set as the new UID for each modified attachment.
163           Otherwise the UIDs aren't changed.
164
165       --delete-attachment selector
166           Deletes one or more attachments that match selector.
167
168           The selector can have one of four forms. They're explained below in
169           the section attachment selectors.
170
171       Options for attachment actions:
172
173       --attachment-name name
174           Sets the name to use for the following --add-attachment or
175           --replace-attachment operation.
176
177       --attachment-mime-type mime-type
178           Sets the MIME type to use for the following --add-attachment or
179           --replace-attachment operation.
180
181       --attachment-description description
182           Sets the description to use for the following --add-attachment or
183           --replace-attachment operation.
184
185       Other options:
186
187       --command-line-charset character-set
188           Sets the character set to convert strings given on the command line
189           from. It defaults to the character set given by system's current
190           locale.
191
192       --output-charset character-set
193           Sets the character set to which strings are converted that are to
194           be output. It defaults to the character set given by system's
195           current locale.
196
197       -r, --redirect-output file-name
198           Writes all messages to the file file-name instead of to the
199           console. While this can be done easily with output redirection
200           there are cases in which this option is needed: when the terminal
201           reinterprets the output before writing it to a file. The character
202           set set with --output-charset is honored.
203
204       --ui-language code
205           Forces the translations for the language code to be used (e.g.
206           'de_DE' for the German translations). Entering 'list' as the code
207           will cause the program to output a list of available translations.
208
209       --abort-on-warnings
210           Tells the program to abort after the first warning is emitted. The
211           program's exit code will be 1.
212
213       --debug topic
214           Turn on debugging for a specific feature. This option is only
215           useful for developers.
216
217       --engage feature
218           Turn on experimental features. A list of available features can be
219           requested with mkvpropedit --engage list. These features are not
220           meant to be used in normal situations.
221
222       --gui-mode
223           Turns on GUI mode. In this mode specially-formatted lines may be
224           output that can tell a controlling GUI what's happening. These
225           messages follow the format '#GUI#message'. The message may be
226           followed by key/value pairs as in
227           '#GUI#message#key1=value1#key2=value2...'. Neither the messages nor
228           the keys are ever translated and always output in English.
229
230       -v, --verbose
231           Be verbose and show all the important Matroska(TM) elements as
232           they're read.
233
234       -h, --help
235           Show usage information and exit.
236
237       -V, --version
238           Show version information and exit.
239
240       @options-file.json
241           Reads additional command line arguments from the file options-file.
242           For a full explanation on the supported formats for such files see
243           the section called "Option files" in the mkvmerge(1) man page.
244

EDIT SELECTORS

246       The --edit option sets the Matroska(TM) file section (segment
247       information or a certain track's headers) that all following add, set
248       and delete actions operate on. This stays valid until the next --edit
249       option is found. The argument to this option is called the edit
250       selector.
251
252       By default mkvpropedit(1) will edit the segment information section.
253
254   Segment information
255       The segment information can be selected with one of these three words:
256       'info', 'segment_info' or 'segmentinfo'. It contains properties like
257       the segment title or the segment UID.
258
259   Track headers
260       Track headers can be selected with a slightly more complex selector.
261       All variations start with 'track:'. The track header properties include
262       elements like the language code, 'default track' flag or the track's
263       name.
264
265       track:n
266           If the parameter n is a number then the nth track will be selected.
267           The track order is the same that mkvmerge(1)'s --identify option
268           outputs.
269
270           Numbering starts at 1.
271
272       track:tn
273           If the parameter starts with a single character t followed by a n
274           then the nth track of a specific track type will be selected. The
275           track type parameter t must be one of these four characters: 'a'
276           for an audio track, 'b' for a button track, 's' for a subtitle
277           track and 'v' for a video track. The track order is the same that
278           mkvmerge(1)'s --identify option outputs.
279
280           Numbering starts at 1.
281
282       track:=uid
283           If the parameter starts with a '=' followed by a number uid, the
284           track whose track UID element equals the given uid will be
285           selected. Track UIDs can be obtained with mkvinfo(1).
286
287       track:@number
288           If the parameter starts with a '@' followed by a number number, the
289           track whose track number element equals this number will be
290           selected. Track numbers can be obtained with mkvinfo(1).
291
292   Notes
293       Due to the nature of the track edit selectors it is possible that
294       several selectors actually match the same track headers. In such cases
295       all actions for those edit selectors will be combined and executed in
296       the order in which they're given on the command line.
297

ATTACHMENT SELECTORS

299       An attachment selector is used with the two actions
300       --replace-attachment and --delete-attachment. It can have one of the
301       following four forms:
302
303        1. Selection by attachment ID. In this form the selector is simply a
304           number, the attachment's ID as output by mkvmerge(1)'s
305           identification command.
306
307        2. Selection by attachment UID (unique ID). In this form the selector
308           is the equal sign = followed by a number, the attachment's unique
309           ID as output by mkvmerge(1)'s verbose identification command.
310
311        3. Selection by attachment name. In this form the selector is the
312           literal word name: followed by the existing attachment's name. If
313           this selector is used with --replace-attachment then colons within
314           the name to match must be escaped as \c.
315
316        4. Selection by MIME type. In this form the selector is the literal
317           word mime-type: followed by the existing attachment's MIME type. If
318           this selector is used with --replace-attachment then colons within
319           the MIME type to match must be escaped as \c.
320

EXAMPLES

322       The following example edits a file called 'movie.mkv'. It sets the
323       segment title and modifies the language code of an audio and a subtitle
324       track. Note that this example can be shortened by leaving out the first
325       --edit option because editing the segment information element is the
326       default for all options found before the first --edit option anyway.
327
328           $ mkvpropedit movie.mkv --edit info --set "title=The movie" --edit track:a1 --set language=fre --edit track:a2 --set language=ita
329
330       The second example removes the 'default track flag' from the first
331       subtitle track and sets it for the second one. Note that
332       mkvpropedit(1), unlike mkvmerge(1), does not set the 'default track
333       flag' of other tracks to '0' if it is set to '1' for a different track
334       automatically.
335
336           $ mkvpropedit movie.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
337
338       Replacing the tags for the second subtitle track in a file looks like
339       this:
340
341           $ mkvpropedit movie.mkv --tags track:s2:new-subtitle-tags.xml
342
343       Removing all tags requires leaving out the file name:
344
345           $ mkvpropedit movie.mkv --tags all:
346
347       Replacing the chapters in a file looks like this:
348
349           $ mkvpropedit movie.mkv --chapters new-chapters.xml
350
351       Removing all chapters requires leaving out the file name:
352
353           $ mkvpropedit movie.mkv --chapters ''
354
355       Adding a font file (Arial.ttf) as an attachment:
356
357           $ mkvpropedit movie.mkv --add-attachment Arial.ttf
358
359       Adding a font file (89719823.ttf) as an attachment and providing some
360       information as it really is just Arial:
361
362           $ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'The Arial font as a TrueType font' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
363
364       Replacing one attached font (Comic.ttf) file with another one
365       (Arial.ttf):
366
367           $ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'The Arial font as a TrueType font' --replace-attachment name:Comic.ttf:Arial.ttf
368
369       Deleting the second attached file, whatever it may be:
370
371           $ mkvpropedit movie.mkv --delete-attachment 2
372
373       Deleting all attached fonts by MIME type:
374
375           $ mkvpropedit movie.mkv --delete-attachment mime-type:application/x-truetype-font
376

EXIT CODES

378       mkvpropedit(1) exits with one of three exit codes:
379
380       ·   0 -- This exit codes means that the modification has completed
381           successfully.
382
383       ·   1 -- In this case mkvpropedit(1) has output at least one warning,
384           but the modification did continue. A warning is prefixed with the
385           text 'Warning:'. Depending on the issues involved the resulting
386           files might be ok or not. The user is urged to check both the
387           warning and the resulting files.
388
389       ·   2 -- This exit code is used after an error occurred.
390           mkvpropedit(1) aborts right after outputting the error message.
391           Error messages range from wrong command line arguments over
392           read/write errors to broken files.
393

TEXT FILES AND CHARACTER SET CONVERSIONS

395       For an in-depth discussion about how all tools in the MKVToolNix suite
396       handle character set conversions, input/output encoding, command line
397       encoding and console encoding please see the identically-named section
398       in the mkvmerge(1) man page.
399

ENVIRONMENT VARIABLES

401       mkvpropedit(1) uses the default variables that determine the system's
402       locale (e.g.  LANG and the LC_* family). Additional variables:
403
404       MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG and its short form MTX_DEBUG
405           The content is treated as if it had been passed via the --debug
406           option.
407
408       MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE and its short form MTX_ENGAGE
409           The content is treated as if it had been passed via the --engage
410           option.
411

SEE ALSO

413       mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1)
414

WWW

416       The latest version can always be found at the MKVToolNix homepage[1].
417

AUTHOR

419       Moritz Bunkus <moritz@bunkus.org>
420           Developer
421

NOTES

423        1. the MKVToolNix homepage
424           https://mkvtoolnix.download/
425
426
427
428MKVToolNix 40.0.0                 2019-11-09                    MKVPROPEDIT(1)
Impressum