Changes between Version 36 and Version 37 of AudioChannelManipulation


Ignore:
Timestamp:
Nov 26, 2023, 1:56:52 AM (2 years ago)
Author:
20kbirds
Comment:

Add example of arbitrary channel reduction

Legend:

Unmodified
Added
Removed
Modified
  • AudioChannelManipulation

    v36 v37  
    288288ffmpeg -i input.wav -filter_complex "channelmap=map=FL-FR|FR-FL|FC-FC|LFE-LFE|BL-BL|BR-BR:channel_layout=5.1" output.wav
    289289}}}
     290
     291= Arbitrary channel reduction & mapping =
     292
     293The [https://ffmpeg.org/ffmpeg-filters.html#pan pan] audio filter can be used to reduce the number of channels in a stream with an arbitrary mapping of input to output channels. For example, given a multi-channel WAV input file captured from an audio interface, to extract channels 3 and 4 into a stereo output any of the following commands would work:
     294
     295{{{
     296ffmpeg -i in.wav -af 'pan=2c|c0=c2|c1=c3' out.wav
     297ffmpeg -i in.wav -filter 'pan=2c|c0=c2|c1=c3' out.wav
     298ffmpeg -i in.wav -filter_complex '[0:a] pan=2c|c0=c2|c1=c3' out.wav
     299}}}
     300
     301Here, `2c` specifies that the output should have two channels, and `c0=c2` and `c1=c3` define the mapping of input to output channels. The channel numbers start at zero, thus we define (zero-based) output channels 0 and 1 to come from input channels 2 and 3, respectively.
     302
     303The `-filter_complex` version is only necessary when more than one filter is employed.
    290304
    291305----