1

I have a video file which most of its sound is too quiet. I analysed it with FFmpeg (ffmpeg -af volumedetect) and it gave me the following stats:

n_samples: 1240911872
mean_volume: -31.9 dB
max_volume: -0.0 dB
histogram_0db: 76
histogram_1db: 319
histogram_2db: 681
histogram_3db: 2580
histogram_4db: 8232
histogram_5db: 18019
histogram_6db: 33747
histogram_7db: 60315
histogram_8db: 100737
histogram_9db: 158403
histogram_10db: 242167
histogram_11db: 361734
histogram_12db: 527198

The max volume is already at 0dB so I can't just increase the volume, otherwise it will distort the loudest parts.

How can I increase the mean volume without clipping the peaks?

I say Reinstate Monica
  • 25,487
  • 19
  • 95
  • 131
GetFree
  • 3,040
  • 10
  • 40
  • 47
  • It's called audio normalization. It's been asked countless number of times. Here's one: http://superuser.com/questions/323119/how-can-i-normalize-audio-using-ffmpeg?s=2|1.3353 – Larssend Jul 18 '15 at 12:07
  • 1
    @Larsend Sorry, not quite. If the peaks are already at 0 dBFS then normalization can't do anything. – Jamie Hanrahan Jul 18 '15 at 12:29
  • @Larssend, I clearly stated that the max volume is at 0dB, which means it's normalized already. – GetFree Jul 18 '15 at 14:09

1 Answers1

1

Yes. What you will need to do is "dynamic range compression", followed by an overall boost of volume level do bring the peaks back up to 0dBFS. Any of a large number of sound editing programs can do this. Audacity (free) simply calls the tool "Compressor" and it does have the gain compensation feature. Here's their help page: http://manual.audacityteam.org/index.php?title=Compressor

Jamie Hanrahan
  • 23,140
  • 6
  • 63
  • 92
  • 1
    Is any of those programs a command line app? I'd like to automate this task. – GetFree Jul 18 '15 at 14:03
  • Also, do those sound editing programs support `.aac` files? I'd like to avoid re-encoding to a different format if possible. – GetFree Jul 18 '15 at 14:06
  • 2
    If you could do it from the command line you'd have to wait for it to finish processing before you could hear the result. Trial & error til it sounded right would be a complete pita. Doing it in Audacity would let you tweak it til it sounds right, then save. Probably much faster in the end. – Tetsujin Jul 18 '15 at 16:17
  • I agree with @Tetsujin .Unless you have a lot of audio files with very similar volume dynamics, you need to adjust the compressor parameters (threshold, ratio, attack and release time) for each one. That means trial-and-error. – Jamie Hanrahan Jul 18 '15 at 22:11
  • @GetFree : Re aac files, Audacity will read them directly - either as-it-comes on the Mac, or after the ffmpeg library is installed; see here: http://manual.audacityteam.org/o/man/tutorial_how_to_import_files_from_itunes.html – Jamie Hanrahan Jul 18 '15 at 22:12