MKVPROPEDIT(1)

okay bestie, sit down, hydrate, put your phone on do-not-disturb, because mkvpropedit β€” that's the MKVPROPEDIT(1) page, filed under User Commands πŸ’… β€” is genuinely one of the most useful little tools and I need you to know about it.


🌸 NAME 🌸

mkvpropedit β€” modify properties of existing Matroska(TM) files without a complete remux. no full rebuild, no waiting around, we're just ✨tweaking✨ the stuff that needs tweaking.


✨ SYNOPSIS ✨

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

πŸ’œ DESCRIPTION πŸ’œ

So here's the vibe: this program analyses an existing Matroska(TM) file, modifies some of its properties, and then writes those modifications to the existing file. That's it. That's the whole thing. Iconic behaviour, honestly.

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, the 'default track' flag or the name).


πŸŽ€ 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. So the source-filename parameter does not have to be supplied. window shopping only, no commitment πŸ›οΈ
  • -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. so, y'know, pick your fighter.

πŸ’– 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. bold move, and it WILL make duplicates if you let it.
  • -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. the polite, well-behaved sibling of --add 🫢
  • -d, --delete name β€” deletes all occurrences of the property name. Note that some properties are required and cannot be deleted. so don't come crying to me when one of them refuses.

πŸ¦‹ 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 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.

  • --add-track-statistics-tags β€” calculates statistics for all tracks in a file and adds new statistics tags for them. If the file already contains such tags then they'll be updated. πŸ“Š
  • --delete-track-statistics-tags β€” deletes all existing track statistics tags from a file. If the file doesn't contain track statistics tags then it won't be modified. no tags? no touch. respectful.
  • -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.

πŸŽ€ Actions for handling attachments πŸŽ€

  • --add-attachment filename β€” adds a new attachment from filename.

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 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 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 selector β€” sets the properties of one or more attachments that match selector. If more than one existing attachment matches selector then all of their properties will be updated.

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 selector β€” deletes one or more attachments that match selector.

The selector can have one of four forms. They're explained below in the section attachment selectors. gone. vanished. bye. πŸ’€


🌈 Options for attachment actions 🌈

  • --attachment-name name β€” sets the name to use for the following --add-attachment or --replace-attachment operation.
  • --attachment-mime-type mime-type β€” sets the MIME type to use for the following --add-attachment or --replace-attachment operation.
  • --attachment-description description β€” sets the description to use for the following --add-attachment or --replace-attachment operation.
  • --enable-legacy-font-mime-types β€” enables the use of legacy MIME types for certain types of font attachments. For example, 'application/x-truetype-font' will be used for TrueType fonts instead of 'fonts/ttf'.

This affects both adding new attachments and replacing existing attachments, but only if the new MIME type isn't specified. Other existing attachments aren't changed.

The affected MIME types are 'font/sfnt', 'font/ttf' and 'font/collection' which are all mapped to 'application/x-truetype-fonts' and 'font/otf' which is mapped to 'application/vnd.ms-opentype'. mapping table, but make it a sentence, love that for us.


⭐ Other options ⭐

  • --disable-language-ietf β€” normally when the user requests changes to the 'language' track header property, mkvpropedit(1) will apply the same change to the new LanguageIETF track header element in addition to the legacy Language element. If this option is used, the change is only applied to the legacy Language element.

This option does not affect changes requested via the 'language-ietf' track header property.

  • --normalize-language-ietf mode β€” enables normalizing all IETF BCP 47 language tags to either their canonical form with mode 'canonical', to their extended language subtags form with mode 'extlang' or turns it off with mode 'off'. By default normalization to the canonical form is applied.

In the canonical form all subtags for which preferred values exist are replaced by those preferred values. This converts e.g. 'zh-yue-jyutping' to 'yue-jyutping' or 'fr-FX' to 'fr-FR'.

For the extended language subtags form the canonical form is built first. Afterwards all primary languages for which an extended language subtag exists are replaced by that extended language subtag and its prefix. This converts e.g. 'yue-jyutping' back to 'zh-yue-jyutping' but has no effect on 'fr-FR' as 'fr' is not an extended language subtag.

This normalization is only applied to elements that are actually changed:

  • When editing track headers only those track language elements that are set via edit specifications are affected. Languages of tracks that aren't edited aren't changed. Editing a track but setting only properties other than the language won't affect the language either.
  • When editing chapters all language elements of all chapter elements are affected as existing chapters are always fully replaced.
  • When editing tags only the language elements of the tags that are actually replaced are affected. For example, when you replace global tags then existing track tags aren't affected.

The best way to normalize all existing language tags in a file is to remux it with mkvmerge(1) and set its --normalize-language-ietf option to the desired mode. iykyk.

  • --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.

bestie we are SO not done yet β€” hold that thought, the rest of the page is coming right up πŸ’–
  • -r, --redirect-output file-name β€” bestie, this one yeets all the messages into the file file-name instead of onto your console. And yeah, you could just do > redirection like a normal person, but this option exists for the chaos cases: when your terminal does ✨interpretive dance✨ with the output before it ever hits the file. The character set you picked with --output-charset is honored here. periodt. πŸ’…
  • --no-bom β€” okay so normally, any text file that gets created & encoded in one of the UTF variants starts with a byte order marker (BOM). This option says "no thank you ma'am" and stops that BOM from being written. πŸŽ€
  • --ui-language code β€” forces the translations for the language code to be used (like 'de_DE' for the German translations, iykyk). And if you type 'list' as the code? The program will dump a whole list of available translations at you. 🌈
  • --abort-on-warnings β€” tells the program to bail tf out right after the first warning shows up. The program's exit code will be 1. dramatic but valid πŸ’€
  • --debug topic β€” turns on debugging for a specific topic. Real talk: this option is only useful for developers. πŸ™ˆ
  • --engage feature β€” turns on experimental features. You can ask for a list of what's available with mkvpropedit --engage list. These features are not meant to be used in normal situations, bestie, they're giving mad-scientist lab energy πŸ§ͺ
  • --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 like '#GUI#message#key1=value1#key2=value2...'. Neither the messages nor the keys are ever translated β€” they're always output in English, no cap. πŸ‘‘
  • -v, --verbose β€” be verbose and show all the important Matroskaβ„’ elements as they're being read. main character behavior, we love a talkative tool πŸ’–
  • -h, --help β€” show usage information and exit. your lil emergency exit πŸšͺ
  • -V, --version β€” show version information and exit. πŸ¦‹
  • @options-file.json β€” reads additional command line arguments from the file options-file. For a full explanation on the supported formats for such files, see the section called "Option files" in the mkvmerge(1) man page. (yes bestie, homework is assigned πŸ“š)

✨ EDIT SELECTORS ✨

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 shows up β€” like, it's the current vibe and everything after it matches that vibe. The argument to this option is called the edit selector. 🌸

By default mkvpropedit(1) will edit the segment information section. that's the default setting, we don't make you work for it 🫢

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. three names, one icon πŸ’…

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 *n*th track will be selected. The track order is the same that mkvmerge(1)'s --identify option outputs. Numbering starts at 1. πŸ”’
  • track:t n β€” 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. Numbering starts at 1. πŸŽ§πŸ“Ί
  • track:=uid β€” if the parameter starts with a '=' followed by a number uid, the track whose track UID element equals the given uid will be selected. Track UIDs can be obtained with mkvinfo(1). ⭐
  • track:@number β€” if the parameter starts with a '@' followed by a number number, the track whose track number element equals this number will be selected. Track numbers can be obtained with mkvinfo(1). 🎯

Notes

Because of the nature of the track edit selectors, it's 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. no fighting, they just queue up politely 🧚


🌸 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-attachment then colons within the name to match must be escaped as \c.
  4. Selection by MIME type. In this form the selector is the literal word mime-type: followed by the existing attachment's MIME type. If this selector is used with --replace-attachment then colons within the MIME type to match must be escaped as \c.
ngl the \c escaping thing is the kind of detail that will humble you at 2am. write it down bestie πŸ“

πŸ’œ LANGUAGE HANDLING πŸ’œ

mkvpropedit(1) mostly tries to do the right thing by default. Therefore changes to the language property will cause mkvpropedit(1) to apply the same change to both the new "LanguageIETF" element as well as the old "Language" element β€” similar to how mkvmerge(1) applies the language to both elements. For example, when using mkvpropedit movie.mkv --edit track:2 --set language=zh-TW the "LanguageIETF" element will be set to zh-TW and the old "Language" element to chi. see? it does the matching for you, iconic ✨

Additionally there's a new track header property named language-ietf that can be set or removed. Changes to this property only apply to the new "LanguageIETF" track header element. A caveat: the old "Language" track header element is a mandatory element in Matroska β€” meaning even if it isn't present in the file it still has an implied value. When the user only sets the language-ietf property but not the language property, mkvpropedit(1) will therefore add the old "Language" element in certain cases & set it to und (meaning "undetermined") as the user didn't specify a value for it. lowkey thoughtful of it ngl 🫢

When reading XML chapter or tag files mkvpropedit(1) works like mkvmerge(1) does.

The creation of the new elements can be disabled completely with the command-line option --disable-language-ietf which operates on all three new elements. πŸ’€ gone, reduced to atoms

You can chose the normalization method applied to extended language sub-tags with the parameter --normalize-language-ietf.


πŸ”₯ 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. so like, be aware, it won't clean up after you 😭

$ 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 ''

Adding a font file (Arial.ttf) as an attachment:

$ mkvpropedit movie.mkv --add-attachment Arial.ttf

Adding a font file (89719823.ttf) as an attachment and providing some information as it really is just Arial:

$ 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

Replacing one attached font (Comic.ttf) file with another one (Arial.ttf):

$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'The Arial font as a TrueType font' --replace-attachment name:Comic.ttf:Arial.ttf

Deleting the second attached file, whatever it may be:

$ mkvpropedit movie.mkv --delete-attachment 2

Deleting all attached fonts by MIME type:

$ mkvpropedit movie.mkv --delete-attachment mime-type:application/x-truetype-font

πŸ‘‘ EXIT CODES πŸ‘‘

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

  • 0 β€” This exit code means that the modification has completed successfully. slay, we ate πŸ’…
  • 1 β€” In this case mkvpropedit(1) has output at least one warning, but the modification did continue. A warning is prefixed with the text 'Warning:'. 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. do not skip this, fr fr πŸ‘€
  • 2 β€” This exit code is used after an error occurred. mkvpropedit(1) aborts right after outputting the error message. Error messages range from wrong command line arguments over read/write errors to broken files. πŸ’€ it's giving catastrophe

πŸ¦‹ TEXT FILES AND CHARACTER SET CONVERSIONS πŸ¦‹

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. (yes, another field trip to another man page, i know πŸŽ€)


🌈 ENVIRONMENT VARIABLES 🌈

mkvpropedit(1) uses the default variables that determine the system's locale (e.g. LANG and the LC_* family). Additional variables:

  • MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG and its short form MTX_DEBUG β€” The content is treated as if it had been passed via the --debug option. πŸ›
  • MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE and its short form MTX_ENGAGE β€” The content is treated as if it had been passed via the --engage option. πŸš€

⭐ SEE ALSO ⭐

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

the whole friend group, go say hi πŸ’–


🌐 WWW 🌐

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


πŸ’œ AUTHOR πŸ’œ

Moritz Bunkus <moritz@bunkus.org> Developer


πŸ“ NOTES πŸ“

  1. the MKVToolNix homepage https://mkvtoolnix.download/

and that's the whole page bestie!! πŸŽ€ this beauty is from MKVToolNix 102.0, dated 2026-09-14, and it's the MKVPROPEDIT(1) manual β€” go forth and edit those properties, you absolute icon πŸ‘‘πŸ’…βœ¨

πŸ“¦ where this page comes from