HydrogenAudio

Digital Audio/Video => Movie/Multichannel audio => Topic started by: synclagz on 2022-06-06 08:19:09

Title: How to reduce dynamic range in movie audio?
Post by: synclagz on 2022-06-06 08:19:09
Hi,

I'm going to rip my blu-ray movie collection soon and I want to convert movie audio from DTS to AAC or AC3 and reduce dynamic range because i find annoying to consantly increaseing volume to hear the dialogue (which is often very quiet) and than decrease the volume for action scenes which are usually very loud. This is especially annoying at night. :D

So, what I want to do is to convert audio and reduce dynamic range to increse volume in quiet parts of the movie (dialogue) while retaining same or slightly reduced volume in action scenes.

Which is the best way to do this?

Title: Re: How to reduce dynamic range in movie audio?
Post by: Dracaena on 2022-06-06 20:40:24
You could try running them through the EBU R128 Normalizer (https://www.foobar2000.org/components/view/foo_r128norm) foobar plugin.

Haven't tried that on movies, though I have used the plugin before with badly recorded podcasts with inconsistent volume.
Title: Re: How to reduce dynamic range in movie audio?
Post by: Apesbrain on 2022-06-06 21:24:47
I've not tried it, but not surprised to find there is a component:
https://www.foobar2000.org/components/view/foo_dsp_sqrcomp
Title: Re: How to reduce dynamic range in movie audio?
Post by: smok3 on 2022-06-06 21:52:15
Isn't there a mandatory Dolby digital track as well? Shouldn't that have DRC indices in the stream?

Mpv AC3 playback with DRC (https://mpv.io/manual/master/#audio-filters:~:text=demuxer%3Dhelp.-,%2D%2Dad%2Dlavc%2Dac3drc,-%3D%3Clevel%3E). Additionally mpv also has a pretty neat (imho) loudnorm (https://github.com/mpv-player/mpv/issues/8418) filter.
Title: Re: How to reduce dynamic range in movie audio?
Post by: Aleron Ives on 2022-06-07 05:56:19
AC3, DTS, and LPCM are all mandatory codecs. Since Dolby TrueHD and DTS-HD MA contain AC3 and DTS core tracks, respectively, you could have Blu-rays that have only a DTS-HD MA track, and thus there are no available AC3 tracks for you to use to get DRC.

I don't think AC3 is technically required to have DRC, either. Since Blu-ray is supposed to be somewhat faithful to the cinematic experience, it's conceivable that a 640 kbps AC3 track would have full dynamic range with no DRC flagging.
Title: Re: How to reduce dynamic range in movie audio?
Post by: synclagz on 2022-06-07 10:19:53
@Dracaena

As I understand, EBU128 Normalizer works similar to Replay Gain so I doubt that it could do DRC, but I'll try it. ;)

@Apesbrain

Your solution is much closer to what I need. I will test it to see how it works. ;)

@smok3

I don't know about that. If there is a DRC flag in AC3 stream, sound is still very quiet in general and DRC setting is very conservative.  But I'll look into it anyway...

@Aleron Ives

Thanks for clarification.
Title: Re: How to reduce dynamic range in movie audio?
Post by: Dracaena on 2022-06-07 11:03:16
As I understand, EBU128 Normalizer works similar to Replay Gain so I doubt that it could do DRC, but I'll try it. ;)
Replaygain applies to an entire track/album at a time. That plugin continually adjusts the volume on a moment to moment basis.
Title: Re: How to reduce dynamic range in movie audio?
Post by: Dracaena on 2022-06-07 10:58:09
As I understand, EBU128 Normalizer works similar to Replay Gain so I doubt that it could do DRC, but I'll try it. ;)
Replaygain applies to an entire track/album at a time. That plugin continually adjusts the volume on a moment to moment basis.
Title: Re: How to reduce dynamic range in movie audio?
Post by: Dracaena on 2022-06-07 10:56:40
@Dracaena

As I understand, EBU128 Normalizer works similar to Replay Gain so I doubt that it could do DRC, but I'll try it. ;)
Replaygain applies to an entire track/album at a time. That plugin continually adjusts the volume on a moment to moment basis.


edit: weird, I was getting gateway timeout errors - and these three posts are in reverse time order
Title: Re: How to reduce dynamic range in movie audio?
Post by: Aleron Ives on 2022-06-07 21:40:12
You found a glitch in the (Dolby Pro Logic?) matrix. :P

If there is a DRC flag in AC3 stream, sound is still very quiet in general and DRC setting is very conservative.
You can normalise the audio after compressing it to bring the overall volume up, if necessary. You can check whether DRC is working by decoding an AC3 stream with ffmpeg using both -drc_scale 0 and -drc_scale 1 switches. Compare the waveforms in Audacity, and if they look the same, the AC3 stream has no DRC flagging.
Title: Re: How to reduce dynamic range in movie audio?
Post by: celona on 2022-06-07 23:27:04
Which is the best way to do this?

Try this: https://auphonic.com/

Each month you have 2 free hours for evaluate the online service. If fits your needs you can buy the desktop software.
Title: Re: How to reduce dynamic range in movie audio?
Post by: sundance on 2022-06-08 10:11:11
@synclagz:
Maybe "Dynamic Audio Normalizer" by LordMulder is what you are looking for.
Find it here (https://muldersoft.com/#dyauno). Excellent documentation here (http://muldersoft.com/docs/dyauno_readme.html)
It is also included in ffmpeg. Caveat: 2 channels only, afaik. But I didn't test it with multichannel tracks.
I use this software a lot to create "nightmode", stereo downmixes for mulitchannel AC3/DTS audio tracks.
Title: Re: How to reduce dynamic range in movie audio?
Post by: synclagz on 2022-06-10 08:14:20
@Aleron Ives

Yes, normalization is the solution but I was looking for something quicker (a lot of this audio editing is time consuming)

@celona

This is some sort of professional stuff (kind of). I'll look into it. Thanks.

@sundance

I'm familiar with -dynaudnorm in ffmpeg but it gives me inconsistent results. Maybe some internal tweaking is required.
Title: Re: How to reduce dynamic range in movie audio?
Post by: jaybeee on 2022-06-10 09:30:47
you could use qaac (https://github.com/nu774/qaac/wiki/Command-Line-Options) with the --normalize or --drc options. It would re-encode the aac audio file.

to note: I've not tried these options myself, but know they exist.

maybe @nu774  can offer advice wrt qaac in this scenario?
Title: Re: How to reduce dynamic range in movie audio?
Post by: Aleron Ives on 2022-06-10 09:38:36
The --normalize switch in qaac is a simple peak normalisation that amplifies the audio to full scale. It doesn't affect dynamic range. The --drc switch will work, but as with the ffmpeg and sox switches, it probably takes a lot of trial and error to get good results.
Title: Re: How to reduce dynamic range in movie audio?
Post by: nu774 on 2022-06-10 11:50:59
qaac's --drc is usable, but yes, you will need try and errors.
For this purpose, you will want relatively long attack time (at least 500ms+, maybe  1000ms+).
As with ordinary dynamic range compressor, short attack time makes the signal more thick/compressed/unnatural.

One thing you should know is that these thing is not perfect at all.
Consider a typical dialogue scene with audible background ambience (sound of car/train/restaurant, for example).  You, as a human, can easily distinguish dialogue and ambience, and you know that level of background ambience is rather stable.
However, compressor is not that smart. If you run compressor on it, compressor will happily make it louder only when nobody is speaking, and this makes level of ambience unstable. You will easily notice it, and maybe get uncomfortable with it.
In an ideal world you want to touch only dialogue and leave ambience untouched, but you can't do that when they are already mixed.
Title: Re: How to reduce dynamic range in movie audio?
Post by: forestasia on 2022-06-10 23:28:27
Are you listening on a stereo setup? Or 5.1?

If it's a stereo listening setup, the problem is usually because of incorrect downmixing from 5.1 to stereo. In this case, normalization / drc isn't the best answer.
Title: Re: How to reduce dynamic range in movie audio?
Post by: synclagz on 2022-06-12 21:06:40
@nu774
Well, yes... DRC is not perfect but unstable ambiance is way less annoying for me than quiet/loud transitions.

From my limited testing so far, it seems that fb2k drc component is more-less quite good. Also Audacity compressor filter but fb2k approach is much faster.

@forestasia
I'm using stereo setup for movies with drc and I always copy  original audio as second stream.
Title: Re: How to reduce dynamic range in movie audio?
Post by: knutinh on 2022-06-15 10:52:30
As multitrack audio typically limits dialoge to the center channel, it seems to make sense to alter the mix/balance of center to the rest, or to analyze the center channel and boost (relatively) only speech found in that channel.

https://dolby.io/blog/dialog-enhancement-on-large-audiences/
Title: Re: How to reduce dynamic range in movie audio?
Post by: Mark7 on 2022-10-18 12:56:52
Lately i have been doing the same with movie audio tracks. I tried to make voice clear while keeping other sounds as well.

I've used foobar to do this:
1. Convert the track to stereo. Using the foo_channel_mixer component. Reduce the front and surround channels to 0.77. Reduce sub to 0.
Also added an EQ to lower frequencies below 80hz.
2. Add replaygain info to use in next step
3. Convert using trackgain and Sqrsoft compressor/limiter component (default setting)

It sounds very good to me. The voice is clear and the compressor volume changes are not obvious/annoying. I used the eq because movie tracks still have a lot of bass even without the sub channel, which would push the voice back otherwise.

Unfortunately the channel mixer component does not support more than 5.1 channels though.
So i need to find another way for those tracks.