mkvtoolnix/doc/man/mkvextract.xml
2020-10-04 13:11:42 +02:00

945 lines
34 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[
<!ENTITY product "mkvextract">
<!ENTITY version "51.0.0">
<!ENTITY date "2020-10-04">
<!ENTITY mkvmerge "<citerefentry><refentrytitle>mkvmerge</refentrytitle><manvolnum>1</manvolnum></citerefentry>">
<!ENTITY mkvinfo "<citerefentry><refentrytitle>mkvinfo</refentrytitle><manvolnum>1</manvolnum></citerefentry>">
<!ENTITY mkvextract "<citerefentry><refentrytitle>mkvextract</refentrytitle><manvolnum>1</manvolnum></citerefentry>">
<!ENTITY mkvpropedit "<citerefentry><refentrytitle>mkvpropedit</refentrytitle><manvolnum>1</manvolnum></citerefentry>">
<!ENTITY mtxgui "<citerefentry><refentrytitle>mkvtoolnix-gui</refentrytitle><manvolnum>1</manvolnum></citerefentry>">
<!ENTITY matroska "<productname>Matroska</productname>">
<!ENTITY oggvorbis "<productname>OggVorbis</productname>">
<!ENTITY xml "<abbrev>XML</abbrev>">
]>
<refentry lang="en" id="mkvextract">
<refentryinfo>
<productname>&product;</productname>
<date>&date;</date>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Moritz</firstname>
<surname>Bunkus</surname>
<email>moritz@bunkus.org</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>&product;</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="version">&version;</refmiscinfo>
<refmiscinfo class="date">&date;</refmiscinfo>
<refmiscinfo class="source">MKVToolNix</refmiscinfo>
<refmiscinfo class="manual">User Commands</refmiscinfo>
</refmeta>
<refnamediv>
<refname>&product;</refname>
<refpurpose>extract tracks from &matroska; files into other files</refpurpose>
</refnamediv>
<refsynopsisdiv id="mkvextract.synopsis">
<title>Synopsis</title>
<cmdsynopsis>
<command>mkvextract</command>
<arg choice="req">source-filename</arg>
<arg choice="req">mode1</arg>
<arg>options</arg>
<arg>extraction-spec1</arg>
<arg>mode2</arg>
<arg>options</arg>
<arg>extraction-spec2</arg>
<arg></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 id="mkvextract.description">
<title>Description</title>
<para>
This program extracts specific parts from a &matroska; file to other useful formats. The first argument is the name of the source file
which must be a &matroska; file.
</para>
<para>
All other arguments either switch to a certain extraction mode, change options for the currently active mode or specify what to extract into which file.
Multiple modes can be used in the same invocation of mkvextract allowing the extraction of multiple things in a single pass.
Most options can only be used in certain modes with a few options applying to all modes.
</para>
<para>
Currently supported is the extraction of <link linkend="mkvextract.description.tracks">tracks</link>, <link
linkend="mkvextract.description.tags">tags</link>, <link linkend="mkvextract.description.attachments">attachments</link>, <link
linkend="mkvextract.description.chapters">chapters</link>, <link linkend="mkvextract.description.cuesheets">CUE sheets</link>, <link
linkend="mkvextract.description.timestamps_v2">timestamps</link> and <link linkend="mkvextract.description.cues">cues</link>.
</para>
<refsect2 id="mkvextract.description.common">
<title>Common options</title>
<para>
The following options are available in all modes and only described once in this section.
</para>
<variablelist>
<varlistentry id="mkvextract.description.parse_fully">
<term><option>-f</option>, <option>--parse-fully</option></term>
<listitem>
<para>
Sets the parse mode to 'full'. The default 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 use this mode. A full scan of a file can take a couple of minutes while a fast scan only takes
seconds.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.common.command_line_charset">
<term><option>--command-line-charset</option> <parameter>character-set</parameter></term>
<listitem>
<para>
Sets the character set to convert strings given on the command line from. It defaults to the character set given by system's current
locale.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.common.output_charset">
<term><option>--output-charset</option> <parameter>character-set</parameter></term>
<listitem>
<para>
Sets the character set to which strings are converted that are to be output. It defaults to the character set given by system's
current locale.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.common.redirect_output">
<term><option>-r</option>, <option>--redirect-output</option> <parameter>file-name</parameter></term>
<listitem>
<para>
Writes all messages to the file <parameter>file-name</parameter> instead of to the console. While this can be done easily with
output redirection there are cases in which this option is needed: when the terminal reinterprets the output before writing it to a
file. The character set set with <link
linkend="mkvextract.description.common.output_charset"><option>--output-charset</option></link> is honored.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.flush_on_close">
<term><option>--flush-on-close</option></term>
<listitem>
<para>
Tells the program to flush all data cached in memory to storage when closing files opened for writing.
This can be used to prevent data loss on power outages or to circumvent certain problems in the operating system or drivers.
The downside is that multiplexing will take longer as mkvmerge will wait until all data has been written to the storage before exiting.
See issues #2469 and #2480 on the MKVToolNix bug tracker for in-depth discussions on the pros and cons.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.common.ui_language">
<term><option>--ui-language</option> <parameter>code</parameter></term>
<listitem>
<para>
Forces the translations for the language <parameter>code</parameter> to be used (e.g. '<literal>de_DE</literal>' for the German
translations). Entering '<literal>list</literal>' as the <parameter>code</parameter> will cause the program to output a list of
available translations.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.abort_on_warnings">
<term><option>--abort-on-warnings</option></term>
<listitem>
<para>
Tells the program to abort after the first warning is emitted. The program's exit code will be 1.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.debug">
<term><option>--debug</option> <parameter>topic</parameter></term>
<listitem>
<para>
Turn on debugging for a specific feature. This option is only useful for developers.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.engage">
<term><option>--engage</option> <parameter>feature</parameter></term>
<listitem>
<para>
Turn on experimental features. A list of available features can be requested with <command>mkvextract --engage list</command>. These
features are not meant to be used in normal situations.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.gui_mode">
<term><option>--gui-mode</option></term>
<listitem>
<para>
Turns on GUI mode. In this mode specially-formatted lines may be output that can tell a controlling GUI what's happening. These
messages follow the format '<literal>#GUI#message</literal>'. The message may be followed by key/value pairs as in
'<literal>#GUI#message#key1=value1#key2=value2…</literal>'. Neither the messages nor the keys are ever translated and always output
in English.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.verbose">
<term><option>-v</option>, <option>--verbose</option></term>
<listitem>
<para>
Be verbose and show all the important &matroska; elements as they're read.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.help">
<term><option>-h</option>, <option>--help</option></term>
<listitem>
<para>
Show usage information and exit.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.version">
<term><option>-V</option>, <option>--version</option></term>
<listitem>
<para>
Show version information and exit.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.at_sign">
<term><option>@</option><parameter>options-file.json</parameter></term>
<listitem>
<para>
Reads additional command line arguments from the file <parameter>options-file</parameter>. For a full explanation on the supported
formats for such files see the section called "Option files" in the &mkvmerge; man page.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2 id="mkvextract.description.tracks">
<title>Track extraction mode</title>
<para>
Syntax: <command>mkvextract <parameter>source-filename</parameter> <option>tracks</option> <optional><parameter>options</parameter></optional> <parameter>TID1:dest-filename1</parameter> <optional><parameter>TID2:dest-filename2</parameter> ...</optional></command>
</para>
<para>
The following command line options are available for each track in the '<literal>tracks</literal>' extraction mode. They have to appear
in front of the track specification (see below) they should be applied to.
</para>
<variablelist>
<varlistentry id="mkvpropedit.description.character_set">
<term><option>-c</option> <parameter>character-set</parameter></term>
<listitem>
<para>
Sets the character set to convert the next text subtitle track to. Only valid if the
next track ID targets a text subtitle track. It defaults to UTF-8.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.blockadd">
<term><option>--blockadd</option> <parameter>level</parameter></term>
<listitem>
<para>
Keep only the BlockAdditions up to this level. The default is to keep all levels. This option only affects certain kinds of codecs
like WAVPACK4.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.cuesheet">
<term><option>--cuesheet</option></term>
<listitem>
<para>
Causes &mkvextract; to extract a <abbrev>CUE</abbrev> sheet from the chapter information and tag data for the following track into a
file whose name is the track's output name with '<literal>.cue</literal>' appended to it.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.raw">
<term><option>--raw</option></term>
<listitem>
<para>
Extracts the raw data into a file without any container data around it. Unlike the <link
linkend="mkvextract.description.tracks.fullraw"><option>--fullraw</option></link> flag this flag does not cause the contents of the
<classname>CodecPrivate</classname> element to be written to the file. This mode works with all <classname>CodecIDs</classname>, even
the ones that &mkvextract; doesn't support otherwise, but the resulting files might not be usable.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.tracks.fullraw">
<term><option>--fullraw</option></term>
<listitem>
<para>
Extracts the raw data into a file without any container data around it. The contents of the <classname>CodecPrivate</classname>
element will be written to the file first if the track contains such a header element. This mode works with all
<classname>CodecIDs</classname>, even the ones that &mkvextract; doesn't support otherwise, but the resulting files might not be
usable.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.description.output_track">
<term><parameter>TID:outname</parameter></term>
<listitem>
<para>
Causes extraction of the track with the ID <parameter>TID</parameter> into the file
<parameter>outname</parameter> if such a track exists in the source file. This option can be
given multiple times. The track IDs are the same as the ones output by
&mkvmerge;'s <option>--identify</option> option.
</para>
<para>
Each output name should be used only once. The exception are RealAudio and RealVideo tracks. If you use the same name for different
tracks then those tracks will be saved in the same file. Example:
</para>
<screen>$ mkvextract input.mkv tracks 0:video.h264 2:output-two-vobsub-tracks.idx 3:output-two-vobsub-tracks.idx</screen>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2 id="mkvextract.description.attachments">
<title>Attachments extraction mode</title>
<para>
Syntax: <command>mkvextract <parameter>source-filename</parameter> <option>attachments</option> <optional><parameter>options</parameter></optional> <parameter>AID1:outname1</parameter> <optional><parameter>AID2:outname2</parameter> ...</optional></command>
</para>
<variablelist>
<varlistentry id="mkvpropedit.description.output_attachment">
<term><parameter>AID</parameter>:<parameter>outname</parameter></term>
<listitem>
<para>
Causes extraction of the attachment with the ID <parameter>AID</parameter> into the file <parameter>outname</parameter> if such an
attachment exists in the source file. If the <parameter>outname</parameter> is left empty then the name of the attachment inside the
source &matroska; file is used instead. This option can be given multiple times. The attachment IDs are the same as the ones output
by &mkvmerge;'s <option>--identify</option> option.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2 id="mkvextract.description.chapters">
<title>Chapters extraction mode</title>
<para>
Syntax: <command>mkvextract <parameter>source-filename</parameter> <option>chapters</option> <optional><parameter>options</parameter></optional> <parameter>output-filename.xml</parameter></command>
</para>
<variablelist>
<varlistentry id="mkvextract.description.simple">
<term><option>-s</option>, <option>--simple</option></term>
<listitem>
<para>
Exports the chapter information in the simple format used in the <abbrev>OGM</abbrev> tools
(CHAPTER01=..., CHAPTER01NAME=...). In this mode some information has to be
discarded. Default is to output the chapters in &xml; format.
</para>
</listitem>
</varlistentry>
<varlistentry id="mkvpropedit.description.simple_language">
<term><option>--simple-language</option> <parameter>language</parameter></term>
<listitem>
<para>
If the simple format is enabled then &mkvextract; will only output a single entry for each chapter atom encountered even if a chapter atom contains more than one chapter name.
By default &mkvextract; will use the first chapter name found for each atom regardless of its language.
</para>
<para>
Using this option allows the user to determine which chapter names are output if atoms contain more than one chapter name.
The <parameter>language</parameter> parameter must be an ISO 639-1 or ISO 639-2 code.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
The chapters are written to specified output file. By default the &xml; format understood by &mkvmerge; is used. If no chapters are found in the file, the output file is not created.
</para>
</refsect2>
<refsect2 id="mkvextract.description.tags">
<title>Tags extraction mode</title>
<para>
Syntax: <command>mkvextract <parameter>source-filename</parameter> <option>tags</option> <optional><parameter>options</parameter></optional> <parameter>output-filename.xml</parameter></command>
</para>
<para>
The tags are written to specified output file in the &xml; format understood by &mkvmerge;. If no tags are found in the file, the output file is not created.
</para>
</refsect2>
<refsect2 id="mkvextract.description.cuesheets">
<title>Cue sheet extraction mode</title>
<para>
Syntax: <command>mkvextract <parameter>source-filename</parameter> <option>cuesheet</option> <optional><parameter>options</parameter></optional> <parameter>output-filename.cue</parameter></command>
</para>
<para>
The cue sheet is written to specified output file. If no chapters or tags are found in the file, the output file is not created.
</para>
</refsect2>
<refsect2 id="mkvextract.description.timestamps_v2">
<title>Timestamp extraction mode</title>
<para>
Syntax: <command>mkvextract <parameter>source-filename</parameter> <option>timestamps_v2</option> <optional><parameter>options</parameter></optional> <parameter>TID1:dest-filename1</parameter> <optional><parameter>TID2:dest-filename2</parameter> ...</optional></command>
</para>
<variablelist>
<varlistentry id="mkvpropedit.description.output_timestamps_v2">
<term><parameter>TID:outname</parameter></term>
<listitem>
<para>
Causes extraction of the timestamps for the track with the ID <parameter>TID</parameter> into the file <parameter>outname</parameter>
if such a track exists in the source file. This option can be given multiple times. The track IDs are the same as the ones output by
&mkvmerge;'s <option>--identify</option> option.
</para>
<para>
Example:
</para>
<screen>$ mkvextract input.mkv timestamps_v2 1:ts-track1.txt 2:ts-track2.txt</screen>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2 id="mkvextract.description.cues">
<title>Cues extraction mode</title>
<para>
Syntax: <command>mkvextract <parameter>source-filename</parameter> <option>cues</option> <optional><parameter>options</parameter></optional> <parameter>TID1:dest-filename1</parameter> <optional><parameter>TID2:dest-filename2</parameter> ...</optional></command>
</para>
<variablelist>
<varlistentry id="mkvpropedit.description.output_cues">
<term><parameter>TID:dest-filename</parameter></term>
<listitem>
<para>
Causes extraction of the cues for the track with the ID <parameter>TID</parameter> into the file <parameter>outname</parameter>
if such a track exists in the source file. This option can be given multiple times. The track IDs are the same as the ones output by
&mkvmerge;'s <option>--identify</option> option and not the numbers contained in the <classname>CueTrack</classname> element.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
The format output is a simple text format: one line per <classname>CuePoint</classname> element with <literal>key=value</literal>
pairs. If an optional element is not present in a <classname>CuePoint</classname> (e.g. <classname>CueDuration</classname>) then a dash
will be output as the value.
</para>
<para>
Example:
</para>
<screen>timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11</screen>
<para>The possible keys are:</para>
<variablelist>
<varlistentry>
<term>timestamp</term>
<listitem>
<para>The cue point's timestamp with nanosecond precision. The format is <literal>HH:MM:SS.nnnnnnnnn</literal>. This element is always set.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>duration</term>
<listitem>
<para>The cue point's duration with nanosecond precision. The format is <literal>HH:MM:SS.nnnnnnnnn</literal>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>cluster_position</term>
<listitem>
<para>The absolute position in bytes inside the &matroska; file where the cluster containing the referenced element starts.</para>
<note>
<para>Inside the &matroska; file the <classname>CueClusterPosition</classname> is relative to the segment's data start offset. The
value output by &mkvextract;'s cue extraction mode, however, contains that offset already and is an absolute offset from the
beginning of the file.</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term>relative_position</term>
<listitem>
<para>The relative position in bytes inside the cluster where the <classname>BlockGroup</classname> or
<classname>SimpleBlock</classname> element the cue point refers to starts.</para>
<note>
<para>Inside the &matroska; file the <classname>CueRelativePosition</classname> is relative to the cluster's data start
offset. The value output by &mkvextract;'s cue extraction mode, however, is relative to the cluster's ID. The absolute position
inside the file can be calculated by adding <literal>cluster_position</literal> and <literal>relative_position</literal>.</para>
</note>
</listitem>
</varlistentry>
</variablelist>
<para>
Example:
</para>
<screen>$ mkvextract input.mkv cues 1:cues-track1.txt 2:cues-track2.txt</screen>
</refsect2>
</refsect1>
<refsect1 id="mkvextract.examples">
<title>Examples</title>
<para>
Extracting both chapters and tags in their respective &xml; formats at the same time:
</para>
<screen>$ mkvextract movie.mkv chapters movie-chapters.xml tags movie-tags.xml</screen>
<para>
Extracting a couple of tracks and their respective timestamps at the same time:
</para>
<screen>$ mkvextract "Another Movie.mkv" tracks 0:video.h265 "1:main audio.aac" "2:director's comments.aac" timestamps_v2 "0:timestamps video.txt" "1:timestamps main audio.txt" "2:timestamps director's comments.txt"</screen>
<para>
Extracting chapters in the Ogg/OGM format and re-encoding a text subtitle track to another character set:
</para>
<screen>$ mkvextract "My Movie.mkv" chapters --simple "My Chapters.txt" tracks -c MS-ANSI "2:My Subtitles.srt"</screen>
</refsect1>
<refsect1 id="mkvextract.text_files_and_charsets">
<title>Text files and character set conversions</title>
<para>
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; man page.
</para>
</refsect1>
<refsect1 id="mkvextract.output_file_formats">
<title>Output file formats</title>
<para>
The decision about the output format is based on the track type, not on the extension used for the output file name. The following track
types are supported at the moment:
</para>
<variablelist>
<varlistentry>
<term>A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC</term>
<listitem>
<para>
All <abbrev>AAC</abbrev> files will be written into an <abbrev>AAC</abbrev> file with <abbrev>ADTS</abbrev> headers before each
packet. The <abbrev>ADTS</abbrev> headers will not contain the deprecated emphasis field.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>A_AC3, A_EAC3</term>
<listitem>
<para>
These will be extracted to raw <abbrev>AC-3</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>A_ALAC</term>
<listitem>
<para>
<abbrev>ALAC</abbrev> tracks are written to <abbrev>CAF</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>A_DTS</term>
<listitem>
<para>
These will be extracted to raw <abbrev>DTS</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>A_FLAC</term>
<listitem>
<para>
<abbrev>FLAC</abbrev> tracks are written to raw <abbrev>FLAC</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>A_MPEG/L2</term>
<listitem>
<para>
MPEG-1 Audio Layer II streams will be extracted to raw <abbrev>MP2</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>A_MPEG/L3</term>
<listitem>
<para>
These will be extracted to raw <abbrev>MP3</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>A_OPUS</term>
<listitem>
<para>
<productname>Opus</productname> tracks are written to <productname>OggOpus</productname> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>A_PCM/INT/LIT, A_PCM/INT/BIG</term>
<listitem>
<para>
Raw <abbrev>PCM</abbrev> data will be written to a <abbrev>WAV</abbrev> file. Big-endian integer data will be converted to little-endian data in the process.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>A_REAL/*</term>
<listitem>
<para>
<productname>RealAudio</productname> tracks are written to <productname>RealMedia</productname> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>A_TRUEHD, A_MLP</term>
<listitem>
<para>
These will be extracted to raw <abbrev>TrueHD</abbrev>/<abbrev>MLP</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>A_TTA1</term>
<listitem>
<para>
<productname>TrueAudio</productname> tracks are written to <abbrev>TTA</abbrev> files. Please note that due to &matroska;'s limited
timestamp precision the extracted file's header will be different regarding two fields: <varname>data_length</varname> (the total
number of samples in the file) and the <abbrev>CRC</abbrev>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>A_VORBIS</term>
<listitem>
<para>
Vorbis audio will be written into an &oggvorbis; file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>A_WAVPACK4</term>
<listitem>
<para>
<productname>WavPack</productname> tracks are written to <abbrev>WV</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>S_HDMV/PGS</term>
<listitem>
<para>
<abbrev>PGS</abbrev> subtitles will be written as <abbrev>SUP</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>S_HDMV/TEXTST</term>
<listitem>
<para>
<abbrev>TextST</abbrev> subtitles will be written as a special file format invented for &mkvmerge; and &mkvextract;.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>S_KATE</term>
<listitem>
<para>
<productname>Kate</productname> streams will be written within an <productname>Ogg</productname> container.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS</term>
<listitem>
<para>
<abbrev>SSA</abbrev> and <abbrev>ASS</abbrev> text subtitles will be written as <abbrev>SSA</abbrev>/<abbrev>ASS</abbrev> files
respectively.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>S_TEXT/UTF8, S_TEXT/ASCII</term>
<listitem>
<para>
Simple text subtitles will be written as <abbrev>SRT</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>S_VOBSUB</term>
<listitem>
<para>
<productname>VobSub</productname> subtitles will be written as <abbrev>SUB</abbrev> files along with the
respective index files, as <abbrev>IDX</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>S_TEXT/USF</term>
<listitem>
<para>
<abbrev>USF</abbrev> text subtitles will be written as <abbrev>USF</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>S_TEXT/WEBVTT</term>
<listitem>
<para>
<abbrev>WebVTT</abbrev> text subtitles will be written as <abbrev>WebVTT</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>V_MPEG1, V_MPEG2</term>
<listitem>
<para>
<abbrev>MPEG-1</abbrev> and <abbrev>MPEG-2</abbrev> video tracks will be written as <abbrev>MPEG</abbrev> elementary streams.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>V_MPEG4/ISO/AVC</term>
<listitem>
<para>
<abbrev>H.264</abbrev> / <abbrev>AVC</abbrev> video tracks are written to <abbrev>H.264</abbrev> elementary streams which can be
processed further with e.g. <productname>MP4Box</productname> from the <productname>GPAC</productname> package.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>V_MPEG4/ISO/HEVC</term>
<listitem>
<para>
<abbrev>H.265</abbrev> / <abbrev>HEVC</abbrev> video tracks are written to <abbrev>H.265</abbrev> elementary streams which can be
processed further with e.g. <productname>MP4Box</productname> from the <productname>GPAC</productname> package.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>V_MS/VFW/FOURCC</term>
<listitem>
<para>
Fixed <abbrev>FPS</abbrev> video tracks with this <classname>CodecID</classname> are written to <abbrev>AVI</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>V_REAL/*</term>
<listitem>
<para>
<productname>RealVideo</productname> tracks are written to <productname>RealMedia</productname> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>V_THEORA</term>
<listitem>
<para>
<productname>Theora</productname> streams will be written within an <productname>Ogg</productname> container
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>V_VP8, V_VP9</term>
<listitem>
<para>
<abbrev>VP8</abbrev> / <abbrev>VP9</abbrev> tracks are written to <abbrev>IVF</abbrev> files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Tags</term>
<listitem>
<para>
Tags are converted to a &xml; format. This format is the same that &mkvmerge; supports for reading tags.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Attachments</term>
<listitem>
<para>
Attachments are written to the output file as they are. No conversion whatsoever is done.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Chapters</term>
<listitem>
<para>
Chapters are converted to a &xml; format. This format is the same that &mkvmerge; supports for reading chapters. Alternatively a
stripped-down version can be output in the simple <abbrev>OGM</abbrev> style format.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Timestamps</term>
<listitem>
<para>
Timestamps are first sorted and then output as a timestamp v2 format compliant file ready to be fed to &mkvmerge;. The extraction to
other formats (v1, v3 and v4) is not supported.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Exit codes</title>
<para>
&mkvextract; exits with one of three exit codes:
</para>
<itemizedlist>
<listitem>
<para>
<constant>0</constant> -- This exit code means that extraction has completed successfully.
</para>
</listitem>
<listitem>
<para>
<constant>1</constant> -- In this case &mkvextract; has output at least one warning, but extraction did continue. A warning is
prefixed with the text '<literal>Warning:</literal>'. 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.
</para>
</listitem>
<listitem>
<para>
<constant>2</constant> -- This exit code is used after an error occurred. &mkvextract; aborts right after outputting the error message.
Error messages range from wrong command line arguments over read/write errors to broken files.
</para>
</listitem>
</itemizedlist>
</refsect1>
<refsect1 id="mkvextract.environment_variables">
<title>Environment variables</title>
<para>
&mkvextract; uses the default variables that determine the system's locale (e.g. <varname>LANG</varname> and the <varname>LC_*</varname>
family). Additional variables:
</para>
<variablelist>
<varlistentry id="mkvextract.environment_variables.debug">
<term><varname>MKVEXTRACT_DEBUG</varname>, <varname>MKVTOOLNIX_DEBUG</varname> and its short form <varname>MTX_DEBUG</varname></term>
<listitem>
<para>The content is treated as if it had been passed via the <link
linkend="mkvextract.description.debug"><option>--debug</option></link> option.</para>
</listitem>
</varlistentry>
<varlistentry id="mkvextract.environment_variables.engage">
<term><varname>MKVEXTRACT_ENGAGE</varname>, <varname>MKVTOOLNIX_ENGAGE</varname> and its short form <varname>MTX_ENGAGE</varname></term>
<listitem>
<para>The content is treated as if it had been passed via the <link
linkend="mkvextract.description.engage"><option>--engage</option></link> option.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="mkvextract.seealso">
<title>See also</title>
<para>
&mkvmerge;, &mkvinfo;, &mkvpropedit;, &mtxgui;
</para>
</refsect1>
<refsect1 id="mkvextract.www">
<title>WWW</title>
<para>
The latest version can always be found at <ulink url="https://mkvtoolnix.download/">the MKVToolNix homepage</ulink>.
</para>
</refsect1>
</refentry>