question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Movie and AAC audio gain

See original GitHub issue

(I’ll preface this by noting that I can propose a patch if this is desired)

Some of you may have noticed that DTS -> AC3 and AC3->AAC often have less than ideal dynamic ranges. This is particularly notable when playing back video on an iPad or Mac which aren’t terribly loud in the first place.

There are ways to fix this, but I’m suggested that there is a setting in the configuration file to set these options up automatically.

For example, given an DTS->AC3 conversion, we apply the compand filter:

-filter:a:1 "compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2"

and given a AC3->AAC conversion, we boost the peak volume by a few decibels. My experience is that most of the video files I’m seeing are too quiet by between 8dB and 9dB meaning:

-filter:a:0 "volume=8dB"

would sufficiently normalize the volume. You can be more accurate by actually measuring the volume difference using this:

ffmpeg -i "$1" -af "volumedetect" -f null /dev/null

but this does take longer as it has to pass over the entire file.

So, basically, we’d have a dts-to-ac3 setting and a ac3-to-aac option in the configuration file and use this to handle the downconversions. The actual command would be the filter commands I suggested above but could be user modified as needed.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:2
  • Comments:27 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
mdcollins05commented, Jun 6, 2016

Just wanted to show my support for this feature.

I’ve been trying to figure out how to use ffmpeg to normalize audio (with volumedetect and ebur128) and later apply the “dynaudnorm” filter to compress the dynamic range a bit. My experience with ffmpeg is really limited so I’m stumbling through it. If I get it working, I’d make a post processing script.

I’ve been able to get it to normalize a single audio stream but the output is missing any other audio streams and it seems to have used a lower quality bitrate. If this feature were built in, that would be awesome.

1reaction
mdcollins05commented, May 12, 2018

I thought I’d give an update on this. I ended up using ffmpeg-normalize (https://github.com/slhck/ffmpeg-normalize) and wrote a post process script (https://github.com/mdcollins05/ffmpeg-normalize-extras) for sickbeard_mp4_automator. This allowed me to easily process my existing library. My only “issue” with it (and it’s not a big deal at all) is that my post process script seems to happen after the file is moved to it’s final location and not processed while still in nzbget.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make the audio louder in an H264/AAC video
Play Menu -> Audio -> Options -> tick Normalize. Default boost is +1.0 dB which should do the trick or you can boost...
Read more >
using aacgain to modify volume of m4v videos - HydrogenAudio
When I encode DVD movies to mp4/m4v (h264 video and aac audio) using Handbrake, I then change the file extension to .m4a and...
Read more >
Advanced Audio Coding - Wikipedia
Advanced Audio Coding (AAC) is an audio coding standard for lossy digital audio compression. ... offering music videos and movies, which also use...
Read more >
Volume Changer - Increase or decrease loudness online
Increase and decrease the volume of audio files · Any File Format · Unlimited Size · Safe and secure · Safe and Secure...
Read more >
How to Increase the Audio Volume of a Video File
On the left hand side, under Video Output choose the Copy option. This should already be selected by default. Under Audio Output, choose...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found