table of contents
MKVEXTRACT(1) | MKVEXTRACT(1) |
名前¶
mkvextract - Matroska ファイルから、他の形式のファイルを抽出する
書式¶
mkvextract {mode} {source-filename} [options] [extraction-spec]
説明¶
This program extracts specific parts from a Matroska file to other useful formats. The first argument, mode, tells mkvextract(1) what to extract. Currently supported is the extraction of tracks, tags, attachments, chapters, CUE sheets, timecodes and cues. The second argument is the name of the source file. It must be a Matroska file. All following arguments are options and extraction specifications; both of which depend on the selected mode.
共通オプション¶
以下のオプションは、全てのmodeで使用できるので、このセクションで一括して説明します。
-f, --parse-fully
--command-line-charset character-set
--output-charset character-set
-r, --redirect-output file-name
--ui-language code
--debug topic
--engage feature
--gui-mode
-v, --verbose
-h, --help
-V, --version
--check-for-updates
その後プログラムは、新しいリリースが入手可能ではなかった場合は終了コード0で、新しいリリースが入手可能であった場合は終了コード1で、エラーが発生した場合(例:アップデート情報を取得できなかった場合)は終了コード2で、それぞれ終了します。
このオプションは、プログラムがlibcurlのサポートつきでビルドされた場合のみ使用できます。
@options-file.json
トラック抽出モード¶
Syntax: mkvextract tracks source-filename [options] TID1:dest-filename1 [TID2:dest-filename2 ...]
以下のコマンドラインオプションは、トラック抽出モードでは各トラック毎に指定することができます。これらのオプションは、作用するトラック指定子(下記参照)の前に指定しなければなりません。
-c character-set
--blockadd level
--cuesheet
--raw
--fullraw
TID:outname
各出力ファイル名は一回しか使用されません。RealAudio及びRealVideoトラックは例外です。もし、異なるトラックに同じファイル名が指定された場合、それらは同一のファイルに保存されます。例:
$ mkvextract tracks input.mkv 1:output-two-tracks.rm 2:output-two-tracks.rm
タグ抽出モード¶
Syntax: mkvextract tags source-filename [options]
抽出されたタグは、出力がリダイレクトされていなければコンソールに出力されます。(詳細については、出力リダイレクトについてのセクションを参照ください。)
添付ファイル抽出モード¶
Syntax: mkvextract attachments source-filename [options] AID1:outname1 [AID2:outname2 ...]
AID:outname
チャプタ抽出モード¶
Syntax: mkvextract chapters source-filename [options]
-s, --simple
--simple-language language
Using this option allows the user to determine which chapter names are output if atoms contain more than one chapter name. The language parameter must be an ISO 639-1 or ISO 639-2 code.
抽出されたチャプタは、出力がリダイレクトされていなければコンソールに出力されます。(詳細については、出力リダイレクトについてのセクションを参照ください。)
CUEシート抽出モード¶
Syntax: mkvextract cuesheet source-filename [options]
抽出されたCUEシートは、出力がリダイレクトされていなければコンソールに出力されます。(詳細については、出力リダイレクトについてのセクションを参照ください。)
タイムコード抽出モード¶
Syntax: mkvextract timecodes_v2 source-filename [options] TID1:dest-filename1 [TID2:dest-filename2 ...]
抽出されたタイムコードは、出力がリダイレクトされていなければコンソールに出力されます。(詳細については、出力リダイレクトについてのセクションを参照ください。)
TID:outname
例:
$ mkvextract timecodes_v2 input.mkv 1:tc-track1.txt 2:tc-track2.txt
Cues extraction mode¶
Syntax: mkvextract cues source-filename [options] TID1:dest-filename1 [TID2:dest-filename2 ...]
TID:dest-filename
The format output is a simple text format: one line per CuePoint element with key=value pairs. If an optional element is not present in a CuePoint (e.g. CueDuration) then a dash will be output as the value.
例:
timecode=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
The possible keys are:
timecode
duration
cluster_position
注記
Inside the Matroska file the CueClusterPosition is relative to the segment's data start offset. The value output by mkvextract(1)'s cue extraction mode, however, contains that offset already and is an absolute offset from the beginning of the file.
relative_position
注記
Inside the Matroska file the CueRelativePosition is relative to the cluster's data start offset. The value output by mkvextract(1)'s cue extraction mode, however, is relative to the cluster's ID. The absolute position inside the file can be calculated by adding cluster_position and relative_position.
例:
$ mkvextract cues input.mkv 1:cues-track1.txt 2:cues-track2.txt
出力リダイレクト¶
いくつかのモードでは、mkvextract(1)は抽出されたデータをコンソールに出力します。一般的に、このデータをファイルに書き出すには二つの方法があります。一つはシェルによって提供され、もう一つはmkvextract(1)自体によって提供されます。
シェルビルトインのリダイレクト機構は、コマンドラインに'> output-filename.ext'を追加することで使用できます。例:
$ mkvextract tags source.mkv > tags.xml
mkvextract(1)自体のリダイレクトは、--redirect-outputオプションを指定することで使用できます。例:
$ mkvextract tags source.mkv --redirect-output tags.xml
注記
Windowsでは、--redirect-outputオプションを使用するべきでしょう。cmd.exeは、特殊文字を出力ファイルに書き出す前に処理してしまい、出力が壊れる虞があります。
テキストファイルと文字コード変換¶
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.
出力ファイルフォーマット¶
出力ファイルのフォーマットの決定は、トラックの種類によって決まり、出力ファイル名の拡張子は使用されません。現在、以下の種類のトラックがサポートされています。
V_MPEG4/ISO/AVC
V_MS/VFW/FOURCC
V_REAL/*
V_THEORA
V_VP8, V_VP9
A_MPEG/L2
A_MPEG/L3, A_AC3
A_PCM/INT/LIT
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC
A_VORBIS
A_REAL/*
A_TTA1
A_ALAC
A_FLAC
A_WAVPACK4
A_OPUS
S_TEXT/UTF8
S_TEXT/SSA, S_TEXT/ASS
S_KATE
S_VOBSUB
S_TEXT/USF
S_HDMV/PGS
タグ
添付ファイル
チャプタ
タイムコード
返り値¶
mkvextract(1)は下の3つの返り値を返します。
テキスト中の特殊文字をエスケープする¶
特殊文字をエスケープしなければならない、あるいはすべき場所が少しだけあります。エスケープのルールは単純です:エスケープする必要のある各文字を、バックスラッシュ(Windows上の日本語フォントでは\記号)の後ろに違う文字が1つついたものと入れ替えます。
ルール:' '(半角スペース)は'\s'に、'"'(ダブルクォーテーション)は'\2'に、':'は'\c'に、'#'は'\h'に、そして'\'それ自体は'\\'になります。
環境変数¶
mkvextract(1)はシステムのロケールを決めるデフォルトの変数(例:LANGやLC_*系)を使用します。追加の変数は以下の通りです:
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG and its short form MTX_DEBUG
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE and its short form MTX_ENGAGE
MKVEXTRACT_OPTIONS, MKVTOOLNIX_OPTIONS and its short form MTX_OPTIONS
関連項目¶
mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1)
ウェブ¶
最新のバージョンは、常時MKVToolNixのホームページ[1]から取得できます。
著者¶
Bunkus Moritz[FAMILY Given] <moritz@bunkus.org>
注記¶
- 1.
- MKVToolNixのホームページ
2017-05-20 | MKVToolNix 12.0.0 |