Changes between Version 24 and Version 25 of Map


Ignore:
Timestamp:
Aug 8, 2020, 9:31:53 PM (15 months ago)
Author:
llogan
Comment:

moved simple examples closer to top. minor clarifications.

Legend:

Unmodified
Added
Removed
Modified
  • Map

    v24 v25  
    1414The commands in the diagram above will select the video from `input0.mp4` and the 3rd audio stream from `input1.mkv` to `output.mp4`. The commands do the same thing, but use different syntax to map streams:
    1515
    16 * The top command does not use any ''stream specifiers''. This is an absolute method of mapping and will choose a specific stream regardless of type.
    17 * The bottom command includes [https://ffmpeg.org/ffmpeg.html#Stream-specifiers-1 stream specifiers] (`v` for video, `a` for audio) to limit the streams to a specific type.
     16* The top command does not use any ''stream specifiers''. This is an absolute method of mapping and will choose a specific stream regardless of type. `-map 1:3` refers to ''"second input:fourth stream"''.
     17* The bottom command includes [https://ffmpeg.org/ffmpeg.html#Stream-specifiers-1 stream specifiers] (`v` for video, `a` for audio) to limit the streams to a specific type. `-map 1:a:2` refers to ''"second input:audio only:third audio stream"''.
    1818
    19 Translation:
     19= Simple examples =
    2020
    21 * `-map 1:3` refers to ''"second input:fourth stream"''.
    22 * `-map 1:a:2` refers to ''"second input:audio only:third audio stream"''.
     21* `-map 0` From input index !#0 (the 1st input) select all streams.
     22* `-map 1:a` From input index !#1 (the 2nd input) select all audio streams.
     23* `-map 3:s:4` From input index !#3 (the 4th input) select subtitle stream index !#4 (the fifth subtitle stream).
     24* `-map 0 -map -0:s` Will select all streams from input index !#0 (the 1st input) except subtitles. The `-` indicates ''negative mapping''.
    2325
    2426= Default behavior =
     
    2628If you do not use the `-map` option then the default [https://ffmpeg.org/ffmpeg.html#Stream-selection stream selection] behavior will automatically choose streams.
    2729
    28 * Default stream selection will '''not''' automatically choose all of the streams.
    29 * Only one stream per type will be selected. For example, if the input has 3 video streams it will only choose 1.
     30* Default stream selection will '''not''' automatically choose '''all''' of the streams.
     31* Only 1 stream per type will be selected. For example, if the input has 3 video streams it will only choose 1.
    3032* The default stream selection will choose streams based upon [https://ffmpeg.org/ffmpeg.html#Automatic-stream-selection specific criteria].
    3133
     
    5153== Modifiers ==
    5254
    53 * A `-` character before the `input_file_index`, such as `-map -0:v`, creates a ''negative mapping''. It disables matching streams from already created mappings. See [#Everythingexceptaudio example].
    54 * A trailing `?`, such as `-map 1:a?`, will allow the map to be optional. If the map matches no streams the map will be ignored instead of failing. Note the mapping will still fail if an invalid `input_file_index` is used; such as if the map refers to a non-existent input. See [#Optionalmapping example].
     55* A `-` character before the `input_file_index`, such as `-map -0:v`, creates a ''negative mapping''. This excludes streams already selected by a previous map. See [#Everythingexceptaudio example].
     56* A trailing `?`, such as `-map 1:a?`, will allow the map to be optional. If the map matches no streams the map will be ignored instead of failing. Note the mapping will still fail if an invalid `input_file_index` is used; such as if the map refers to an input that does not exist. See [#Optionalmapping example].
    5557
    5658== Order ==
     
    6062* `-map` order determines the stream order in the output(s).
    6163* Mapping is applied in order. This is useful when using negative mapping.
    62 
    63 == Simple examples ==
    64 
    65 To better understand the syntax here are some examples and descriptions:
    66 
    67 * `-map 0` From input index !#0 (the 1st input) select all streams.
    68 * `-map 1:a` From input index !#1 (the 2nd input) select all audio streams.
    69 * `-map 3:s:4` From input index !#3 (the 4th input) select subtitle stream index !#4 (the fifth subtitle stream).
    70 * `-map 0 -map -0:s` Will select all streams from input index !#0 (the 1st input) except subtitles. The `-` indicates ''negative mapping''.
    7164
    7265= Examples =
     
    177170== Re-order streams ==
    178171
    179 The order of your `-map` options determines the order of the streams in the output. In this example the input file has audio as stream !#0 and video as stream !#1 (which is possible but unusual). Example to re-position video followed by audio:
     172The order of your `-map` options determines the order of the streams in the output. In this example the input file has audio as stream !#0 and video as stream !#1 (which is possible but unusual). Example to re-position video so it is listed first, followed by the audio:
    180173
    181174{{{