1MKVEXTRACT(1) User Commands MKVEXTRACT(1)
2
3
4
6 mkvextract - extract tracks from Matroska files into other files
7
8
9
11 mkvextract tracks <inname> [options] [TID1:out1 [TID2:out2 ...]]
12 mkvextract tags <inname> [options]
13 mkvextract attachments <inname> [options] [AID1:[out1] [AID2:[out2]
14 ...]]
15 mkvextract chapters <inname> [options]
16 mkvextract cuesheet <inname> [options]
17 mkvextract timecodes_v2 <inname> [TID1:out1 [TID2:out2 ...]]
18 mkvextract <-h|-V>
19
20
21
23 This program extracts specific parts from a Matroska file to other use‐
24 ful formats. The first argument tells mkvextract what to extract. Cur‐
25 rently supported is the extraction of tracks, tags, attachments, chap‐
26 ters, CUE sheets and timecodes. The second argument is the name of the
27 source file. It must be a Matroska file.
28
29
30 The following command line options are available for each track in the
31 tracks extraction mode. They have to appear in front of the track
32 specification (see below) they should be applied to.
33
34 -c charset
35 Sets the charset to convert the next text subtitle track to.
36 Only valid if the next track ID targets a text subtitle track.
37 It defaults to UTF-8.
38
39 --blockadd level
40 Keep only the BlockAdditions up to this level. The default is
41 to keep all levels. This option only affects certain kinds of
42 codecs like WAVPACK4.
43
44 --cuesheet
45 Causes mkvextract to extract a CUE sheet from the chapter infor‐
46 mation and tag data for the following track into a file whose
47 name is the track's output name with ".cue" appended to it.
48
49 --fullraw
50 Extracts the raw data into a file without any container data
51 around it. The contents of the CodecPrivate element will be
52 written to the file first if the track contains such a header
53 element. This mode works with all CodecIDs, even the ones that
54 mkvextract doesn't support otherwise, but the resulting files
55 might not be usable.
56
57 --no-ogg
58 Only valid for FLAC tracks. Normally FLAC tracks are embedded in
59 an Ogg transport stream. With this switch they are extracted to
60 raw FLAC files instead.
61
62 --raw Extracts the raw data into a file without any container data
63 around it. Unlike the --fullraw flag this flag does not cause
64 the contents of the CodecPrivate element to be written to the
65 file. This mode works with all CodecIDs, even the ones that
66 mkvextract doesn't support otherwise, but the resulting files
67 might not be usable.
68
69 TID:outname
70 Causes extraction of the track with the ID TID into the file
71 outname if such a track exists in the source file. This option
72 can be given multiple times. The track IDs are the same as the
73 ones output by mkvmerge's --identify option.
74 Each output name should be used only once. The exception are
75 RealAudio and RealVideo tracks. If you use the same name for
76 different tracks then those tracks will be saved in the same
77 file. Example:
78 mkvextract tracks input.mkv 1:output-two-tracks.rm 2:output-two-
79 tracks.rm
80
81 -v, --verbose
82 Be verbose and show all the important Matroska elements as
83 they're read.
84
85
86 Command line syntax for the tags extraction mode:
87
88 -v, --verbose
89 Be verbose and show all the important Matroska elements as
90 they're read.
91
92
93 Command line syntax for the attachments extraction mode:
94
95 AID:outname
96 Causes extraction of the attachment with the ID AID into the
97 file outname if such an attachment exists in the source file.
98 If the outname is left empty then the name of the attachment
99 inside the Matroska file is used instead. This option can be
100 given multiple times. The attachment IDs are the same as the
101 ones output by mkvmerge's --identify option.
102
103 -v, --verbose
104 Be verbose and show all the important Matroska elements as
105 they're read.
106
107
108 Command line syntax for the chapters extraction mode:
109
110 -s, --simple
111 Exports the chapter information in the simple format used in the
112 OGM tools (CHAPTER01=..., CHAPTER01NAME=...). In this mode some
113 information has to be discarded. Default is to output the chap‐
114 ters in XML format.
115
116 -v, --verbose
117 Be verbose and show all the important Matroska elements as
118 they're read.
119
120
121 Command line syntax for the cuesheet extraction mode:
122
123 -v, --verbose
124 Be verbose and show all the important Matroska elements as
125 they're read.
126
127
128 Command line syntax for the timecodes_v2 extraction mode:
129
130 -v, --verbose
131 Be verbose and show all the important Matroska elements as
132 they're read.
133
134
135 If one of the following options is used as the only command line argu‐
136 ment additional information about mkvextract is output.
137
138 -h, --help
139 Show usage information.
140
141 -V, --version
142 Show version information.
143
144
145
147 The decision about the output format is based on the track type, not on
148 the extension used for the output file name. The following track types
149 are supported at the moment:
150
151 V_MPEG4/ISO/AVC
152 H.264 / AVC video tracks are written to H.264 elementary streams
153 which can be processed further with e.g. MP4Box from the GPAC
154 package.
155
156 V_MS/VFW/FOURCC
157 Fixed FPS video tracks with this CodecID are written to AVI
158 files.
159
160 V_REAL/*
161 RealVideo tracks are written to RealMedia files.
162
163 A_MPEG/L3, A_AC3
164 These will be extracted to raw MP3 and AC3 files.
165
166 A_PCM/INT/LIT
167 Raw PCM data will be written to a WAV file.
168
169 A_AAC/MPEG2/*
170 All MPEG2 AAC files will be written into an AAC file with ADTS
171 headers before each packet.
172
173 A_AAC/MPEG4/*
174 All MPEG4 AAC files will be written into an AAC file with ADTS
175 headers before each packet. The ADTS headers will not contain
176 the deprecated emphasis field.
177
178 A_VORBIS
179 Vorbis audio will be written into an Ogg/Vorbis file.
180
181 A_REAL/*
182 RealAudio tracks are written to RealMedia files.
183
184 A_TTA1 TrueAudio tracks are written to TTA files. Please note that due
185 to Matroska's limited timecode precision the extracted file's
186 header will be different regarding two fields: data_length (the
187 total number of samples in the file) and the CRC.
188
189 S_TEXT/UTF8
190 Simple text subtitles will be written as SRT files.
191
192 S_TEXT/SSA, S_TEXT/ASS
193 SSA and ASS text subtitles will be written as SSA/ASS files
194 respectively.
195
196 Tags are converted to a XML format. This format is the same that
197 mkvmerge supports for reading tags.
198
199 Attachments are written to they output file as they are. No conversion
200 whatsoever is done.
201
202 Chapters are converted to a XML format. This format is the same that
203 mkvmerge supports for reading chapters. Alternatively a stripped-down
204 version can be output in the simple OGM style format.
205
206 Timecodes are first sorted and then output as a timecode v2 format com‐
207 pliant file ready to be fed to mkvmerge. The extraction to other for‐
208 mats (v1 and v3) is not supported.
209
210
212 Let's assume you've made a Matroska file with one video track, two
213 audio tracks and two subtitle tracks, and you need the second audio
214 track and the first subtitle track. So first fire up mkvmerge with the
215 --identify option:
216
217 $ mkvmerge -i movie.mkv
218 File 'movie.mkv': container: Matroska
219 Track ID 1: video (V_MS/VFW/FOURCC, DIV3)
220 Track ID 2: audio (A_MPEG/L3)
221 Track ID 3: audio (A_VORBIS)
222 Track ID 4: subtitles (S_TEXT/UTF8)
223 Track ID 5: subtitles (S_TEXT/UTF8)
224
225 Now you can call mkvextract like this:
226
227 $ mkvextract tracks movie.mkv 3:audio.ogg 4:subtitles.srt
228
229 Another example. Let's assume you have a Matroska file with one
230 RealVideo v10 track, one Vorbis audio track and one RealAudio (COOK)
231 track. The identification output might look like this:
232
233 $ mkvmerge -i movie2.mkv
234 File 'movie2.mkv': container: Matroska
235 Track ID 1: video (V_REAL/RV40)
236 Track ID 2: audio (A_VORBIS)
237 Track ID 3: audio (A_REAL/COOK)
238
239 Let's further assume you want only need the video and the RealAudio
240 track but both in the same output file. This is possible for RealMedia
241 files by using the same output name for those tracks that you want to
242 end up in the same file:
243
244 $ mkvextract tracks movie2.mkv 1:extracted.rm 3:extracted.rm
245
246 Sometimes you the raw data of a track might even be useful, e.g. for
247 MPEG-1 tracks. In this case you can use a track flag like this:
248
249 $ mkvextract tracks movie3.mkv --fullraw 1:extracted.mpeg
250
251 If you need the timecodes for all the blocks of track 2 from a file
252 then you can let mkvextract create a timecode v2 format file like this:
253
254 $ mkvextract timecodes_v2 input.mkv 2:timecodes-track2.txt
255
256
258 mkvextract was written by Moritz Bunkus <moritz@bunkus.org>.
259
261 mkvmerge(1), mkvinfo(1)
262
264 The newest version can always be found at
265 <http://www.bunkus.org/videotools/mkvtoolnix/>
266 ⟨http://www.bunkus.org/videotools/mkvtoolnix/⟩
267
268
269
270mkvextract v2.1.0 August 2007 MKVEXTRACT(1)