Log in

View Full Version : HARD drc and normalization


hydra3333
16th March 2010, 11:33
Hi, I'm hard of hearing and need to apply a lot of Dynamic Range Compression and Normalization to sources (of arbitrary audio codec) so as not to kill my family when I turn up the audio and loud music or bangs etc happen...

The batch file below is what I have so far, but there has to be an easier, or more effective, way. Constructive criticism and suggestions are welcomed. For example if there's a cleaner way to do it with new versions of ffmpeg. Output need not always be 2-channel AC3, it could be, say, 2-channel MP2 if that's easier.
@echo off
REM input could be .TS or .AVI etc
SET inp=input.avi
SET outA=input.AC3
SET outW0=input.TEMP0.AC3.WAV
SET outW1=input.TEMP1.AC3.WAV
SET avs=input.TEMP.AC3.AVS
SET normvalue=0.95
REM DRC value from 1.2 to 2.5
SET drcvalue=2.5
SET dialognormvalue=31
SET bitratevalue=224
SET freqvalue=48000
"c:\software\ffmpeg\ffmpeg.exe" -y -i "%inp%" -vn -acodec pcm_f32le -f wav "%outW0%"
@echo SetMemoryMax(128) > "%avs%"
@echo LoadPlugin("C:\SOFTWARE\aften\AudioLimiter.dll") >> "%avs%"
@echo WavSource("%outW0%") >> "%avs%"
@echo ConvertAudioToFloat() >> "%avs%"
@echo SSRC(%freqvalue%) >> "%avs%"
@echo normalize(%normvalue%) >> "%avs%"
@echo # WavGainLimiter - >> "%avs%"
@echo # to increase volume for silent sounds a lot, >> "%avs%"
@echo # to increase volume for middle-volume sounds a little and >> "%avs%"
@echo # to keep hi-volume sounds untouched. >> "%avs%"
@echo # This must help to increase volume for speech/dialog without increasing volume for shoots etc >> "%avs%"
@echo # Higher factor values increases the effect but can produce atrifacts. >> "%avs%"
@echo # Recomended value between 1.0 and 5.0 >> "%avs%"
@echo # This filter requires Normalized Float audio at input. >> "%avs%"
@echo WavGainLimiter(%drcvalue%) >> "%avs%"
"C:\SOFTWARE\aften\wavi.exe" "%avs%" "%outW1%"
"C:\SOFTWARE\aften\aften.exe" -v 1 -dnorm %dialognormvalue% -b %bitratevalue% -readtoeof 1 "%outW1%" "%outA%"
REM An article on Dynamic Range Control and Dialog Normalization, with diagrams ...
REM http://www.hometheaterhifi.com/volume_7_2/feature-article-dialog-normalization-6-2000.html
REM When we speak of how loud sounds are in a Dolby Digital soundtrack,
REM we express the loudest level as "0 dB" and the quietest as "-105 dB".
REM The Dialnorm value expresses the level of dialogue as how much lower
REM it is then the peak (0 dB).
REM So a value of "-31" indicates a point 31 dB below the peak and, incidentally,
REM is the value at which no volume adjustment is performed by your consumer decoder.
REM A Dialnorm value of -27 would indicate to your decoder that the dialogue is
REM at a point 27dB below the peak, or 4dB higher than a program with a Dialnorm value of -31.
REM Your decoder would then turn things down by 4 dB.
REM A Dialnorm value of -25 would call for a 6 dB reduction and so on.
REM The -27 setting "fits" movie soundtracks perfectly in that it yields a very natural level
REM for talking and is likely the most common for movies.
REM For decades this has been the standard level for dialogue in motion picture soundtracks.

hydra3333
16th March 2010, 12:07
Maybe some form of besweet ? http://besweet.notrace.dk/boost.txt (what to download, and how to use it from the commandline ?)