LinuxCommandLibrary

mkvpropedit

Modify MKV file properties

TLDR

Delete title

$ mkvpropedit [[-d|--delete]] title [path/to/file.mkv]
copy

Mark subtitle track 3 as SDH - Subtitles for deaf and hearing impared
$ mkvpropedit [path/to/file.mkv] [[-e|--edit]] track:s3 [[-s|--set]] flag-hearing-impaired=1
copy

Mark audio track 2 as Default
$ mkvpropedit [path/to/file.mkv] [[-e|--edit]] track:a2 [[-s|--set]] flag-default=1
copy

Delete the name of video track 1
$ mkvpropedit [path/to/file.mkv] [[-e|--edit]] track:v1 [[-d|--delete]] name
copy

SYNOPSIS

mkvpropedit [global options] <filename> [<edit specifier> [<action/property> ...]] ...

<edit specifier> examples:
    --edit segment
    --edit track:<number|type:number|UID>
    --edit attachment:<number|filename|MIME type>

<action/property> examples:
    --set <property>=<value>
    --delete <property>
    --add-attachment <file>
    --replace-attachment <file>
    --delete-attachment

PARAMETERS

--help
    Show usage information and exit.

--version
    Show version information and exit.

-v, --verbose
    Be more verbose and show important Matroska elements as they're read.

-q, --quiet
    Suppress all warnings and status output. Only errors will be printed.

--ui-language <language_code>
    Set the language for the user interface messages.

--debug <topic>
    Turn on debugging for a specific topic.

--engage <feature>
    Engage a special feature. Use with caution.

--output-charset <charset>
    Set the charset to use for output messages.

--redirect-output <file>
    Redirect all output to a file.

--edit segment
    Selects the segment information section for editing. Properties like title and segment-uid can be set here.

--edit track:<number|type:number|UID>
    Selects a track for editing. number is the track ID (1-based for the GUI, 0-based for internal Matroska structure). type:number specifies a track by type (e.g., video:1). UID specifies a track by its unique ID.

--edit attachment:<number|filename|MIME type>
    Selects an attachment for editing. number is the 1-based index, filename is the attached file's name, MIME type is the attachment's MIME type.

--set <property>=<value>
    Set the value of a property. This action follows an --edit specifier. Examples of properties include title, language, name, default-track.

--delete <property>
    Delete a property. This action follows an --edit specifier. Examples include title, segment-uid, track-name.

--add-attachment <file>
    Add the specified file as an attachment. This action follows an --edit segment specifier.

--replace-attachment <file>
    Replace an existing attachment with the content of the specified file. This action follows an --edit attachment:X specifier.

--delete-attachment
    Delete an attachment. This action follows an --edit attachment:X specifier to delete a specific attachment. When used after --edit segment, it deletes all attachments.

--delete-chapters
    Delete all chapters from the file. This action follows an --edit segment specifier.

DESCRIPTION

mkvpropedit is a powerful command-line tool from the mkvtoolnix suite designed for modifying properties of existing Matroska (MKV) files without needing to re-mux the entire file. This is particularly useful for large files where re-muxing would be time-consuming. It allows users to make various changes, including setting the global file title, altering segment UIDs, adding, replacing, or deleting attachments, and extensively modifying individual track properties such as language, name, default/forced flags, and even codec private data. Unlike mkvmerge which creates new MKV files, mkvpropedit directly modifies the input file in-place, making it an efficient solution for post-processing and metadata management of Matroska containers.

CAVEATS

Using mkvpropedit modifies the Matroska file directly. Incorrect usage can lead to file corruption or unplayable files. Always back up your files before making changes. Some properties, especially related to codec private data, require precise knowledge of the Matroska specification and the codec in question; arbitrary changes can render tracks unplayable. It does not re-encode or re-mux entire audio/video streams, only modifies metadata and specific data structures within the Matroska container.

PROPERTY NAMES

Property names (e.g., title, language, default-track) generally correspond to the elements found in the Matroska specification or the output of mkvinfo. Many track properties can be shortened, e.g., track-name can be simply name when operating on a track.

TRACK SPECIFICATION

Tracks can be specified by their 0-based Matroska track ID (e.g., track:0), their 1-based number as shown by mkvinfo (e.g., track:1), by type and number (e.g., track:audio:2), or by their unique ID (e.g., track:0xDEADBEEF).

HISTORY

mkvpropedit is an integral part of the mkvtoolnix suite, developed primarily by Moritz Bunkus. It was introduced to address the growing need for modifying existing Matroska files without the overhead of a full re-mux, which can be inefficient for simple metadata changes on large files. Its development has focused on providing granular control over segment, track, and attachment properties, evolving to support a wide range of modifications and becoming a crucial tool for Matroska file post-production and management.

SEE ALSO

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

Copied to clipboard