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:
- Created 9 years ago
- Reactions:2
- Comments:27 (10 by maintainers)
Top GitHub Comments
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.
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.