25

I've got a large amount of .MKV video files which seem to all play at a very low volume - I end up having to turn the TV up all the way to hear them, which is really irritating when I switch to another channel and wake the dead because it's so loud.

What I'm looking for is a command-line method to increase the volume (so I can run it on all of them quickly) that would hopefully work regardless of the audio codec in use in the particular file. (I don't mind hard-coding the output audio though).

For reference, I'm using Ubuntu 9.04 on my server, and the files are being played back with Boxee on a Mac Mini, but the volume problem is the same on Windows too.

kinokijuf
  • 8,175
  • 9
  • 54
  • 97
The How-To Geek
  • 6,042
  • 8
  • 44
  • 47
  • Since normalizing is often increasing the volume, check out this post; I use `ffmpeg-normalize` all the time, and it's easy to download with `pip`; it takes the guesswork out of using ffmpeg manually on the CLI: https://superuser.com/questions/323119/how-can-i-normalize-audio-using-ffmpeg – Life5ign Apr 12 '23 at 05:18

2 Answers2

28

It isn't very well documented, but FFmpeg has a -vol switch which will allow you to increase volume output.

Example:

ffmpeg -i vid.mkv -vol 512 -vcodec copy output.mkv

Some things to take note of:

  • the -vol switch uses "byte percent", so you can't just specify a 200% volume increase, 100% = 256 so specifying 256 would leave the volume as is, 512 would double it and so on.
markostamcar
  • 103
  • 4
John T
  • 163,373
  • 27
  • 341
  • 348
12

The -vol switch is deprecated I've found this method to be useful currently:

ffmpeg -i input.mkv -vcodec copy -filter:a "volume=5.000000" output.louder.mkv

Adjust the number after volume= to suit your needs.

You can also use decibel measures. To increase the volume by 15dB: ffmpeg -i input.mkv -vcodec copy -filter:a "volume=15dB" output.louder.mkv

The -vcodec copy simply copies the video as is and -filter:a tells ffmpeg to filter the audio. Note that -vcodec can be shortened to -c:v

Sources:

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

Testing.

Elder Geek
  • 757
  • 8
  • 15