Commit fa04ec72 authored by Paul B Mahol's avatar Paul B Mahol

avfilter: add afftfilter

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 56c182c4
......@@ -56,6 +56,7 @@ version <next>:
- ahistogram filter
- only seek with the right mouse button in ffplay
- toggle full screen when double-clicking with the left mouse button in ffplay
- afftfilt filter
version 2.8:
......
......@@ -2841,6 +2841,8 @@ unix_protocol_deps="sys_un_h"
unix_protocol_select="network"
# filters
afftfilt_filter_deps="avcodec"
afftfilt_filter_select="fft"
amovie_filter_deps="avcodec avformat"
aresample_filter_deps="swresample"
ass_filter_deps="libass"
......@@ -6065,6 +6067,7 @@ done
enabled zlib && add_cppflags -DZLIB_CONST
# conditional library dependencies, in linking order
enabled afftfilt_filter && prepend avfilter_deps "avcodec"
enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
enabled aresample_filter && prepend avfilter_deps "swresample"
enabled asyncts_filter && prepend avfilter_deps "avresample"
......
......@@ -733,6 +733,83 @@ afade=t=out:st=875:d=25
@end example
@end itemize
@section afftfilt
Apply arbitrary expressions to samples in frequency domain.
@table @option
@item real
Set frequency domain real expression for each separate channel separated
by '|'. Default is "1".
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 imag
Set frequency domain imaginary expression for each separate channel
separated by '|'. If not set, @var{real} option is used.
Each expression in @var{real} and @var{imag} can contain the following
constants:
@table @option
@item sr
sample rate
@item b
current frequency bin number
@item nb
number of available bins
@item ch
channel number of the current expression
@item chs
number of channels
@item pts
current frame pts
@end table
@item win_size
Set window size.
It accepts the following values:
@table @samp
@item w16
@item w32
@item w64
@item w128
@item w256
@item w512
@item w1024
@item w2048
@item w4096
@item w8192
@item w16384
@item w32768
@item w65536
@end table
Default is @code{w4096}
@item win_func
Set window function. Default is @code{hann}.
@item overlap
Set window overlap. If set to 1, the recommended overlap for selected
window function will be picked. Default is @code{0.75}.
@end table
@subsection Examples
@itemize
@item
Increase first 50 bins by 0.1 and lower all other frequencies by factor of 10:
@example
afftfilt="1.1*between(b\,0\,49)+0.1*between(b\,50\,f)"
@end example
@end itemize
@anchor{aformat}
@section aformat
......
......@@ -29,6 +29,7 @@ OBJS-$(CONFIG_ACROSSFADE_FILTER) += af_afade.o
OBJS-$(CONFIG_ADELAY_FILTER) += af_adelay.o
OBJS-$(CONFIG_AECHO_FILTER) += af_aecho.o
OBJS-$(CONFIG_AEMPHASIS_FILTER) += af_aemphasis.o
OBJS-$(CONFIG_AFFTFILT_FILTER) += af_afftfilt.o window_func.o
OBJS-$(CONFIG_ANEQUALIZER_FILTER) += af_anequalizer.o
OBJS-$(CONFIG_AEVAL_FILTER) += aeval.o
OBJS-$(CONFIG_AFADE_FILTER) += af_afade.o
......
This diff is collapsed.
......@@ -52,6 +52,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(AEMPHASIS, aemphasis, af);
REGISTER_FILTER(AEVAL, aeval, af);
REGISTER_FILTER(AFADE, afade, af);
REGISTER_FILTER(AFFTFILT, afftfilt, af);
REGISTER_FILTER(AFORMAT, aformat, af);
REGISTER_FILTER(AGATE, agate, af);
REGISTER_FILTER(AINTERLEAVE, ainterleave, af);
......
......@@ -30,7 +30,7 @@
#include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 6
#define LIBAVFILTER_VERSION_MINOR 25
#define LIBAVFILTER_VERSION_MINOR 26
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
......
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