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

Jan Ehrhardt phpdev at ehrhardt.nl
Mon Feb 25 02:14:04 CET 2013


Clément Bœsch in gmane.comp.video.ffmpeg.devel (Fri, 22 Feb 2013
00:22:40 +0100):
>+            new_volume = -23 - loudness;
>+            //av_log(0,0,"loudness=%f => %f => volume=%f\n", loudness, new_volume, pow(10, new_volume / 20));
>+            if (loudness > -30)
>+                set_fixed_volume(vol, pow(10, new_volume / 20));

Aha, I found the reason why it did not work on my (worst case) sample
file. The condition 'if (loudness > -30)' prohibited to change the
volume, because the loudness of the input was -41.6 LUFS:

[Parsed_ebur128_2 @ 0000000004183a40] Summary:
  Integrated loudness:
    I:         -41.6 LUFS
    Threshold: -51.7 LUFS

  Loudness range:
    LRA:         6.0 LU
    Threshold: -61.7 LUFS
    LRA low:   -45.0 LUFS
    LRA high:  -39.0 LUFS

After removing the condition the volume was raised by something like 8.5
and produced a file that was right on track with the -23 LUFS as
recommended by EBU r128:

[Parsed_ebur128_4 @ 0000000004183f20] Summary:
  Integrated loudness:
    I:         -23.0 LUFS
    Threshold: -33.1 LUFS

  Loudness range:
    LRA:         6.0 LU
    Threshold: -43.1 LUFS
    LRA low:   -26.4 LUFS
    LRA high:  -20.4 LUFS

There was some noise in the background, so maybe the volume change was a
bit overdone (and should be capped). But it looks promising.

Jan



More information about the ffmpeg-devel mailing list