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

Clément Bœsch ubitux at gmail.com
Wed Feb 27 14:20:06 CET 2013


On Sun, Feb 24, 2013 at 01:00:03PM +0100, Nicolas George 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.
> 

I'm not sure how the expression eval would really help, but I could make
ebur128 inject the volume adjustment instead of making af volume compute
it.

> 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.
> 

Basically you have:
    M: analysis of the last 400ms
    S: analysis of the last 3s
    I: overall

I and S are fairly decent for "real-time" normalization.

> 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'm not, and don't plan to at the moment.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130227/2b570b7c/attachment.asc>


More information about the ffmpeg-devel mailing list