Changes between Version 31 and Version 32 of AudioChannelManipulation
- Timestamp:
- Feb 5, 2019, 11:58:22 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AudioChannelManipulation
v31 v32 114 114 [[Image(2mono_stereo.png, nolink)]] 115 115 116 Create a stereo output from two mono inputs with the [https://ffmpeg.org/ffmpeg-filters.html#amerge amerge] audio filter: 116 Create a stereo output from two mono inputs with the [https://ffmpeg.org/ffmpeg-filters.html#join join] audio filter: 117 118 {{{ 119 ffmpeg -i left.mp3 -i right.mp3 -filter_complex "[0:a][1:a]join=inputs=2:channel_layout=stereo[a]" -map "[a]" output.mp3 120 }}} 121 122 or the [https://ffmpeg.org/ffmpeg-filters.html#amerge amerge] audio filter: 117 123 118 124 {{{ … … 124 130 [[Image(6mono_5point1.png, nolink)]] 125 131 126 Combine 6 mono inputs into one 5.1 (6 channel) output with the [https://ffmpeg.org/ffmpeg-filters.html#amerge amerge] audio filter: 132 Combine 6 mono inputs into one 5.1 (6 channel) output with the [https://ffmpeg.org/ffmpeg-filters.html#join join] audio filter: 133 134 {{{ 135 ffmpeg -i front_left.wav -i front_right.wav -i front_center.wav -i lfe.wav -i back_left.wav -i back_right.wav \ 136 -filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]join=inputs=6:channel_layout=5.1[a]" -map "[a]" output.wav 137 }}} 138 139 The join audio filter also allows you to manually choose the layout: 140 141 {{{ 142 ffmpeg -i front_left.wav -i front_right.wav -i front_center.wav -i lfe.wav -i back_left.wav -i back_right.wav \ 143 -filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-LFE|4.0-BL|5.0-BR[a]" -map "[a]" output.wav 144 }}} 145 146 Another method using the [https://ffmpeg.org/ffmpeg-filters.html#amerge amerge] audio filter which is somewhat less flexible than the join filter shown above: 127 147 128 148 {{{ … … 131 151 }}} 132 152 133 All inputs must have the same sample rate and format. If inputs do not have the same duration the output will stop with the shortest.153 With amerge all inputs must have the same sample rate and format. If inputs do not have the same duration the output will stop with the shortest. 134 154 135 155 = 5.1 → 6 × mono = … … 150 170 }}} 151 171 152 153 172 = 5.1 → stereo = 154 173 … … 228 247 [[Image(switch_stereo_channels.png, nolink)]] 229 248 230 Switch left channel to right and right channel to left with the [https://ffmpeg.org/ffmpeg-filters.html#pan pan] audio filer: 249 Switch left channel to right and right channel to left with the [https://ffmpeg.org/ffmpeg-filters.html#channelmap channelmap] audio filter: 250 251 {{{ 252 ffmpeg -i stereo.mp3 -filter_complex "channelmap=map=FL-FR|FR-FL:channel_layout=stereo" output.mp3 253 }}} 254 255 Or with the [https://ffmpeg.org/ffmpeg-filters.html#pan pan] audio filer: 231 256 232 257 {{{ … … 240 265 }}} 241 266 242 ----243 244 267 = Mute a channel = 245 268 … … 256 279 {{{ 257 280 ffmpeg -i stereo.wav -map_channel -1 -map_channel 0.0.1 output.wav 281 }}} 282 283 = Remap channels = 284 285 The [https://ffmpeg.org/ffmpeg-filters.html#channelmap channelmap] audio filter can re-arrange the channel layout. For example, to switch the FL and FR channels in a 5.1 input: 286 287 {{{ 288 ffmpeg -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 258 289 }}} 259 290
