Steve Sheldon
Steve Sheldon

Reputation: 6611

Normalize audio, then reduce the volume in ffmpeg

I have a question relating to ffmpeg. First here is the scenario, I am working on a project where I need to have some audio with a presenter talking and then potentially some background music. I also have the requirement to normalize the audio. I would like to do this without presenting a bunch of options to the user.

For normalization I use something similar to this post:

How to normalize audio with ffmpeg.

In short, I get a volume adjustment which I then apply to ffmpeg like this:

ffmpeg -i <input> -af "volume=xxxdB" <output>

So far so good. Now let's consider the backing track, it doesn't want to be the same volume as the presenters voice, this would be really distracting, so I want to lower that by some percentage. I can also do this with ffmpeg, I could do it like this (example would set volume to 50%):

ffmpeg -i <input> -af "volume=0.5" <output>

Using these two commands back to back, I can get the desired result.

My question has two parts:

  1. Is there a way to do this in one step?
  2. Is there any benefit to doing it in one step?

Thanks for any help!

Upvotes: 1

Views: 7789

Answers (1)

Steve Sheldon
Steve Sheldon

Reputation: 6611

After testing some more, I actually think the answer was pretty straight forward, I just needed to do this.

ffmpeg -i <input> -af "volume=xxxdB,volume=0.5" <output>

Took me a while to realize it, I had to try with a view samples before I felt confident.

Upvotes: 4

Related Questions