Commit dc07fb6f authored by Anton Khirnov's avatar Anton Khirnov

lavfi: add join audio filter.

It joins multiple input streams into one multi-channel output.
parent f75be985
......@@ -28,6 +28,7 @@ version <next>:
- RTMPT protocol support
- iLBC encoding/decoding via libilbc
- Microsoft Screen 1 decoder
- join audio filter
version 0.8:
......
......@@ -232,6 +232,43 @@ front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
side_right.wav
@end example
@section join
Join multiple input streams into one multi-channel stream.
The filter accepts the following named parameters:
@table @option
@item inputs
Number of input streams. Defaults to 2.
@item channel_layout
Desired output channel layout. Defaults to stereo.
@item map
Map channels from inputs to output. The argument is a comma-separated list of
mappings, each in the @code{@var{input_idx}.@var{in_channel}-@var{out_channel}}
form. @var{input_idx} is the 0-based index of the input stream. @var{in_channel}
can be either the name of the input channel (e.g. FR for front left) or its
index in the specified input stream. @var{out_channel} is the name of the output
channel.
@end table
The filter will attempt to guess the mappings when those are not specified
explicitly. It does so by first trying to find an unused matching input channel
and if that fails it picks the first unused input channel.
E.g. to join 3 inputs (with properly set channel layouts)
@example
avconv -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
@end example
To build a 5.1 output from 6 single-channel streams:
@example
avconv -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
'join=inputs=6:channel_layout=5.1:map=0.0-FL\,1.0-FR\,2.0-FC\,3.0-SL\,4.0-SR\,5.0-LFE'
out
@end example
@section resample
Convert the audio sample format, sample rate and channel layout. This filter is
not meant to be used directly, it is inserted automatically by libavfilter
......
......@@ -32,6 +32,7 @@ OBJS-$(CONFIG_ANULL_FILTER) += af_anull.o
OBJS-$(CONFIG_ASPLIT_FILTER) += split.o
OBJS-$(CONFIG_ASYNCTS_FILTER) += af_asyncts.o
OBJS-$(CONFIG_CHANNELSPLIT_FILTER) += af_channelsplit.o
OBJS-$(CONFIG_JOIN_FILTER) += af_join.o
OBJS-$(CONFIG_RESAMPLE_FILTER) += af_resample.o
OBJS-$(CONFIG_ANULLSRC_FILTER) += asrc_anullsrc.o
......
This diff is collapsed.
......@@ -41,6 +41,7 @@ void avfilter_register_all(void)
REGISTER_FILTER (ASPLIT, asplit, af);
REGISTER_FILTER (ASYNCTS, asyncts, af);
REGISTER_FILTER (CHANNELSPLIT,channelsplit,af);
REGISTER_FILTER (JOIN, join, af);
REGISTER_FILTER (RESAMPLE, resample, af);
REGISTER_FILTER (ANULLSRC, anullsrc, asrc);
......
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