Commit e424abc3 authored by Stefano Sabatini's avatar Stefano Sabatini

lavfi: add aeval filter

parent 405b3eb5
......@@ -12,6 +12,7 @@ version <next>
- complete Voxware MetaSound decoder
- remove mp3_header_compress bitstream filters
- Windows resource files for shared libraries
- aeval filter
version 2.1:
......
......@@ -435,6 +435,70 @@ aecho=0.8:0.9:1000|1800:0.3|0.25
@end example
@end itemize
@section aeval
Modify an audio signal according to the specified expressions.
This filter accepts one or more expressions (one for each channel),
which are evaluated and used to modify a corresponding audio signal.
This filter accepts the following options:
@table @option
@item exprs
Set the '|'-separated expressions list for each separate channel. If
the number of input channels is greater than the number of
expressions, the last specified expression is used for the remaining
output channels.
@item channel_layout, c
Set output channel layout. If not specified, the channel layout is
specified by the number of expressions. If set to @samp{same}, it will
use by default the same input channel layout.
@end table
Each expression in @var{exprs} can contain the following constants and functions:
@table @option
@item ch
channel number of the current expression
@item n
number of the evaluated sample, starting from 0
@item s
sample rate
@item t
time of the evaluated sample expressed in seconds
@item nb_in_channels
@item nb_out_channels
input and output number of channels
@item val(CH)
the value of input channel with number @var{CH}
@end table
Note: this filter is slow. For faster processing you should use a
dedicated filter.
@subsection Examples
@itemize
@item
Half volume:
@example
aeval=val(ch)/2:c=same
@end example
@item
Invert phase of the second channel:
@example
eval=val(0)|-val(1)
@end example
@end itemize
@section afade
Apply fade-in/out effect to input audio.
......
......@@ -53,6 +53,7 @@ OBJS-$(CONFIG_AVCODEC) += avcodec.o
OBJS-$(CONFIG_ACONVERT_FILTER) += af_aconvert.o
OBJS-$(CONFIG_ADELAY_FILTER) += af_adelay.o
OBJS-$(CONFIG_AECHO_FILTER) += af_aecho.o
OBJS-$(CONFIG_AEVAL_FILTER) += asrc_aevalsrc.o
OBJS-$(CONFIG_AFADE_FILTER) += af_afade.o
OBJS-$(CONFIG_AFORMAT_FILTER) += af_aformat.o
OBJS-$(CONFIG_AINTERLEAVE_FILTER) += f_interleave.o
......
......@@ -50,6 +50,7 @@ void avfilter_register_all(void)
#endif
REGISTER_FILTER(ADELAY, adelay, af);
REGISTER_FILTER(AECHO, aecho, af);
REGISTER_FILTER(AEVAL, aeval, af);
REGISTER_FILTER(AFADE, afade, af);
REGISTER_FILTER(AFORMAT, aformat, af);
REGISTER_FILTER(AINTERLEAVE, ainterleave, af);
......
This diff is collapsed.
......@@ -30,8 +30,8 @@
#include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 91
#define LIBAVFILTER_VERSION_MICRO 101
#define LIBAVFILTER_VERSION_MINOR 92
#define LIBAVFILTER_VERSION_MICRO 100
#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