The '-map' option in FFmpeg is used to select which streams (audio, video, subtitles, etc.) from the input file to include in the output file.

The syntax for the '-map' option is:

'-map [input_file_index]:[stream_specifier]'

The 'input_file_index' is the index number of the input file, starting from 0. If you have only one input file, you can omit this parameter.

The 'stream_specifier' is used to select a particular stream from the input file. The syntax for the stream specifier is '[stream_type][stream_index]', where 'stream_type' is a single letter indicating the type of stream (a for audio, v for video, s for subtitles, etc.), and 'stream_index' is the index number of the stream of that type, starting from 0.

For example, to include the first audio and video streams from the first input file in the output file, you can use the following command:

'ffmpeg -i input.mp4 -map 0:a:0 -map 0:v:0 output.mp4'

This command selects the first audio stream (index 0) and the first video stream (index 0) from the first input file (index 0) and includes them in the output file.

You can also use the '-map' option multiple times to include streams from different input files in the output file. For example:

'ffmpeg -i input1.mp4 -i input2.mp4 -map 0:v:0 -map 1:a:1 output.mp4'

This command selects the first video stream from the first input file (index 0) and the second audio stream from the second input file (index 1) and includes them in the output file.

FFmpeg -map: Selecting Streams for Output

原文地址: https://www.cveoy.top/t/topic/mMMz 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录