

The -map option instructs ffmpeg what streams you want. Also, it is less prone to accidental mapping because 1:1 can refer to any type of stream, while 2:v:3 only refers to the fourth video stream of the third input file. I prefer this method because it's more efficient. For example, you can tell ffmpeg that you want the first video stream from the first input ( 0:v:0), and the first audio stream from the second input ( 1:a:0).


This can be enhanced with stream specifiers. Since ffmpeg starts counting from 0, stream 1:1 refers to the audio from input_1.mp4. The format is input_file_id:input_stream_id. Stream #1:1(und): Audio: aac (LC) (mp4a / 0圆134706D), 48000 Hz, stereo, fltp, 55 kb/s (default)įfmpeg refers to input files and streams with index numbers. In ffmpeg the streams look like this: $ ffmpeg -i input_0.mp4 -i input_1.mp4 Input_0.mp4 has the desired video stream and input_1.mp4 has the desired audio stream:
