mkvpropedit -- Modifica les propietats dels fitxers Matroska(tm) existents que no han completat el multiplexat

Table of contents

1. Sinopsis

mkvpropedit [opcions] {nom_fitxer_origen} {accions}

2. Descripció

This program analyses an existing Matroska(tm) 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, 'default track' flag or the name).

Opcions:

Option Description
-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:

Option Description
-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 nom=valor

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 nom=valor

Sets all occurrences of the property name to the value value. If no such property exists then it will be added.

-d, --delete nom

Deletes all occurrences of the property name. Note that some properties are required and cannot be deleted.

Actions that deal with tags and chapters:

Option Description
-t, --tags selector:nom_fitxer

Afegeix o substitueix les etiquetes al fitxer amb el nom_fitxer o l'elimina si el nom_fitxer està buit. El mkvpropedit(1) llegirà els mateixos formats d'etiquetes en XML que pugui llegir el mkvmerge(1).

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.

-c, --chapters nom_fitxer

Afegeix o substitueix els capítols al fitxer amb el nom_fitxer o elimina'l si el nom_fitxer està buit. El mkvpropedit(1) llegirà els mateixos formats de capítols simple i en XML que pugui llegir el mkvmerge(1).

Accions per a manejar els adjunts:

Option Description
--add-attachment nom_fitxer

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.

--replace-attachment selector:nom_fitxer

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-name has 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-type has 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-description has 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:

Option Description
--attachment-name nom

Estableix el nom a usar per a les opcions --add-attachment o --replace-attachment.

--attachment-mime-type tipus_MIME

Estableix el tipus MIME a usar per a les opcions --add-attachment o --replace-attachment.

--attachment-description descripció

Estableix la descripció a usar per a les opcions --add-attachment o --replace-attachment.

Altres opcions:

Option Description
--command-line-charset joc_de_caràcters

Estableix el joc de caràcters al qual convertir les cadenes donades des de la línia d'ordres. Per omissió serà el joc de caràcters donat per la configuració regional actual del sistema.

--output-charset joc_de_caràcters

Estableix el joc de caràcters al qual convertir les cadenes donades per la sortida. Per omissió serà el joc de caràcters establert a la configuració regional actual del sistema.

-r, --redirect-output nom_fitxer

Escriu tots els missatges al fitxer nom_fitxer en lloc de a la consola. Si bé això es pot fer fàcilment amb la redirecció de la sortida, hi ha casos en què cal aquesta opció: quan el terminal reinterpreta la sortida abans d'escriure-la a un fitxer. Es respecta el joc de caràcters establert amb --output-charset.

--ui-language codi

Força l'ús de les traduccions pel codi d'idioma (p. ex., «de_DE» per a les traduccions en alemany). Tot i que és preferible usar les variables d'entorn LANG, LC_MESSAGES i LC_ALL. Introduint «list» com a codi farà que el mkvextract(1) ofereixi a la sortida, una llista de les traduccions disponibles.

--debug tema

Activa la depuració per a una característica específica. Aquesta opció només és útil per als desenvolupadors.

--engage característica

Activa les característiques experimentals. Es pot sol·licitar una llista de les característiques disponibles amb mkvpropedit --engage list. Aquestes característiques no estan destinades a ser emprades en situacions normals.

--gui-mode

Activa el mode IGU. En aquest mode, les línies surten amb un format especial que pot explicar-vos el que està succeint per tal de controlar la IGU. Aquests missatges segueixen el format «#GUI#message». El missatge pot estar seguit per parells clau/valor com a «#GUI#message#key1=value1#key2=value2…». Ni els missatges ni les claus seran traduïts, sempre sortiran en anglès.

-v, --verbose

Serà detallat i mostrarà tots els elements importants del Matroska(tm) a mesura que es llegeixin.

-h, --help

Mostra la informació d'ús i surt.

-V, --version

Mostra la informació sobre la versió i surt.

--check-for-updates

Comprova en línia si hi ha nous llançaments per baixar-los des de l'URL http://mkvtoolnix-releases.bunkus.org/latest-release.xml. Es generaran quatre línies amb l'estil key=valor: l'URL des d'on s'ha obtingut la informació (clau version_check_url), la versió actualment en execució (clau running_version), la versió de l'últim llançament (clau available_version) i l'URL per a la baixada (clau download_url).

Després el programa sortirà amb un codi de sortida de 0 si no hi ha cap llançament més recent disponible, amb 1 si hi ha disponible una nova versió i amb 2 si s'ha produït un error (p. ex., si no s'ha pogut recuperar la informació sobre l'actualització).

Aquesta opció només estarà disponible si el programa va ser construït amb la implementació per a «libcurl».

@fitxer_opcions

Llegeix arguments addicionals per a la línia d'ordres des del fitxer fitxer_opcions. Les línies que tinguin com a primer caràcter un coixinet (#) seran tractades com a comentaris i ignorades. Els espais en blanc al començament i final de la línia seran descartats. Cada línia haurà de contenir exactament una opció.

Es poden interpretar diversos caràcters com d'escapament, p. ex., si necessiteu que una línia que comença amb un coixinet «#», no sigui interpretada com un comentari. Les regles es descriuen a la secció sobre escapar en el text.

La línia d'ordres «mkvpropedit origen.mkv --edit track:a2 --set name=Comentaris» es pot convertir en el següent fitxer d'opcions:

# Modifica origen.mkv
origen.mkv
# Edita la segona pista d'àudio
--edit
track:a2
# i estableix el títol a «Comentaris»
--set
name=Comentaris

3. Editar els 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.

3.1. Informació del segment

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.

3.2. Capçaleres de la pista

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.

Option Description
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 --identify option outputs.

La numeració comença per l'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 --identify option outputs.

La numeració comença per l'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:@número

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

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

4. Selectors de l'adjunt

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.

5. Exemples

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 peli.mkv --edit info --set "title=La pel·lícula" --edit track:a1 --set language=cat --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.

$ mkvpropedit peli.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1

Substituir les etiquetes per a la segona pista de subtítols en un arxiu es veu així:

$ mkvpropedit peli.mkv --tags track:s2:etiquetes_subtítols_noves.xml

Eliminar totes les etiquetes requereix ometre el nom del fitxer:

$ mkvpropedit peli.mkv --tags all:

Substituir els capítols en un fitxer es veu així:

$ mkvpropedit peli.mkv --chapters capítols_nous.xml

Eliminar tots els capítols requereix ometre el nom del fitxer:

$ mkvpropedit peli.mkv --chapters ''

Afegir un fitxer de tipus de lletra (Arial.ttf) com un adjunt:

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

Afegir un fitxer de tipus de lletra (89719823.ttf) com un adjunt i proporcionar alguna informació de com és el tipus de lletra Arial:

$ mkvpropedit peli.mkv --attachment-name Arial.ttf --attachment-description 'El tipus de lletra Arial com a tipus de lletra TrueType' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf

Substituir un fitxer adjunt de tipus de lletra (Comic.ttf) per un altre (Arial.ttf):

$ mkvpropedit peli.mkv --attachment-name Arial.ttf --attachment-description 'El tipus de lletra Arial com a tipus de lletra TrueType' --replace-attachment name:Comic.ttf:Arial.ttf

Eliminar el segon fitxer adjunt, sigui el que sigui:

$ mkvpropedit peli.mkv --delete-attachment 2

Eliminar tots els tipus de lletra adjuntats segons el tipus MIME:

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

6. Codis de sortida

El mkvpropedit(1) sortirà amb un d'aquests tres codis de sortida:

7. Conversió per a fitxers de text i jocs de caràcters

Per a un debat en profunditat sobre com manipula la suite MKVToolNix les conversions dels jocs de caràcters, codifica l'entrada/sortida i codifica la línia d'ordres i codifica a la consola, si us plau, vegeu la secció anomenada de la mateixa manera a la pàgina man del mkvmerge(1).

8. Caràcters especials d'escapament en el text

Hi ha pocs llocs en els quals els caràcters especials en el text puguin o s'hagin d'escapar. Les regles de l'escapament són simples: cada caràcter que necessiti ser escapat serà substituït amb una barra invertida seguida d'un altre caràcter.

Les regles són: « » (un espai) serà «\s», «"» (cometes) serà «\2», «:» serà «\c», «#» serà «\h» i «\» (una única barra invertida) serà «\\».

9. Variables d'entorn

El mkvpropedit(1) usa les variables per omissió que es determinen a la configuració regional del sistema (p. ex., LANG i la família LC_*). Variables addicionals:

Option Description
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG i la seva forma abreujada MTX_DEBUG

El contingut es tractarà com si s'hagués passat l'opció --debug.

MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE i la seva forma abreujada MTX_ENGAGE

El contingut es tractarà com si s'hagués passat l'opció --engage.

MKVPROPEDIT_OPTIONS, MKVTOOLNIX_OPTIONS i la seva forma abreujada MTX_OPTIONS

El contingut serà dividit en espais en blanc. Les cadenes parcials resultants seran tractades com si haguessin estat passades com a opcions a la línia d'ordres. Si necessiteu passar caràcters especials (p. ex., espais) llavors els haureu d'escapar (vegeu la secció caràcters especials d'escapament en el text).

10. Vegeu també

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

11. WWW

Sempre trobareu l'última versió a la pàgina del MKVToolNix.