| | 142 | |
| | 143 | == Example 5 == |
| | 144 | You can use the "-map" command in creating multiple output files, ex: |
| | 145 | {{{ |
| | 146 | ffmpeg -i input.mkv -map 0:1 -map 0:2 audios_only.mkv -map 0:0 video_only.mkv |
| | 147 | }}} |
| | 148 | |
| | 149 | The default is to map the "highest quality video" and "highest quality audio" to each output file (basically reuses it for each output), see also [[Creating multiple outputs]]. |
| | 150 | |
| | 151 | == Example 6 == |
| | 152 | You can use the named output of a filtergraph as a mapping parameter, ex: |
| | 153 | {{{ |
| | 154 | ffmpeg -i INPUT -filter_complex "[0] scale=100x100[smaller_sized]" -map "[smaller_sized]" out.mp4 |
| | 155 | }}} |
| | 156 | which (in our example) is the same as specifying the stream more precisely, and equivalent to this |
| | 157 | {{{ |
| | 158 | ffmpeg -i INPUT -filter_complex "[0:0] scale=100x100[smaller_sized]" -map "[smaller_sized]" out.mp4 |
| | 159 | }}} |
| | 160 | |
| | 161 | == Example 7 == |
| | 162 | |
| | 163 | There are stream selection shortcuts you can also use like "0:v" |
| | 164 | {{{ |
| | 165 | ffmpeg -i input -map 0:v -map 0:a output.mkv # chooses video and audio from input 0 |
| | 166 | }}} |
| | 167 | See [http://ffmpeg.org/ffmpeg.html#Stream-specifiers stream specifiers] for details. |