2

https://trac.ffmpeg.org/wiki/AudioVolume#LoudnessNormalization

However, it is recommended to run the normalization with two passes, extracting the measured values from the first run, then using the values in a second run with linear normalization enabled.

ffmpeg -i UvL8OsG75f0.opus -filter:a loudnorm -pass 1 -f null /dev/null
ffmpeg -i UvL8OsG75f0.opus -filter:a loudnorm -pass 2 tmp.opus

The first command generated no "ffmpeg2pass-..." logs at all.

How to normalize the volume in a two-pass approach properly?

1 Answer 1

3

The -pass option is only valid for some video encoders.

You have to manually run the filter with the target options set, print its output statistics to the command line, then use these output statistics for the second run (the measured_ paramters).

To automate this process, there is a Ruby script that does this in one go, or you can use ffmpeg-normalize, which does everything and can additionally handle batch-processing as well as video-passthrough and other options (disclaimer: I am the author of that tool).

For example, to normalize an Opus file:

ffmpeg-normalize input.opus -c:a libopus -o output.opus

(You may want to specify the bitrate and other codec options.)

1
  • I checked your ffmpeg-normalize but didn't read the readme.md carefully. Thanks.
    – user744579
    Commented Aug 27, 2020 at 7:37

You must log in to answer this question.