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

avfilter: add native headphone spatialization filter

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent aad1b678
......@@ -19,6 +19,7 @@ version <next>:
- surround audio filter
- sofalizer filter switched to libmysofa
- Gremlin Digital Video demuxer and decoder
- headphone audio filter
version 3.3:
- CrystalHD decoder moved to new decode API
......
......@@ -2789,6 +2789,49 @@ Samples where the target gain does not match between channels
@end table
@end table
@section headphone
Apply head-related transfer functions (HRTFs) to create virtual
loudspeakers around the user for binaural listening via headphones.
The HRIRs are provided via additional streams, for each channel
one stereo input stream is needed.
The filter accepts the following options:
@table @option
@item map
Set mapping of input streams for convolution.
The argument is a '|'-separated list of channel names in order as they
are given as additional stream inputs for filter.
This also specify number of input streams. Number of input streams
must be not less than number of channels in first stream plus one.
@item gain
Set gain applied to audio. Value is in dB. Default is 0.
@item type
Set processing type. Can be @var{time} or @var{freq}. @var{time} is
processing audio in time domain which is slow.
@var{freq} is processing audio in frequency domain which is fast.
Default is @var{freq}.
@item lfe
Set custom gain for LFE channels. Value is in dB. Default is 0.
@end table
@subsection Examples
@itemize
@item
Full example using wav files as coefficients with amovie filters for 7.1 downmix,
each amovie filter use stereo file with IR coefficients as input.
The files give coefficients for each position of virtual loudspeaker:
@example
ffmpeg -i input.wav -lavfi-complex "amovie=azi_270_ele_0_DFC.wav[sr],amovie=azi_90_ele_0_DFC.wav[sl],amovie=azi_225_ele_0_DFC.wav[br],amovie=azi_135_ele_0_DFC.wav[bl],amovie=azi_0_ele_0_DFC.wav,asplit[fc][lfe],amovie=azi_35_ele_0_DFC.wav[fl],amovie=azi_325_ele_0_DFC.wav[fr],[a:0][fl][fr][fc][lfe][bl][br][sl][sr]headphone=FL|FR|FC|LFE|BL|BR|SL|SR"
output.wav
@end example
@end itemize
@section highpass
Apply a high-pass filter with 3dB point frequency.
......
......@@ -92,6 +92,7 @@ OBJS-$(CONFIG_EXTRASTEREO_FILTER) += af_extrastereo.o
OBJS-$(CONFIG_FIREQUALIZER_FILTER) += af_firequalizer.o
OBJS-$(CONFIG_FLANGER_FILTER) += af_flanger.o generate_wave_table.o
OBJS-$(CONFIG_HDCD_FILTER) += af_hdcd.o
OBJS-$(CONFIG_HEADPHONE_FILTER) += af_headphone.o
OBJS-$(CONFIG_HIGHPASS_FILTER) += af_biquads.o
OBJS-$(CONFIG_JOIN_FILTER) += af_join.o
OBJS-$(CONFIG_LADSPA_FILTER) += af_ladspa.o
......
This diff is collapsed.
......@@ -105,6 +105,7 @@ static void register_all(void)
REGISTER_FILTER(FIREQUALIZER, firequalizer, af);
REGISTER_FILTER(FLANGER, flanger, af);
REGISTER_FILTER(HDCD, hdcd, af);
REGISTER_FILTER(HEADPHONE, headphone, af);
REGISTER_FILTER(HIGHPASS, highpass, af);
REGISTER_FILTER(JOIN, join, af);
REGISTER_FILTER(LADSPA, ladspa, af);
......
......@@ -30,7 +30,7 @@
#include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 6
#define LIBAVFILTER_VERSION_MINOR 91
#define LIBAVFILTER_VERSION_MINOR 92
#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