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 9th July 2009, 00:56   #1  |  Link
OvejaNegra
ekTOMBE STUDIOS
 
OvejaNegra's Avatar
 
Join Date: Dec 2005
Location: Cuba
Posts: 253
converting ac3 5.1 to normal stereo file

Today i was trying some different methods for converting 5.1 ac3 to STEREO wav. BeSweet creates 16 bits stereo wav, but eac3to creates 24 bits stereo wav.
wich one is correct?
BeSweet gives me a lot of options to control the downmix, or simply use the BSI information to create a "correct" stereo mix.
eac3to uses BSI information or simply mix the channels at the same level?

the eac3to help says: -down2: downmix multi channel audio to stereo (Dolby Pro Logic II)
i don't want a DPLII mix, i want a simple stereo mix. Can that be done with eac3to?


what can i do with eac3to if i want to apply a very high DRC to the audio (for poor listening enviroment)
BeSweet has many options for DRC, but i cant see nothing like that in eac3to.

one extra question: what is exactly dialog normalization?

i'm looking for a tool to make a correct (as intended for the standard) stereo-wav conversion of 5.1 ac3 files.
and for a tool to make a heavy DRC if needed.

thanks, sorry for my english
__________________
So, it works or not???
OvejaNegra is offline   Reply With Quote
Old 9th July 2009, 01:28   #2  |  Link
nurbs
Registered User
 
Join Date: Dec 2005
Posts: 1,457
Lossy codecs don't keep a fixed bitdepht so the 24-bit file eac3to produces is a better representation of the content of the AC3 file than the 16-bit output of besweet. That being said I doubt that you will hear a difference.

DPLII is stereo. It's just mixed in a way so you can reconstruct a 5.1 signal if your decoder supports it. Again I doubt you can hear a difference compared to a standard stereo mix if you listen on stereo speakers, but it should sound better than the standard stereo if you have a 5.1 surround system and a decoder that supports DPLII.

You can read up about dialog normalization on wikipedia. Most codecs don't use it, but it's mandatory in AC3 decoders. Most people here seem to want to get rid of it, which is why eac3to removes it by default. It's only a tag by the way, so it can be losslessly changed in AC3 files. If you search this subforum I'm sure there was a thread where the arguments for and against keeping it were discussed.

I have no idea what BSI is.

I don't really think you can say there is only one correct way since dialognormalization, downmix algorithm and so on depend on what you prefer and what you want to do with the file.
nurbs is offline   Reply With Quote
Old 9th July 2009, 03:20   #3  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,662
@nurbs, I agree with you. Some info:

The bsi (Bit Stream Information) is the part of header with fields like:
bsid
bsmod
acmod
if((acmod & 0x1) && (acmod != 0x1)) /* if 3 front channels */ {cmixlev}
if(acmod & 0x4) /* if a surround channel exists */ {surmixlev}
if(acmod == 0x2) /* if in 2/0 mode */ {dsurmod}
lfeon
dialnorm
...

The fields cmixlev and surmixlev can indicate the coeficients to mix the center and surround channels to obtain a stereo audio.

@OvejaNegra
I never see others values than default in these fields, I think is better ignore them.

The mix (dpl2) used by eac3to is:

L' = 0.5 x L + 0.3535 x C + 0.433 x SL + 0.25 x SR
R' = 0.5 x R + 0.3535 x C - 0.25 x SL - 0.433 x SR

only options -mixlfe (use LFE in mix) -phaseShift(+-90º for SL-SR) can be used.

eac3to is a transcoder, and not a player, for HD audio then the option to apply the DRC or DialNorm isn't considered.

You can safely use BeLight (BeSweet) for your both purposes.

Dialog Normalization:

Was an obsolete attempt to normalize the sound volume to avoid change the volume button in audio equipment. Assume than the normal dialog volume is -31dB, then if the value of this field in BSI is -27dB make a -4dB attenuation to all channels in the stream.

Like only Ac3 uses this value, instead solve a problem make all ac3 streams to low volume compared with TV commercials, CDAudio, mp3 and so on. The best option is put -31dB then decoders don't attenuate the signal.

Sorry also for my english, if you don't understand me, you can use the spanish Doom9 forum
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is online now   Reply With Quote
Old 10th July 2009, 06:23   #4  |  Link
OvejaNegra
ekTOMBE STUDIOS
 
OvejaNegra's Avatar
 
Join Date: Dec 2005
Location: Cuba
Posts: 253
nurbs :well, the 24 bits should not give me higher dynamic range?
of course, i need good speakers and amp.
tebasuna51:
as you say DPLII is only a mix with some magic (the pahse shift is mandatory or not?) but i remember an old DVD (robocop maybe) with two stereo tracks:
DPLII and normal stereo.

The DPLII one sounded a little "weird" (unclear voices) on my DVD player (software) and on the DVD player (hardware) of the owner.

maybe it was a bad mix. maybe something else. that was 6 years ago.

my point with dialog normalization during decoding was:
1: does it helps to make the dialog of differents ac3 files sound at the same level?
2: that and the BSI information does help to create a stereo mix as it should be (is not just mix all the channels togeter).

you say that you never see other values than the default ones. you are talking about american DVDs? European DVDs? why create those fields (BSI and dialog norm) if anybody is using them?

thanks
waiting for your comments.

tebasuna51: te entiendo perfectamente. crei que el foro en español de doom9 era solo una version traducida de este. me equivoco?
__________________
So, it works or not???
OvejaNegra is offline   Reply With Quote
Old 10th July 2009, 09:57   #5  |  Link
nurbs
Registered User
 
Join Date: Dec 2005
Posts: 1,457
As I said on paper the 24bit files are definitly better, but the difference will not be audible in most cases. For a discussion of 16-bit vs. 24-bit you can take a look on this thread at Hydrogenaudio.
My point in my first post was that while the 24-bit file is preferable you shouldn't dismiss a tool just because it will decode the file only to 16-bit.

About Dialog Normalization:
Yes, it helps to get the dialog of different files to the same average level (not exactly the same!) if the value is set correctly, but that is different from the level the master of the file had. If you want to reencode the file I would remove the Dialog Normalization information so that the data you encode from is as close to the original as possible. Note that AC3 and E-AC3 tracks are the only ones which have dialog normalization by default. If you have multiple versions of the same track (e.g. blu-ray: an ac3 track and one lossless version) only the ac3 track will have the normalization. The lossless track will be exactly like the master and no normalization is applied.
Then there is the fact that, as tebasuna51 said, the dialog normalization is often left at the default value by the studios which makes it useless anyway.

About Stereo:
All my stereo tracks that originally came from 5.1 files are downmixed with DPLII and I haven't noticed a problem yet. In fact that method has become the default in many applications.
I like eac3to to do that, because it defaults to high quality. For instance when you downmix to stereo the volume of a track is increased and eac3to will automatically detect clipping in the output and correct it with a second pass. By the way, the higher volume after the downmix may be a reason to normalize the audio before encoding (has nothing to do with dialog normalization of course).
nurbs is offline   Reply With Quote
Old 10th July 2009, 13:28   #6  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,662
Quote:
Originally Posted by OvejaNegra View Post
as you say DPLII is only a mix with some magic (the pahse shift is mandatory or not?)
Is mandatory when SL-SR channels was obtained from FL-FR, but SL-SR channels must be already shifted in ac3 streams and apply a new shift destroy the initial.

Quote:
The DPLII one sounded a little "weird" (unclear voices) on my DVD player (software) and on the DVD player (hardware) of the owner.
These are standard normalized mixes to stereo, dpl and dpl II:
Code:
# 5.1 Channels L,R,C,LFE,SL,SR -> Stereo
L' = 0.3694 x L + 0.2612 x C + 0.3694 x SL
R' = 0.3694 x R + 0.2612 x C + 0.3694 x SR

# 5.1 Channels L,R,C,LFE,SL,SR -> dpl simple
L' = 0.3205 x L + 0.2265 x C + 0.2265 x SL + 0.2265 x SR
R' = 0.3205 x R + 0.2265 x C - 0.2265 x SL - 0.2265 x SR

# 5.1 Channels L,R,C,LFE,SL,SR -> dpl II
L' = 0.3254 x L + 0.2301 x C + 0.2818 x SL + 0.1627 x SR
R' = 0.3254 x R + 0.2301 x C - 0.1627 x SL - 0.2818 x SR
Like you can see the Center channel (voices) is mixed always balanced in front channels, only SL-SR mixes are different.

If you want select between this 3 mixes and preserve the 32 bit output from the ac3 decoder you can use BeHappy.
You can select also 24 bit output.
You can make a .avs file and specify your desired mix.
Don't forget use always a Normalize() after downmix.

Quote:
you say that you never see other values than the default ones. you are talking about american DVDs? European DVDs? why create those fields (BSI and dialog norm) if anybody is using them?
The ac3 is a old format and have many things obsolete, if you transcode between formats you can't convert mixlevels, dialnorm or DRC to new/standard formats like AAC or MP3, then anybody is using them now.
DRC is a help for old amplifiers, now modern receivers can apply 'night mode' on the fly without the DRC info in the stream. Also Ac3Filter can make drc without the info in the stream.

eac3to encode to ac3 with dialnorm=-31 and drc=none, then the output is equivalent to encode to aac.

Quote:
tebasuna51: te entiendo perfectamente. crei que el foro en español de doom9 era solo una version traducida de este. me equivoco?
Es un foro independiente.
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is online now   Reply With Quote
Old 13th July 2009, 15:42   #7  |  Link
OvejaNegra
ekTOMBE STUDIOS
 
OvejaNegra's Avatar
 
Join Date: Dec 2005
Location: Cuba
Posts: 253
Thanks!!

Perfect!
Everything clear as crystal!!

Thanks!!
__________________
So, it works or not???
OvejaNegra is offline   Reply With Quote
Old 13th July 2009, 15:55   #8  |  Link
Nikos
Registered User
 
Join Date: Jun 2002
Location: Greece
Posts: 236
Quote:
Originally Posted by tebasuna51
-phaseShift(+-90º for SL-SR) can be used.
tebasuna what's the meaning of phaseShift?

In plain stereo we need phaseShift?

Thanks
__________________
Greece PAL User...
Nikos is offline   Reply With Quote
Old 13th July 2009, 17:41   #9  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,662
@Nikos
If SL-SR are independent from FL-FR you never need a PhaseShift, but some artificial methods to obtain surround channels, from front channels, can destroy info when make an arithmetic sum.

To know more about phaseShift in mixes you can see http://forum.doom9.org/showthread.php?t=112122
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is online now   Reply With Quote
Old 13th July 2009, 19:02   #10  |  Link
Nikos
Registered User
 
Join Date: Jun 2002
Location: Greece
Posts: 236
@tebasuna thanks for explain and the useful link.
__________________
Greece PAL User...
Nikos is offline   Reply With Quote
Old 16th January 2013, 15:34   #11  |  Link
robertcollier4
Registered User
 
Join Date: Nov 2012
Posts: 30
Old thread, but so it is available for re-use - here is a batch file I have created to downmix the audio from all mkv's in current directory to 2.0 stereo via eac3to Dolby Pro Logic II conversion. Then it will recompress the downmixed audio via Quicktime AAC TrueVBR. Then it will remux the source video and the 2.0 AAC audio into a new MKV.

You will need to specify the paths to eac3to, mkvmerge (from MKVToolNix), and qaac.exe.

[HTML]@echo off
set PATH_EAC3TO=D:\VideoProcessing\eac3to327
set PATH_MKVMERGE=D:\VideoProcessing\mkvtoolnix-unicode-5.9.0
set PATH_QAAC=D:\VideoProcessing\qaac

for /f %%a IN ('dir /b *.mkv') do (
echo ---------------------- BATCH STARTING %%~na%%~xa
%PATH_EAC3TO%\eac3to.exe "%%~na%%~xa" -log="%%~na.eac3to.log" 2: stdout.wav -downDpl | %PATH_QAAC%\qaac.exe --tvbr 90 --quality 2 --rate keep --ignorelength --no-delay - -o "%%~na.m4a"
%PATH_MKVMERGE%\mkvmerge.exe -o "%%~na-stereoremux.mkv" --compression -1:none -A -S "%%~na%%~xa" --language 0:eng --compression 0:none -a 0 "%%~na.m4a" -D -A -M -B -T --no-chapters --no-global-tags "%%~na%%~xa"
)
[/HTML]

Last edited by robertcollier4; 17th January 2013 at 10:06.
robertcollier4 is offline   Reply With Quote
Reply

Tags
ac3, besweet, convert, eac3to

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 13:47.


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