Increase mean volume of a video/audio file

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?

GetFree

Posted 2015-07-18T11:49:25.500

Reputation: 2 394

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%7C1.3353

– Larssend – 2015-07-18T12:07:56.877

1@Larsend Sorry, not quite. If the peaks are already at 0 dBFS then normalization can't do anything. – Jamie Hanrahan – 2015-07-18T12:29:48.857

@Larssend, I clearly stated that the max volume is at 0dB, which means it's normalized already. – GetFree – 2015-07-18T14:09:51.900

Answers

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

Posted 2015-07-18T11:49:25.500

Reputation: 19 777

1Is any of those programs a command line app? I'd like to automate this task. – GetFree – 2015-07-18T14:03:39.110

Also, do those sound editing programs support .aac files? I'd like to avoid re-encoding to a different format if possible. – GetFree – 2015-07-18T14:06:57.117

2If 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 – 2015-07-18T16:17:13.430

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 – 2015-07-18T22:11:20.943

@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 – 2015-07-18T22:12:12.087