[FFmpeg-devel] [PATCH 2/2] lavfi/volume: support volume normalization through metadata.

Robert Krüger krueger at lesspain.de
Wed Feb 27 14:31:48 CET 2013


On Sun, Feb 24, 2013 at 1:00 PM, Nicolas George
<nicolas.george at normalesup.org> wrote:
> Le quartidi 4 ventôse, an CCXXI, Clement Boesch a écrit :
>> ---
>>  libavfilter/af_volume.c          | 39 ++++++++++++++++++++++++++++++++-------
>>  libavfilter/af_volume.h          |  1 +
>>  libavfilter/x86/af_volume_init.c |  2 +-
>>  3 files changed, 34 insertions(+), 8 deletions(-)
>
> IMHO, a more elegant approach would be to use Stefano's proposal for dynamic
> expression re-evaluation. The simplest way of doing that would be to inject
> the relevant metadata variable into the expression variables. A more generic
> solution would be to allow accessing all metadata info directly from the
> expression, but that requires more work.
>
> Also, volume normalization needs to be very slow, otherwise the resulting
> audio will sound very flat. None of the variables injected by ebur128 seems
> to fit that requirement. The best bet seems to be lavfi.r128.M smoothed over
> a period of several seconds.
>
> Also, is someone working on a dynamic range compression filter? For volume
> normalization, it may be a better tool than a simple volume filter.
>

I just happened to look around in the VLC filters yesterday and saw
that they have one (/modules/audio_filter/compressor.c) and it's LGPL.
I don't know how much work it is to adapt from their filter API but
maybe it saves some time compared to starting from scratch.

BTW has anyone ever looked at how well the VLC plugin API would fit
into libavfilter, I mean if it was feasible to write an adapter filter
like for other frameworks?


More information about the ffmpeg-devel mailing list