
What's the difference between -map and -vn?įfmpeg has a default stream selection behavior that will select 1 stream per stream type (1 video, 1 audio, 1 subtitle, 1 data). See FFmpeg Wiki: Audio Channels for more examples.Using stream copy mode ( -c copy) is not possible to use when filtering, so the audio must be re-encoded.See ffmpeg -layouts for audio channel layout names (for channel_layout) and channel names (for channels).channels lists the channel(s) you want to extract.

It is not automatically detected so you must provide the layout name.

channel_layout is the channel layout of the input.Example to get the Front Right (FR) channel from a stereo input: ffmpeg -i stereo.wav -filter_complex "channelsplit=channel_layout=stereo:channels=FR" -map "" front_right.wav Optionally add -c copy before each output file name to enable stream copy mode. ffmpeg -i input.mov -map 0:a:0 output0.wav -map 0:a:1 output1.wav -map 0:a:2 output2.wav -map 0:a:3 output3.wav Each audio stream will be output as single, individual files. This input in this example has 4 audio streams. Various examples: ffmpeg -i input.mp4 -map 0:a output.mp3įfmpeg -i input.avi -map 0:a -c:a aac output.mka Similar to the examples above, but without -c copy. -map 0:a:3 selects audio stream #4 only ( ffmpeg starts counting from 0).Įxtract and re-encode audio / change format.See comparison of container formats.Įxample to extract audio stream #4: ffmpeg -i input.mkv -map 0:a:3 -c copy output.m4a Choose an output format that supports your audio format.Remove -c copy if you want the audio to be re-encoded. This copies the audio and does not re-encode it. -map 0:a selects all audio streams only.This puts all audio into one file: ffmpeg -i input.mov -map 0:a -c copy output.mov

