FFmpeg - Selecting streams
From PiRho Knowledgebase
Jump to navigationJump to search
The -map option is used to choose which streams from the input(s) should be included in the output(s). The -map option can also be used to exclude specific streams with negative mapping. When the -map option is used, only the selected streams will be included in the output.
The code below selects the 1st video stream from the 1st input file and the 1st audio stream in the 2nd input file:
ffmpeg -i <input.mp4> -i <input.mkv> -map 0:v:0 -map 1:a:0 <output.file>
Reference: [FFmpeg: Selecting streams with the -map option]