Changes between Version 8 and Version 9 of AudioChannelManipulation


Ignore:
Timestamp:
Jun 7, 2014, 1:58:58 AM (5 years ago)
Author:
llogan
Comment:

add more diagrams

Legend:

Unmodified
Added
Removed
Modified
  • AudioChannelManipulation

    v8 v9  
    1 = Manipulating audio channels with ffmpeg =
     1= Manipulating audio channels with `ffmpeg` =
    22
    33[[PageOutline(2, Contents)]]
     
    55== stereo → mono stream ==
    66
    7 Mix a single stereo stream down to a mono stream. Both channels of the stereo stream will be downmixed into the stream.
    8 
    97[[Image(stereo_mono.png)]]
     8
     9Mix a single stereo stream down to a mono stream. Both channels of the stereo stream will be downmixed into the stream:
    1010       
    1111{{{
     
    1515== stereo → 2 × mono streams ==
    1616
    17 Output each channel in stereo input to individual mono streams in one output file with the [https://ffmpeg.org/ffmpeg-filters.html#channelsplit channelsplit] audio filter.
    18 
    1917[[Image(stereo_2mono_streams.png)]]
    2018
     19Output each channel in stereo input to individual mono streams in one output file with the [https://ffmpeg.org/ffmpeg-filters.html#channelsplit channelsplit] audio filter:
     20
    2121{{{
    2222ffmpeg -i in.mp3 -filter_complex channelsplit out.mp3
     
    2525== stereo → 2 × mono files ==
    2626
     27[[Image(stereo_2mono_outputs.png)]]
     28
    2729Output each channel in stereo input to individual mono files:
    2830
    29 [[Image(stereo_2mono_outputs.png)]]
    30 
    3131{{{
    3232ffmpeg -i stereo.wav -map_channel 0.0.0 left.wav -map_channel 0.0.1 right.wav
     
    4040
    4141== mono → stereo ==
     42
     43[[Image(mono_stereo.png)]]
     44
    4245Create a stereo output from one mono input:
    4346
     
    5255}}}
    5356
     57'''Note:''' These examples will not magically create a "true" stereo output from the mono input, but simply place the same audio into both the `FL` and `FR` channels of the output (both channels will be identical).
    5458
    5559== 2 × mono → stereo ==
     60
     61[[Image(2mono_stereo.png)]]
     62
    5663Create a stereo output from two mono inputs:
    5764
     
    6774
    6875== 6 × mono → 5.1 ==
     76
     77[[Image(6mono_5point1.png)]]
     78
    6979Combine 6 mono inputs into one 5.1 (6 channel) output with the [https://ffmpeg.org/ffmpeg-filters.html#amerge amerge] audio filter:
    7080
     
    7888== 5.1 → stereo ==
    7989
    80 Note that `ffmpeg` integrates a default down-mix (and up-mix) system that should be preferred (the `-ac` option) unless you have very specific needs.
     90[[Image(5point1_stereo.png)]]
    8191
    8292To downmix you can simply use `-ac 2`:
     
    8696}}}
    8797
    88 If you want to map specific channels and drop the rest you can use the [https://ffmpeg.org/ffmpeg-filters.html#pan pan audio filter]. This will map the Front Left of the input to the Front Left of the output, and the Front Right of the input to the Front Right of the output:
     98* By default when using `-ac 2` the LFE channel is omitted.
     99* `ffmpeg` integrates a default down-mix (and up-mix) system that should be preferred (the `-ac` option) unless you have very specific needs.
     100
     101If you want to map specific channels and drop the rest you can use the [https://ffmpeg.org/ffmpeg-filters.html#pan pan audio filter]. This will map the `FL` (Front Left) of the input to the  `FL` of the output, and the `FR` (Front Right) of the input to the `FR` of the output:
    89102
    90103{{{
     
    98111}}}
    99112
    100 If the `=` in a channel specification is replaced by `<`, then the gains for that specification will be renormalized so that the total is 1, thus avoiding clipping noise.
    101 
    102 See the [https://ffmpeg.org/ffmpeg-filters.html#pan pan audio filter documentation] for additional information and examples.
     113If the `=` in a channel specification is replaced by `<`, then the gains for that specification will be renormalized so that the total is 1, thus avoiding clipping noise. See the [https://ffmpeg.org/ffmpeg-filters.html#pan pan audio filter documentation] for additional information and examples.
    103114
    104115== 2 × stereo → stereo ==
    105 Combine two stereo inputs into one stereo output with the [htts://ffmpeg.org/ffmpeg-filters.html#amerge amerge] and [https://ffmpeg.org/ffmpeg-filters.html#pan pan] audio filters:
     116
     117[[Image(2stereo_stereo.png)]]
     118
     119Combine two stereo inputs into one stereo output with the [https://ffmpeg.org/ffmpeg-filters.html#amerge amerge] and [https://ffmpeg.org/ffmpeg-filters.html#pan pan] audio filters:
    106120
    107121{{{
     
    111125== Mix both stereo channels to stereo ==
    112126
    113 The left channel and right channel will each contain both the left and right channels (like "mono as stereo").
     127[[Image(stereo_stereo_mix.png)]]
     128
     129The left channel and right channel will each contain both the left and right channels (like "mono as stereo"):
    114130
    115131{{{
     
    118134
    119135== Switch stereo channels ==
     136
     137[[Image(switch_stereo_channels.png)]]
     138
    120139Switch left channel to right and right channel to left:
    121140
     
    131150
    132151== Mute a channel ==
     152
     153[[Image(mute_stereo_channel.png)]]
     154
    133155This example will mute the first channel (the left channel) but keep the second channel as is:
    134156