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 3rd September 2012, 10:02   #1  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,263
sox - compand - dynamic range compression

I wanted to add options to do 'dynamic range compression' in Hybrid using sox. Problem is I got no clue about it and since it can't really be done intuitively (from that I get), I wanted to add let the user choose from some 'general' profiles.

So I googled a bit and found:

speech:
Code:
compand 0.02,0.20 5:-60,-40,-10 -5 -90 0.1
source: http://www.benmcdowell.com/blog/2012/01/29/batch-processing-audio-file-cleanup-with-sox/

voice/music:
Code:
compand 0.1,0.3 -60,-60,-30,-15,-20,-12,-4,-8,-2,-7 -2
source: http://www.dzone.com/snippets/sox-audio-editor-settings
and
source: http://forums.joe.to/viewtopic.php?f=149&t=57817

voice/radio:
Code:
compand 0.01,1 -90,-90,-70,-70,-60,-20,0,0 -5
source: http://icecast.imux.net/viewtopic.php?t=3462

audio books:
Code:
compand 0.3,5 6:-70,-60,-20 -10 -6 0.2
source: http://www.ericphelps.com/batch/samples/MP3_Recode.txt

podcast:
Code:
compand 0.3,1 6:-70,-60,-20 -5 -90
source: https://dissectionbydavid.wordpress.com/2010/10/01/using-sox-via-php-to-cleanup-podcasts/

music:
Code:
compand 0.3,1 -90,-90,-70,-70,-60,-20,0,0 -10 0 0.2
source: https://groups.google.com/forum/?fromgroups=#!topic/de.comp.audio/TfV5SzdHxbk

MediaTomb:
Code:
compand 0.1,0.8 60:-40,-5 -20 -70 .2
Code:
compand .3,.8 -40,-5 -20 -70 .2
source: http://mediatomb.cc/dokuwiki/transcoding:transcoding

music:
Code:
compand 0.3,1 6:-70,-60,-20 -5 -90 0.2
source: http://sox.sourceforge.net/sox.html

music:
Code:
compand 0.3,1 -90,-90,-70,-70,-60,-20,0,0 -5 0 0.2
source: http://kevin.deldycke.com/tag/alac/
source: http://manpages.ubuntu.com/manpages/gutsy/man7/soxexam.7.html

music:
Code:
compand .1,.1 -60,-10 0 0 .1
Code:
compand .01,.3 -6,-4,-3,-3,0,-3
source: http://kevin.deldycke.com/tag/alac/

movie:
Code:
compand 0.0,1 6:-70,-43,-20 -6 -90 0.1
source: http://forum.videohelp.com/threads/340675-Mkv%D0%A2%D0%BEMp4-v0-221a-rapid-tool-for-repack-Mkv-to-Mp4?p=2181966&viewfull=1#post2181966

since my hearing ability is really untrained and audio knowledge are is very limited I wanted to ask if some of you have some suggestions for such profiles,... may be in the style aften offers them (Film Light, Film Standard, Music Light, Music Standard, Speech).

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 3rd September 2012, 15:51   #2  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,192
I can't help you about the best options, but I make a test DRC funtcion for BeHappy with the options Film Light, Film Standard, Music Light, Music Standard, Speech here: http://forum.doom9.org/showthread.php?p=779165#post779165
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is offline   Reply With Quote
Old 3rd September 2012, 19:11   #3  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,263
Thanks a lot! That really helps.

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 11th September 2012, 06:29   #4  |  Link
nibus
Telewhining
 
Join Date: Mar 2010
Posts: 275
A while back I was experimenting with sox to compress audio for some video encodes I was doing for my iPad. I wanted something to basically turn a movie soundtrack into a TV soundtrack, sort of brickwall the sound if you will, so it could be heard in loud environments.

I found that sox's compand feature couldn't apply enough compression, so I use wavebooster (pretty old software by LigH) in addition to sox.

Here's the package if you want to experiment with it:
http://www.mediafire.com/download.php?jgp14x4p9fcz2zj

You just drag the file onto the window. But it can't have spaces in the path, and the wav must be created using the following in eac3to: -simple, -down16, -resampleTo44100

Sox is set to use only one setting that I found worked quite well with movie soundtracks (in addition to the dynamic range that a user inputs). And to be honest, I don't remember all the settings on it.

edit: the lower the range, the more compression is applied.
nibus is offline   Reply With Quote
Old 11th September 2012, 06:38   #5  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,263
seems like it simply applies:
Code:
sox.exe "%INPUT%" "%INPUT%_%DRC%db.wav" compand 0.3,1 5:-80,-79,-%DRC% -%LIMIT% -90 0.2
where the user specifies DRC and Limit,...

as choice the user can use one of the options:
Code:
ECHO.& ECHO.
ECHO      Select amount:
ECHO.
ECHO.
ECHO      0) 54db Range / 5db Limit
ECHO      1) 50db Range / 6db Limit
ECHO      2) 46db Range / 7db Limit
ECHO      3) 42db Range / 8db Limit
ECHO      4) 38db Range / 9db Limit
ECHO      5) 34db Range / 10db Limit
ECHO      6) 30db Range / 11db Limit
ECHO.
ECHO      7) Custom Range
ECHO.
ECHO      8) Light (70db Range / 4db Limit)
ECHO      9) Light (66db Range / 4db Limit)
ECHO.& ECHO.

SET CHOICE=& SET /P CHOICE=Select Option: %=%
IF "%CHOICE%"=="0" SET DRC=54& SET LIMIT=5& GOTO :GO
IF "%CHOICE%"=="1" SET DRC=50& SET LIMIT=6& GOTO :GO
IF "%CHOICE%"=="2" SET DRC=46& SET LIMIT=7& GOTO :GO
IF "%CHOICE%"=="3" SET DRC=42& SET LIMIT=8& GOTO :GO
IF "%CHOICE%"=="4" SET DRC=38& SET LIMIT=9& GOTO :GO
IF "%CHOICE%"=="5" SET DRC=34& SET LIMIT=10& GOTO :GO
IF "%CHOICE%"=="6" SET DRC=30& SET LIMIT=11& GOTO :GO
IF "%CHOICE%"=="8" SET DRC=70& SET LIMIT=4& GOTO :GO
IF "%CHOICE%"=="9" SET DRC=66& SET LIMIT=4& GOTO :GO

IF "%CHOICE%"=="7" GOTO :CUSTOM
IF "%CHOICE%"=="" GOTO :DRC
-> shouldn't be to hard to implement something similar in Hybrid,..

it later applies:
Code:
Data\WaveBooster\BOOSTCLI.EXE /i="%INPUT%_%DRC%db.wav" /o="%INPUT%_%DRC%db_Maxd.wav"  /a=-12 /m=-.5
( [+] /a=Avg_dB /m=Max_dB (2-pass autom. setup, Avg=-12..-3, Max=-3..0))
which seems to do the magic:
Code:
This program was made to allow normalisation and dynamic compression of high
resolution wave files, therefore it might be useful for a variety of purposes,
for example enhancing the quality of decoded, previously compressed audio like
MPEG Layer 3 (per "mad" WinAmp plugin) or Dolby Digital (per Azid 1.7+).
Problem is that this would be a windows only solution, so I' reluctant to add it to Hybrid,...
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 11th September 2012 at 06:45.
Selur is offline   Reply With Quote
Old 4th February 2013, 01:23   #6  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Location: Planet Express, Inc.
Posts: 780
Really great input, guys.
I've got several threads bookmarked and ready to read over.
I've been meaning to experiment and look for solutions when converting my Blu-Ray collection to containers or DVD's.
I find a lot of movies tend to have really quiet dialogue while the action is blaring.
I'm just starting to learn more about using SoX lately and hoping it will produce decent results.

nibus, going to check out your solution.
I'll be having fun trying out all the options I'm finding to try and make a movie watchable without worrying about adjusting the volume.
__________________
Win10 (x64) | GPU Caps Viewer v1.32.0.0
Crucial M500 240GB SSD | Kingston SSDNow V300 (Marvell) 120GB | NVIDIA GeForce GTX 750 Ti | R375.95 (Nov 18, 2016)
NTSC | DVD: R1 | BD: A
Sparktank is offline   Reply With Quote
Old 7th February 2013, 09:54   #7  |  Link
PeterTheMaster
Registered User
 
Join Date: Oct 2001
Posts: 186
the wavebooster part speaks about maximizing the audio. is that just regular nomalization? so could i replace it by besweet -norm 0.97?

if wavebooster does drc too i dont unterstand the need for two programs.
PeterTheMaster is offline   Reply With Quote
Old 9th February 2013, 20:03   #8  |  Link
nibus
Telewhining
 
Join Date: Mar 2010
Posts: 275
Quote:
Originally Posted by PeterTheMaster View Post
the wavebooster part speaks about maximizing the audio. is that just regular nomalization? so could i replace it by besweet -norm 0.97?

if wavebooster does drc too i dont unterstand the need for two programs.
Wavebooster does further normalization and adds gain; I found I needed the combination to boost audio for my mobile devices like smartphones and tablets. BeSweet would probably work instead. Only one way to find out.
nibus is offline   Reply With Quote
Old 9th February 2013, 20:21   #9  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,263
they could do that with sox too, but that's not really related to DRC anymore,..
__________________
Hybrid here in the forum, homepage
Selur 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 02:57.


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