'\" t .\" Title: mkvpropedit .\" Author: Moritz Bunkus .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 2021-01-04 .\" Manual: 使用者命令 .\" Source: MKVToolNix 52.0.0 .\" Language: Chinese .\" .TH "MKVPROPEDIT" "1" "2021\-01\-04" "MKVToolNix 52\&.0\&.0" "使用者命令" .\" ----------------------------------------------------------------- .\" * 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 ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "名称" mkvpropedit \- Modify properties of existing Matroska files without a complete remux .SH "概要" .HP \w'\fBmkvpropedit\fR\ 'u \fBmkvpropedit\fR [options] {source\-filename} {actions} .SH "摘要說明" .PP This program analyses an existing Matroska 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)\&. .PP 選項: .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 \fIsource\-filename\fR parameter does not have to be supplied\&. .RE .PP \fB\-p\fR, \fB\-\-parse\-mode\fR \fI模式\fR .RS 4 Sets the parse mode\&. The parameter \*(Aq\fImode\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\&. .RE .PP Actions that deal with track and segment info properties: .PP \fB\-e\fR, \fB\-\-edit\fR \fI選擇\fR .RS 4 Sets the Matroska file section (segment information or a certain track\*(Aqs 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\&. .sp By default \fBmkvpropedit\fR(1) will edit the segment information section\&. .sp 完整的語法描述詳細資訊請參閱下列 編輯選擇器 。 .RE .PP \fB\-a\fR, \fB\-\-add\fR \fIname\fR=\fIvalue\fR .RS 4 Adds a property \fIname\fR with the value \fIvalue\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名稱\fR=\fI數值\fR .RS 4 Sets all occurrences of the property \fIname\fR to the value \fIvalue\fR\&. If no such property exists then it will be added\&. .RE .PP \fB\-d\fR, \fB\-\-delete\fR \fI名稱\fR .RS 4 Deletes all occurrences of the property \fIname\fR\&. Note that some properties are required and cannot be deleted\&. .RE .PP Actions that deal with tags and chapters: .PP \fB\-t\fR, \fB\-\-tags\fR \fI選擇\fR:\fI檔名\fR .RS 4 Add or replace tags in the file with the ones from filename or remove them if filename is empty\&. \fBmkvpropedit\fR(1) reads the same XML tag format that \fBmkvmerge\fR(1) reads as well\&. .sp The \fIselector\fR must be one of the words \fBall\fR, \fBglobal\fR or \fBtrack\fR\&. For \fBall\fR \fBmkvpropedit\fR(1) will replace or remove all tags in a file\&. With \fBglobal\fR only global tags will be replaced or removed\&. .sp With \fBtrack\fR \fBmkvpropedit\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 \fB\-\-add\-track\-statistics\-tags\fR .RS 4 Calculates statistics for all tracks in a file and adds new statistics tags for them\&. If the file already contains such tags then they\*(Aqll be updated\&. .RE .PP \fB\-\-delete\-track\-statistics\-tags\fR .RS 4 Deletes all existing track statistics tags from a file\&. If the file doesn\*(Aqt contain track statistics tags then it won\*(Aqt be modified\&. .RE .PP \fB\-c\fR, \fB\-\-chapters\fR \fI檔名\fR .RS 4 Add or replace chapters in the file with the ones from filename or remove them if filename is empty\&. \fBmkvpropedit\fR(1) reads the same XML and simple chapter formats that \fBmkvmerge\fR(1) reads as well\&. .RE .PP 附件處理執行選項: .PP \fB\-\-add\-attachment\fR \fI檔名\fR .RS 4 從 \fI檔名\fR 增加新的附件。 .sp If the option \fB\-\-attachment\-name\fR has been used prior to this option then its value is used as the new attachment\*(Aqs name\&. Otherwise it is derived from \fIfilename\fR\&. .sp If the option \fB\-\-attachment\-mime\-type\fR has been used prior to this option then its value is used as the new attachment\*(Aqs MIME type\&. Otherwise it is auto\-detected from the content of \fIfilename\fR\&. .sp If the option \fB\-\-attachment\-description\fR has been used prior to this option then its value is used as the new attachment\*(Aqs description\&. Otherwise no description will be set\&. .sp If the option \fB\-\-attachment\-uid\fR has been used prior to this option then its value is used as the new attachment\*(Aqs UID\&. Otherwise a random UID will be generated automatically\&. .RE .PP \fB\-\-replace\-attachment\fR \fIselector\fR:\fIfilename\fR .RS 4 Replaces one or more attachments that match \fIselector\fR with the file \fIfilename\fR\&. If more than one existing attachment matches \fIselector\fR then all of their contents will be replaced by the content of \fIfilename\fR\&. .sp The \fIselector\fR can have one of four forms\&. They\*(Aqre explained below in the section attachment selectors\&. .sp If the option \fB\-\-attachment\-name\fR has been used prior to this option then its value is set as the new name for each modified attachment\&. Otherwise the names aren\*(Aqt changed\&. .sp If the option \fB\-\-attachment\-mime\-type\fR 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\*(Aqt changed\&. .sp If the option \fB\-\-attachment\-description\fR has been used prior to this option then its value is set as the new description for each modified attachment\&. Otherwise the descriptions aren\*(Aqt changed\&. .sp If the option \fB\-\-attachment\-uid\fR has been used prior to this option then its value is set as the new UID for each modified attachment\&. Otherwise the UIDs aren\*(Aqt changed\&. .RE .PP \fB\-\-update\-attachment\fR \fI選擇\fR .RS 4 Sets the properties of one or more attachments that match \fIselector\fR\&. If more than one existing attachment matches \fIselector\fR then all of their properties will be updated\&. .sp The \fIselector\fR can have one of four forms\&. They\*(Aqre explained below in the section attachment selectors\&. .sp If the option \fB\-\-attachment\-name\fR has been used prior to this option then its value is set as the new name for each modified attachment\&. Otherwise the names aren\*(Aqt changed\&. .sp If the option \fB\-\-attachment\-mime\-type\fR 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\*(Aqt changed\&. .sp If the option \fB\-\-attachment\-description\fR has been used prior to this option then its value is set as the new description for each modified attachment\&. Otherwise the descriptions aren\*(Aqt changed\&. .sp If the option \fB\-\-attachment\-uid\fR has been used prior to this option then its value is set as the new UID for each modified attachment\&. Otherwise the UIDs aren\*(Aqt changed\&. .RE .PP \fB\-\-delete\-attachment\fR \fI選擇\fR .RS 4 Deletes one or more attachments that match \fIselector\fR\&. .sp The \fIselector\fR can have one of four forms\&. They\*(Aqre explained below in the section attachment selectors\&. .RE .PP 附件執行選項: .PP \fB\-\-attachment\-name\fR \fI名稱\fR .RS 4 Sets the name to use for the following \fB\-\-add\-attachment\fR or \fB\-\-replace\-attachment\fR operation\&. .RE .PP \fB\-\-attachment\-mime\-type\fR \fIMIME 類型\fR .RS 4 Sets the MIME type to use for the following \fB\-\-add\-attachment\fR or \fB\-\-replace\-attachment\fR operation\&. .RE .PP \fB\-\-attachment\-description\fR \fI描述\fR .RS 4 Sets the description to use for the following \fB\-\-add\-attachment\fR or \fB\-\-replace\-attachment\fR operation\&. .RE .PP 其他選項: .PP \fB\-\-disable\-language\-ietf\fR .RS 4 Normally when the user requests changes to the \*(Aqlanguage\*(Aq track header property, \fBmkvpropedit\fR(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\&. .sp This option does not affect changes requested via the \*(Aqlanguage\-ietf\*(Aq track header property\&. .RE .PP \fB\-\-command\-line\-charset\fR \fI字元集\fR .RS 4 設定在命令列顯示的字串字元集,以轉換為其他字元集。預設為目前系統所在位置指定的字元集。 .RE .PP \fB\-\-output\-charset\fR \fI字元集\fR .RS 4 設定要轉換為輸出字串的字元集。預設為目前系統所在位置指定的字元集。 .RE .PP \fB\-r\fR, \fB\-\-redirect\-output\fR \fI檔名\fR .RS 4 將所有訊息寫入到檔案 \fI檔名\fR 而不是命令列。儘管使用輸出重新導向可以輕鬆完成此操作,但在某些情況下需要使用此選項: 當終端在將輸出寫入文件之前重新解釋(覆蓋)輸出時。 優先使用通過 \fB\-\-output\-charset\fR 設定字元集。 .RE .PP \fB\-\-ui\-language\fR \fI語言碼\fR .RS 4 強制使用語言 \fI編碼\fR 對應的的翻譯(例如 \*(Aqzh_TW\*(Aq 為臺灣正體中文翻譯)。 在\fI編碼\fR欄位中輸入\*(Aqlist\*(Aq 讓程式輸出時使用可用的對應翻譯清單。 .RE .PP \fB\-\-abort\-on\-warnings\fR .RS 4 發出第一個警告後,終止程式。程式的結束碼為 1 。 .RE .PP \fB\-\-debug\fR \fI主題\fR .RS 4 針對特定功能開啟除錯。此選項適用於開發者。 .RE .PP \fB\-\-engage\fR \fI功能\fR .RS 4 開啟實驗中功能。 透過\fBmkvpropedit \-\-engage list\fR啟用可用的列表。這些功能不會在正常情況下使用。 .RE .PP \fB\-\-gui\-mode\fR .RS 4 開啟 GUI 模式。在這種模式中,可能會輸出特殊格式的行數,可以呈現控制的 GUI 發生什麼事。這些訊息會以 \*(Aq#GUI#訊息\*(Aq呈現。訊息可能包含機碼/值,例如 \*(Aq#GUI#訊息#機碼1=值1#機碼2=值2\&...\*(Aq。 無論是訊息或是機碼都不會轉為譯文,而且永遠使用 *英語* 輸出。 .RE .PP \fB\-v\fR, \fB\-\-verbose\fR .RS 4 輸出時盡量詳細,並在讀取時顯示所有 Matroska 重要的元件。 .RE .PP \fB\-h\fR, \fB\-\-help\fR .RS 4 顯示使用方式並退出。 .RE .PP \fB\-V\fR, \fB\-\-version\fR .RS 4 顯示版本資訊並離開。 .RE .PP \fB@\fR\fIoptions\-file\&.json\fR .RS 4 從\fI檔案選項\fR檔讀取其他命令列引數。有關此類檔案支援格式的完整說明,請參閱 \fBmkvmerge\fR(1) 文件中的 "選項檔案" 章節。 .RE .SH "編輯選擇器" .PP The \fB\-\-edit\fR option sets the Matroska file section (segment information or a certain track\*(Aqs headers) that all following 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\&. .PP By default \fBmkvpropedit\fR(1) will edit the segment information section\&. .SS "剪輯訊息" .PP 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 UID\&. .SS "軌道表頭" .PP 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\&. .PP \fBtrack:\fR\fIn\fR .RS 4 If the parameter \fIn\fR is a number then the \fIn\fRth track will be selected\&. The track order is the same that \fBmkvmerge\fR(1)\*(Aqs \fB\-\-identify\fR option outputs\&. .sp 從 1 開始編號。 .RE .PP \fBtrack:\fR\fIt\fR\fIn\fR .RS 4 If the parameter starts with a single character \fIt\fR followed by a \fIn\fR then the \fIn\fRth track of a specific track type will be selected\&. The track type parameter \fIt\fR 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 \fBmkvmerge\fR(1)\*(Aqs \fB\-\-identify\fR option outputs\&. .sp 從 1 開始編號。 .RE .PP \fBtrack:\fR=\fIuid\fR .RS 4 If the parameter starts with a \*(Aq=\*(Aq followed by a number \fIuid\fR, the track whose track UID element equals the given \fIuid\fR will be selected\&. Track UIDs can be obtained with \fBmkvinfo\fR(1)\&. .RE .PP \fBtrack:\fR@\fI編號\fR .RS 4 If the parameter starts with a \*(Aq@\*(Aq followed by a number \fInumber\fR, the track whose track number element equals this \fInumber\fR will be selected\&. Track numbers can be obtained with \fBmkvinfo\fR(1)\&. .RE .SS "備註" .PP 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\&. .SH "附件選擇" .PP An attachment selector is used with the two actions \fB\-\-replace\-attachment\fR and \fB\-\-delete\-attachment\fR\&. It can have one of the following four forms: .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} Selection by attachment ID\&. In this form the selector is simply a number, the attachment\*(Aqs ID as output by \fBmkvmerge\fR(1)\*(Aqs identification command\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} Selection by attachment UID (unique ID)\&. In this form the selector is the equal sign = followed by a number, the attachment\*(Aqs unique ID as output by \fBmkvmerge\fR(1)\*(Aqs verbose identification command\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 3.\h'+01'\c .\} .el \{\ .sp -1 .IP " 3." 4.2 .\} Selection by attachment name\&. In this form the selector is the literal word name: followed by the existing attachment\*(Aqs name\&. If this selector is used with \fB\-\-replace\-attachment\fR then colons within the name to match must be escaped as \ec\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 4.\h'+01'\c .\} .el \{\ .sp -1 .IP " 4." 4.2 .\} Selection by MIME type\&. In this form the selector is the literal word mime\-type: followed by the existing attachment\*(Aqs MIME type\&. If this selector is used with \fB\-\-replace\-attachment\fR then colons within the MIME type to match must be escaped as \ec\&. .RE .SH "範例" .PP 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 \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 .if n \{\ .RS 4 .\} .nf $ mkvpropedit movie\&.mkv \-\-edit info \-\-set "title=The movie" \-\-edit track:a1 \-\-set language=fre \-\-edit track:a2 \-\-set language=ita .fi .if n \{\ .RE .\} .PP The second example removes the \*(Aqdefault track flag\*(Aq from the first subtitle track and sets it for the second one\&. Note that \fBmkvpropedit\fR(1), unlike \fBmkvmerge\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\&. .sp .if n \{\ .RS 4 .\} .nf $ mkvpropedit movie\&.mkv \-\-edit track:s1 \-\-set flag\-default=0 \-\-edit track:s2 \-\-set flag\-default=1 .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: .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 .fi .if n \{\ .RE .\} .PP Adding a font file (Arial\&.ttf) as an attachment: .sp .if n \{\ .RS 4 .\} .nf $ mkvpropedit movie\&.mkv \-\-add\-attachment Arial\&.ttf .fi .if n \{\ .RE .\} .PP Adding a font file (89719823\&.ttf) as an attachment and providing some information as it really is just Arial: .sp .if n \{\ .RS 4 .\} .nf $ mkvpropedit movie\&.mkv \-\-attachment\-name Arial\&.ttf \-\-attachment\-description \*(AqThe Arial font as a TrueType font\*(Aq \-\-attachment\-mime\-type application/x\-truetype\-font \-\-add\-attachment 89719823\&.ttf .fi .if n \{\ .RE .\} .PP 將一個附加字型 (Comic\&.ttf) 檔取代成另一個 (Arial\&.ttf): .sp .if n \{\ .RS 4 .\} .nf $ mkvpropedit movie\&.mkv \-\-attachment\-name Arial\&.ttf \-\-attachment\-description \*(AqThe Arial font as a TrueType font\*(Aq \-\-replace\-attachment name:Comic\&.ttf:Arial\&.ttf .fi .if n \{\ .RE .\} .PP 刪除第二個附加檔,無論可能是什麼: .sp .if n \{\ .RS 4 .\} .nf $ mkvpropedit movie\&.mkv \-\-delete\-attachment 2 .fi .if n \{\ .RE .\} .PP 依 MIME 類型刪除所有附加的字型: .sp .if n \{\ .RS 4 .\} .nf $ mkvpropedit movie\&.mkv \-\-delete\-attachment mime\-type:application/x\-truetype\-font .fi .if n \{\ .RE .\} .SH "結束代碼" .PP \fBmkvpropedit\fR(1) exits with one of three exit codes: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB0\fR \-\- This exit code means that the modification has completed successfully\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB1\fR \-\- In this case \fBmkvpropedit\fR(1) 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\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB2\fR \-\- This exit code is used after an error occurred\&. \fBmkvpropedit\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 .SH "文字檔案與字元集轉換" .PP 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 \fBmkvmerge\fR(1) man page\&. .SH "環境變數" .PP \fBmkvpropedit\fR(1) uses the default variables that determine the system\*(Aqs locale (e\&.g\&. \fILANG\fR and the \fILC_*\fR family)\&. Additional variables: .PP \fIMKVPROPEDIT_DEBUG\fR, \fIMKVTOOLNIX_DEBUG\fR 與其的簡短形式 \fIMTX_DEBUG\fR .RS 4 The content is treated as if it had been passed via the \fB\-\-debug\fR option\&. .RE .PP \fIMKVPROPEDIT_ENGAGE\fR, \fIMKVTOOLNIX_ENGAGE\fR 與其簡短形式 \fIMTX_ENGAGE\fR .RS 4 The content is treated as if it had been passed via the \fB\-\-engage\fR option\&. .RE .SH "參閱" .PP \fBmkvmerge\fR(1), \fBmkvinfo\fR(1), \fBmkvextract\fR(1), \fBmkvtoolnix-gui\fR(1) .SH "網路" .PP The latest version can always be found at \m[blue]\fBthe MKVToolNix homepage\fR\m[]\&\s-2\u[1]\d\s+2\&. .SH "作者" .PP \fBMoritz Bunkus\fR <\&moritz@bunkus\&.org\&> .RS 4 開發人員 .RE .SH "备注" .IP " 1." 4 the MKVToolNix homepage .RS 4 \%https://mkvtoolnix.download/ .RE