[FFmpeg-devel] [PATCH] avfilter: add hrtfm filter

Lou Logan lou at lrcd.com
Tue Mar 20 08:49:28 EET 2018


On Fri, Mar 16, 2018, at 11:44 AM, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  doc/filters.texi         |  60 ++++++
>  libavfilter/Makefile     |   1 +
>  libavfilter/af_hrtfm.c   | 486
>  +++++++++++++++++++++++++++++++++++++++++++++++>  libavfilter/allfilters.c |   1 +
>  4 files changed, 548 insertions(+)
>  create mode 100644 libavfilter/af_hrtfm.c
>
> diff --git a/doc/filters.texi b/doc/filters.texi
> index bd43a7ac6e..c298054325 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -3218,6 +3218,66 @@ Change highpass width.
>  Syntax for the command is : "@var{width}"
>  @end table
> 
> + at section hrtfm
> +
> +Apply simple Head Related Transfer Function Model to audio stream.
> +
> +hrtfm filter creates virtual loudspeakers around the user for
> binaural> +listening via headphones (audio formats up to 9 channels supported).> +
> +This is very simple implementation which does not use any HRIRs.
> +
> +It accepts the following parameters:
> +
> + at table @option
> + at item hradius

You didn’t like the head_radius option name suggestion?

> +Set head radius of listener. In meters. Default value is
> @code{0.0891}.
Why meters instead of cm? 

> + at item sspeed

No sound_speed option name?

> +Set sound speed in meters per second. Default value is @code{334}.
> +Allowed range is from @code{300} to @code{400}.
> +
> + at item amin
> +Set minimum alfa. Default value is @code{0.05}.

s/alfa/alpha

> +Allowed range is from @code{0.01} to @code{1}.
> +
> + at item gain
> +Set output gain in dB. Default value is @code{0}.
> +Allowed range is from @code{-20} to @code{40}.
> +
> + at item rotation
> +Set rotation of virtual loudspeakers in deg. Default is @code{0}.

s/deg/degrees

> +Allowed range is from @code{-360} to @code{360}.
> +
> + at item elevation
> +Set elevation of virtual speakers in deg. Default is @code{0}.

s/deg/degrees

> +Allowed range is from @code{-90} to @code{90}.
> +
> + at item speakers
> +Set custom positions of virtual loudspeakers. Syntax for this
> option is:> +<CH> <AZIM> <ELEV>[|<CH> <AZIM> <ELEV>|...].

Could use some sort of texinfo formatting. 

> +Each virtual loudspeaker is described with short channel name
> following with> +azimuth and elevation in degrees.
> +Each virtual loudspeaker description is separated by '|'.
> +For example to override front left and front right channel
> positions use:> +'speakers=FL 45 15|FR 345 15'.

Same as above. 

> +Descriptions with unrecognised channel names are ignored.
> +
> + at item lfegain
> +Set LFE gain in dB. Default value is @code{0}.
> +Allowed range is from @code{-11} to @code{11}.
> + at end table
> +
> + at subsection Examples
> +
> + at itemize
> + at item
> +Apply filter with custom head radius, speed of sound and
> minimum alpha:> + at example
> +hrtfm=hradius=0.09:sspeed=334:amin=0.01
> + at end example
> + at end itemize
> +

Thanks for the example. No other comments from me. 


More information about the ffmpeg-devel mailing list