summaryrefslogtreecommitdiff
path: root/doc/ffmpeg.texi
diff options
context:
space:
mode:
authorpkviet <pkv.stream@gmail.com>2017-08-22 11:30:45 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-25 23:41:11 +0200
commite0436ddaa49699fd3842ca36a9524bf31b55cfed (patch)
treeac7923c3e0b9b840e973b83b409f10c7d8e797d1 /doc/ffmpeg.texi
parent7c10068da10aa288195f5eb5d7e34eb2d8ff7447 (diff)
ffmpeg options: Enable trailing ? for map_channel
The -map option allows for a trailing ? so that an error is not thrown if the input stream does not exist. This capability is extended to the map_channel option. This allows a ffmpeg command not to break if an input channel does not exist, which can be of use (for instance, scripts processing audio channels with sources having unset number of audio channels). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'doc/ffmpeg.texi')
-rw-r--r--doc/ffmpeg.texi13
1 files changed, 12 insertions, 1 deletions
diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index 4616a4239e..de6d3f139a 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -996,7 +996,7 @@ such streams is attempted.
Allow input streams with unknown type to be copied instead of failing if copying
such streams is attempted.
-@item -map_channel [@var{input_file_id}.@var{stream_specifier}.@var{channel_id}|-1][:@var{output_file_id}.@var{stream_specifier}]
+@item -map_channel [@var{input_file_id}.@var{stream_specifier}.@var{channel_id}|-1][?][:@var{output_file_id}.@var{stream_specifier}]
Map an audio channel from a given input to an output. If
@var{output_file_id}.@var{stream_specifier} is not set, the audio channel will
be mapped on all the audio streams.
@@ -1005,6 +1005,10 @@ Using "-1" instead of
@var{input_file_id}.@var{stream_specifier}.@var{channel_id} will map a muted
channel.
+A trailing @code{?} will allow the map_channel to be
+optional: if the map_channel matches no channel the map_channel will be ignored instead
+of failing.
+
For example, assuming @var{INPUT} is a stereo audio file, you can switch the
two audio channels with the following command:
@example
@@ -1052,6 +1056,13 @@ video stream), you can use the following command:
ffmpeg -i input.mkv -filter_complex "[0:1] [0:2] amerge" -c:a pcm_s16le -c:v copy output.mkv
@end example
+To map the first two audio channels from the first input, and using the
+trailing @code{?}, ignore the audio channel mapping if the first input is
+mono instead of stereo:
+@example
+ffmpeg -i INPUT -map_channel 0.0.0 -map_channel 0.0.1? OUTPUT
+@end example
+
@item -map_metadata[:@var{metadata_spec_out}] @var{infile}[:@var{metadata_spec_in}] (@emph{output,per-metadata})
Set metadata information of the next output file from @var{infile}. Note that
those are file indices (zero-based), not filenames.