Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th January 2012, 11:56   #1  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,575
Loudness management

Hello,

I'm wondering how everyone handles loudness management. Everyone knows the problem - watching movies with a big dynamic range without the proper listening environment and speaker system means that you're always fiddling with the volume. Either explosions are too loud or dialogue is too quiet. For simplicity's sake, let's focus on vanilla Dolby Digital (AC3).

Hardware and software based dynamic range compression, "night mode" on my receiver, and all the other solutions I've tried never seem to work right. They either seem totally ineffective, or cause audible distortion. I've tried measuring the proper values to insert as metadata into the AC3 stream, but it doesn't seem to make a difference one way or the other.

In broadcast we would insert a loudness control device into the air chain, but it's a bit different with software on the PC.

How do you guys do it?

Thanks,
Derek

Last edited by Blue_MiSfit; 16th January 2012 at 11:58.
Blue_MiSfit is offline   Reply With Quote
Old 16th January 2012, 12:54   #2  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,001
I use the PC for playback and run a compressor of sorts. I posted the details here in case anyone else wanted to try it.

While obviously the plugin was designed with normalizing music in mind, I find it works very well for video soundtracks.
As I mentioned in my previous post however, I'm mixing down to stereo and I don't know if it'll work for surround sound.

In my screen shot (previous post) I've got the maximum amplification set at 12db. Currently I'm running it at 18db and only rarely can I notice it at work. Very occasionally I hear a little "pumping" but I guess it's the price of using a compressor. It's not an audible turning up and down of the volume as such because the volume changes are too fast, but occasionally background noises might increase in between speech enough to notice it (for example)... that sort of thing.
I guess using any sort of compression will always be a compromise between how much you want to squish the audio and how little you want to reach for the volume control. Most of the time I can watch a movie from start to finish without feeling too guilty about the loud parts and I rarely notice the compression at work.

As I mentioned in my other post too, using ffdshow to drop the volume before the plugin a little (mainly for audio which has been normalized to 0db) seems to let it work better and reduces any audible effects of compression.

If you try it, I'll be interested to hear what you think of it.

Last edited by hello_hello; 16th January 2012 at 13:07.
hello_hello is offline   Reply With Quote
Old 16th January 2012, 16:12   #3  |  Link
nibus
Telewhining
 
Join Date: Mar 2010
Posts: 272
When I encode movies for portable devices I use a combination of Sox's compand filter and the now very old "BoostWave" to compress and maximize movie soundtracks. It works extremely well and basically turns soundtracks into the same loudness level as most TV shows. Pumping is minimal and there is still contrast between very loud segments and dialogue, though not much. Of course you can tweak Sox to apply less compression than I use.

The top wav is after the filters (plus I'll normalize it with eac3to to raise it even more)
http://dl.dropbox.com/u/5637223/Clipboard01.jpg

If you're interested I could post the simple batch script I use for it. But it sounds like you are looking for a realtime plugin so hello's might be a better option.
nibus is offline   Reply With Quote
Old 16th January 2012, 16:29   #4  |  Link
laserfan
Aging Video Hobbyist
 
Join Date: Dec 2004
Location: Off the Map
Posts: 2,458
I just raise the Center channel speaker level by a few dB (in my receiver), and reduce the LRSurrounds a couple dB also. It's most important to hear the dialog clearly, and I've never felt deprived for lack of surround effects.
laserfan is offline   Reply With Quote
Old 16th January 2012, 17:10   #5  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,001
Quote:
Originally Posted by laserfan View Post
It's most important to hear the dialog clearly, and I've never felt deprived for lack of surround effects.
I know that feeling. All having the sound surround me ever does is constantly remind me the picture doesn't.
hello_hello is offline   Reply With Quote
Old 17th January 2012, 04:18   #6  |  Link
7ekno
Registered User
 
Join Date: Jul 2007
Posts: 389
Quote:
Originally Posted by nibus View Post
I use a combination of Sox's compand filter
+1 But the SOX command for compression can require a bit of fiddling, but once you find a config that works in your environment, it rarely needs further tinkering ...

Wow, after viewing those graphs you seem to have really nailed it nibus! Would you mind detailing some of the parameters you use?

7ek

Last edited by 7ekno; 17th January 2012 at 04:22.
7ekno is offline   Reply With Quote
Old 17th January 2012, 07:38   #7  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,001
I only just got a chance to do it but after seeing nibus's graphs I was curious to visually see what the RockSteady plugin does. Using foobar2000 I mixed a demuxed DTS track down to stereo while converting it to MP3, I then ran MP3Gain on it to see how much clipping was introduced by mixing it to stereo (4.5db), then converted the DTS to stereo wave while reducing the volume by 4.5db to prevent clipping. That's the top graph in this pic:
http://i.imgur.com/hipGH.jpg

Next I disabled foobar's DTS decoder to force it to decode via DirectShow (it only works by opening the MKV file directly, not after demuxing it), and disabled all of ffdshow's filters except the mixer and volume. This time it required a 6db reduction to prevent clipping so I guess ffdshow's downmix is done in a slightly different way to the foobar2000 plugin. It's the second graph in the above pic.

Finally I encoded it via DirectShow twice more, this time enabling ffdshow's volume (-6db) and winamp filters (enabling the RockSteady plugin). RockSteady's maximum amplification set to 12db is the first graph in this pic:
http://i.imgur.com/BmW7I.jpg
Maximum amplification set to 18db is the second graph.

As a side note, can someone explain this result to me?
As mentioned above I tested for clipping each time by downmixing the DTS file to MP3 and running MP3Gain on it. The order of ffdshow's filters made no difference with ffdshow downmixing to stereo and the encoded MP3 still showed +6db of clipping according to the MP3Gain analysis. From that I assumed I simply needed to use ffdshow's volume filter to reduce the volume by the appropriate amount to prevent clipping when converting to wave. However unlike when converting to MP3 the output was different depending on the order of the filters. If the mixer filter is before the volume filter and I use the latter to reduce the gain by 6db, then when converting to wave I get an output which has obviously still had it's peaks flattened and then the whole thing has been reduced by 6db. Putting the volume filter before the mixer stops the peaks from being flattened so it's like the mixer is clipping the peaks when it mixes down to stereo.
My question is, why doesn't the same thing happen when I convert to MP3, where the order of the filters makes no difference? Why doesn't ffdshow's mixer also flatten the peaks when converting the output to MP3?
hello_hello is offline   Reply With Quote
Old 17th January 2012, 08:58   #8  |  Link
nibus
Telewhining
 
Join Date: Mar 2010
Posts: 272
Quote:
Originally Posted by 7ekno View Post
+1 But the SOX command for compression can require a bit of fiddling, but once you find a config that works in your environment, it rarely needs further tinkering ...

Wow, after viewing those graphs you seem to have really nailed it nibus! Would you mind detailing some of the parameters you use?

7ek
I use this template:

Code:
sox.exe "%INPUT%" "%INPUT%_%DRC%db.wav" compand 0.3,1 5:-80,-79,-%DRC% -%LIMIT% -90 0.2
Where the variables are defined by the batch file. DRC is the dynamic range, meaning the smaller the number the more compression is applied (everything is squeezed into a certain amount of db) and the limit specifies how much headroom to give sox. The more headroom the less dynamic range, but also you have to be careful with too little headroom because of clipping. I spent a long time tweaking these settings to avoid too much pumping, but it's still there on higher settings.

Here are the ranges that I have set in my script, from light to heavy:

1 - 54db Range / 3db Limit
2 - 50db Range / 4db Limit
3 - 46db Range / 5db Limit
4 - 42db Range / 6db Limit
5 - 38db Range / 7db Limit
6 - 34db Range / 8db Limit

#4 and 5 work good for action movies, and #2 and 3 work good for dramas or comedies (generally).

However, sox is only the first part of the process. After sox I send the output to WaveBooster which boosts it even more.

Here is the whole package if you want to try it out:
http://www.mediafire.com/?lkhrr97p94s4izp

Couple issues: you need to make sure the file you drag into the command window doesn't have any spaces in it's file path. Also, WaveBooster only supports 16bit, 44100hz wavs, so in eac3to you need to specify:

Code:
-down16, -resampleTo44100
nibus is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:20.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.