[FFmpeg-user] Handling files with multiple audio Tracks

Tom Evans tevans.uk at googlemail.com
Thu May 10 13:16:51 CEST 2012


On Thu, May 10, 2012 at 12:04 PM, Tarun singhal <tsinghal18 at gmail.com> wrote:
> But if the input video contains 2 audio tracks and if I don't use map
> option, shouldn't ffmpeg copy all the tracks to output by default. But I
> observed By default it copies one audio and one video stream. If I am
> correct, what is the rule behind copying audio tracks in output video
>

Please don't top post.

ffmpeg comes with a manual that explains how to use it. The third
paragraph says:

Each input or output file can in principle contain any number of
streams of different types (video/audio/subtitle/attachment/data).
Allowed number and/or types of streams can be limited by the container
format. Selecting, which streams from which inputs go into output, is
done either automatically or with the "-map" option (see the Stream
selection chapter).

The 'Stream selection' chapter says:

By default ffmpeg includes only one stream of each type (video, audio,
subtitle) present in the input files and adds them to each output file.
It picks the "best" of each based upon the following criteria; for
video it is the stream with the highest resolution, for audio the
stream with the most channels, for subtitle it's the first subtitle
stream. In the case where several streams of the same type rate
equally, the lowest numbered stream is chosen.

You can disable some of those defaults by using "-vn/-an/-sn" options.
For full manual control, use the "-map" option, which disables the
defaults just described.


Cheers

Tom


More information about the ffmpeg-user mailing list