[FFmpeg-user] Encoding Warnings

Moritz Barsnick barsnick at gmx.net
Mon Jun 29 18:18:51 EEST 2020

On Mon, Jun 29, 2020 at 10:44:04 -0400, Jim wrote:
> AFAIK, ffmpeg does not have the ability to analyze the volume of every
> sample throughout an audio file, find the greatest amplitude, calculate
> the adjustment needed to make the loudest part of the file the maximum,

It does.

> and then apply that scaled volume adjustment to the entire file.

This makes this a two-pass operation, which your external tool probably
also does. ffmpeg can analyze first:

$ ffmpeg -i INPUT -map 0:a -af volumedetect -f null -

and will find the absolute maximum of the first audio channel. Take the
max value from the log (something like "max_volume: -18.1 dB"[*]), and
use that value for an additionally inserted "volume" audio filter in
your conversion.

$ ffmpeg -i INPUT [...] -af volume="18.1 dB",otherfilters OUTPUT

You thus only have an additional input analysis step.

[*] Documentation says this will not cause any clipping, though I don't
know what the behaviour is, if the volume is massively different across
channels. I *believe* the maximum is safe to use (while the average is
also an average across channels, by some kind of mixdown).

> same question in my searching for a solution to this same message - this
> is the first time I've read this.

(I personally find this confusing as well.)

> (Assuming I don't run into anything weird when processing different
> video formats in the future of course. ;) )  I'm happy, happy, happy
> about that! :) :) :)

We like happy people. :-)


More information about the ffmpeg-user mailing list