1

I have a recorded video file where the sounds goes smoothly from "normally loud" to "whisper like" volume. It's doing so on an almost sinus-like basis, so you have 2 seconds with normal volume, then volume fades out for 2-3 seconds, stays low for a second, are smoothly goes loud again. So it doesn't have sound peaks/cracks, but it's very annoying because it feels like the microphone was recording on a carousel...

I've seen that ffmpeg has some audio filtering, and I've ended up with ffmpeg -i "input.avi" -filter:a loudnorm "output.mp3" but it seems to still be like a "wavy" loud and whisper sound.

I've tried playing around with the options, like ffmpeg -i "input.avi" -filter:a loudnorm=I=-24:LRA=2.0:TP=-0.0 "output.mp3" but same.

Can you help me "equalizing" (leveling? normalizing? I'm not sure about the right word) the volume in this video?

4
  • 1
    Is it your goal to share that movie, or do you just want to do this so you can watch the video better? If it is the latter, I would strongly suggest using VLC Media Player to watch the movie, so you can enable its normalization function and sort the problem that way.
    – LPChip
    Aug 29 '19 at 21:19
  • @LPChip VLC is the way I went a while ago, because no, I don't plan on sharing it (private record), but it's a bit tedious to have to go in VLC settings everytime I want to watch it (and for long-term purpose, I would rather avoid needing software-specific settings to read it properly: I don't have VLC on TV)
    – Xenos
    Aug 30 '19 at 7:45
  • 2
    Try the dynaudnorm filter.
    – Gyan
    Aug 30 '19 at 16:09
  • @Gyan - Nice find - that looks like an 'auto gain' as mentioned in my answer.
    – Tetsujin
    Aug 31 '19 at 7:19
3

I don't know ffmpeg so this is not a full answer, but "where to go for the answer"

The function you are looking for is not Normalisation.
What you need are Expansion, Compression & Limiting, or a more comprehensive auto-gain or envelope follower.

Many people get confused by that one. Normalisation is done by lifting all the sound track as one unit to a new maximum peak. It doesn't affect any individual parts of that sound. You use it, if at all, after all other processing. It is not a dynamic effect, but a static one. It's simply like an overall volume knob, nothing else.

Expansion lifts the volume when it falls below a set threshold.
Compression lowers the volume when it gets above a set threshold. It has a curve to set how hard it does this.
Limiting is like very hard compression, which 'brick walls' any sounds from going above a set threshold.
These all act on every tiny part of the sound [adjustable] so used to extremes can seriously affect the end result, making some unwanted background noises too prominent.

Another option would be an Envelope Follower, or an auto-gain, which would attempt to do this without compression, by automatically 'chasing' the volume to keep it level, like a much better version of the old cassette recorder auto record level, or Windows' auto mic gain.

You may have to employ some or all of the above if the volume changes are dramatic.

All of these processors are available for high-end DAWs [Digital Audio Workstations] & some may be available as freeware, though I don't know any specific sources. Audacity is a commonly-used freeware audio editor, which has a selection of plugins which may be suitable.

As mentioned in comments, VLC has a built-in compressor which may go some way towards correcting this, & also a normaliser you could use as make-up gain afterwards.
I think for anything else, look to see if ffmpeg can do any of those processes, or lift out the audio & transfer it to a dedicated audio package.

1
  • 1
    Thanks, I ended up extracting the audio using ffmpeg -i video.avi audio.mp3 then opened the audio in Audacity, used the Compressor (and Amplifier), saved the result in ogg, and then merged this new audio with the original video using superuser.com/a/277667/368967 Result is not perfect, but I no longer feel like watching it on a carousel :)
    – Xenos
    Aug 30 '19 at 22:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.