Commit 1fbf7165 authored by Clément Bœsch's avatar Clément Bœsch Committed by Nicolas George

lavfi: reimplement MPlayer's af_pan filter for libavfilter.

Original code by Clément Bœsch.
Parameters parsing and misc enhancements by Nicolas George.
parent fd1cea65
......@@ -122,6 +122,7 @@ easier to use. The changes are:
- VBLE Decoder
- OS X Video Decoder Acceleration (VDA) support
- compact and csv output in ffprobe
- pan audio filter
version 0.8:
......
......@@ -235,6 +235,54 @@ the listener (standard for speakers).
Ported from SoX.
@section pan
Mix channels with specific gain levels. The filter accepts the output
channel layout followed by a set of channels definitions.
The filter accepts parameters of the form:
"@var{l}:@var{outdef}:@var{outdef}:..."
@table @option
@item l
output channel layout or number of channels
@item outdef
output channel specification, of the form:
"@var{out_name}=[@var{gain}*]@var{in_name}[+[@var{gain}*]@var{in_name}...]"
@item out_name
output channel to define, either a channel name (FL, FR, etc.) or a channel
number (c0, c1, etc.)
@item gain
multiplicative coefficient for the channel, 1 leaving the volume unchanged
@item in_name
input channel to use, see out_name for details; it is not possible to mix
named and numbered input channels
@end table
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.
For example, if you want to down-mix from stereo to mono, but with a bigger
factor for the left channel:
@example
pan=1:c0=0.9*c0+0.1*c1
@end example
A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
7-channels surround:
@example
pan=stereo: FL < FL + 0.5*FC + 0.6*BL + 0.6*SL : FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
@end example
Note that @file{ffmpeg} integrates a default down-mix (and up-mix) system
that should be preferred (see "-ac" option) unless you have very specific
needs.
@section volume
Adjust the input audio volume.
......
......@@ -29,6 +29,7 @@ OBJS-$(CONFIG_ANULL_FILTER) += af_anull.o
OBJS-$(CONFIG_ARESAMPLE_FILTER) += af_aresample.o
OBJS-$(CONFIG_ASHOWINFO_FILTER) += af_ashowinfo.o
OBJS-$(CONFIG_EARWAX_FILTER) += af_earwax.o
OBJS-$(CONFIG_PAN_FILTER) += af_pan.o
OBJS-$(CONFIG_VOLUME_FILTER) += af_volume.o
OBJS-$(CONFIG_ABUFFER_FILTER) += asrc_abuffer.o
......
This diff is collapsed.
......@@ -40,6 +40,7 @@ void avfilter_register_all(void)
REGISTER_FILTER (ARESAMPLE, aresample, af);
REGISTER_FILTER (ASHOWINFO, ashowinfo, af);
REGISTER_FILTER (EARWAX, earwax, af);
REGISTER_FILTER (PAN, pan, af);
REGISTER_FILTER (VOLUME, volume, af);
REGISTER_FILTER (ABUFFER, abuffer, asrc);
......
......@@ -29,8 +29,8 @@
#include "libavutil/rational.h"
#define LIBAVFILTER_VERSION_MAJOR 2
#define LIBAVFILTER_VERSION_MINOR 48
#define LIBAVFILTER_VERSION_MICRO 1
#define LIBAVFILTER_VERSION_MINOR 49
#define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
......
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