Commit 41e637e4 authored by Alex Converse's avatar Alex Converse

lavfi: Add the af_channelmap audio channel mapping filter.

Inspired by MPlayer's af_channels filter and SoX's remix effect.
parent dc07fb6f
......@@ -29,6 +29,7 @@ version <next>:
- iLBC encoding/decoding via libilbc
- Microsoft Screen 1 decoder
- join audio filter
- audio channel mapping filter
version 0.8:
......
......@@ -232,6 +232,39 @@ front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
side_right.wav
@end example
@section channelmap
Remap input channels to new locations.
This filter accepts the following named parameters:
@table @option
@item channel_layout
Channel layout of the output stream.
@item map
Map channels from input to output. The argument is a comma-separated list of
mappings, each in the @code{@var{in_channel}-@var{out_channel}} or
@var{in_channel} form. @var{in_channel} can be either the name of the input
channel (e.g. FL for front left) or its index in the input channel layout.
@var{out_channel} is the name of the output channel or its index in the output
channel layout. If @var{out_channel} is not given then it is implicitly an
index, starting with zero and increasing by one for each mapping.
@end table
If no mapping is present, the filter will implicitly map input channels to
output channels preserving index.
For example, assuming a 5.1+downmix input MOV file
@example
avconv -i in.mov -filter 'channelmap=map=DL-FL\,DR-FR' out.wav
@end example
will create an output WAV file tagged as stereo from the downmix channels of
the input.
To fix a 5.1 WAV improperly encoded in AAC's native channel order
@example
avconv -i in.wav -filter 'channelmap=1\,2\,0\,5\,3\,4:channel_layout=5.1' out.wav
@end example
@section join
Join multiple input streams into one multi-channel stream.
......
......@@ -31,6 +31,7 @@ OBJS-$(CONFIG_AMIX_FILTER) += af_amix.o
OBJS-$(CONFIG_ANULL_FILTER) += af_anull.o
OBJS-$(CONFIG_ASPLIT_FILTER) += split.o
OBJS-$(CONFIG_ASYNCTS_FILTER) += af_asyncts.o
OBJS-$(CONFIG_CHANNELMAP_FILTER) += af_channelmap.o
OBJS-$(CONFIG_CHANNELSPLIT_FILTER) += af_channelsplit.o
OBJS-$(CONFIG_JOIN_FILTER) += af_join.o
OBJS-$(CONFIG_RESAMPLE_FILTER) += af_resample.o
......
This diff is collapsed.
......@@ -40,6 +40,7 @@ void avfilter_register_all(void)
REGISTER_FILTER (ANULL, anull, af);
REGISTER_FILTER (ASPLIT, asplit, af);
REGISTER_FILTER (ASYNCTS, asyncts, af);
REGISTER_FILTER (CHANNELMAP, channelmap, af);
REGISTER_FILTER (CHANNELSPLIT,channelsplit,af);
REGISTER_FILTER (JOIN, join, af);
REGISTER_FILTER (RESAMPLE, resample, af);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment