View Full Version : 5.1 -> 2 channel AC3 without quality loss
SuperTramp
19th February 2009, 03:11
How does one go about converting 5.1 AC3 DVD standard to 2 channel AC3, and does it have to be re-encoded proper causing quality loss.
Thanks.
kypec
19th February 2009, 06:51
I would try the following approach:
1. Extract original 5.1 AC3 and downmix to 2.0 stereo WAV (Dolby Pro Logic II technique) with use of eac3to (http://forum.doom9.org/showthread.php?t=125966) tool.
2. Encode WAV to AC3 with nice GUI+Aften (http://code.google.com/p/wavtoac3encoder/).
There is probably even more straightforward way which needs not intermediate WAV file but I'm not aware of it ATM.
Snowknight26
19th February 2009, 07:00
eac3to can encode to AC3.
But no, there is no way to go from 5.1 -> 2 channels without quality loss, especially when reencoding.
SuperTramp
20th February 2009, 05:17
So there's no way to convert 5.1 -> 2ch without recompressing?
RunningSkittle
20th February 2009, 05:28
A better term is remixing (downmix)... with 5.1 the FR and FL channels do not correlate with R and L channels of 2 channel files.
AlanHK
20th February 2009, 07:48
I've been trying to do this in Avisynth.
I got good results demuxing the audio to AC3, then using:
AVISource("what.avi",false)
A = NicAC3Source("what.ac3", channels=2)
AudioDub(last, A)
But I was hoping I could do it without having to demux. I then tried:
AVISource("what.avi")
stereo = GetChannel(last, 1,3)
AudioDub(last, stereo)
This worked, but was much less satisfactory. I realised that NicAudio must be using the centre channel, as well as left and right, at least. But I can't find a description in the sparse NicAudio readme as to just how it does its downmix.
Does anyone know the ratios it uses so I can mimic it with GetChannel?
PS: found this thread: 133884 which seems to cover this.
tebasuna51
20th February 2009, 12:03
...
But I can't find a description in the sparse NicAudio readme as to just how it does its downmix.
Does anyone know the ratios it uses so I can mimic it with GetChannel?.
In this post (http://forum.doom9.org/showthread.php?p=1243880#post1243880) there are several methods to downmix with AviSynth.
The downmix included in NicAc3Source is the simple Dolby ProLogic (the function Dmix6Dpl in the script).
After a downmix always is recommended a Normalize().
carlmart
20th February 2009, 13:20
Which is the more transparent, less lossy way to increase levels in an AC3 5.1 file?
Is there some way to check that with some kind of meters?
tebasuna51
20th February 2009, 14:24
Which is the best, more transparent, less lossy way to increase levels in an AC3 5.1 file?
- Lossless way: set Dialog Normalization to -31dB (eac3to can do this)
- Lossy, need recompress: normalize with AviSynth or eac3to.
- Lossy, need recompress and less Dynamic Range: decode with Dynamic Range Compression (Ac3Filter,...), normalize and recompress.
[/QUOTE]Is there some way to check that with some kind of meters?[/QUOTE]
With AviSynth-SoundOut() or decode and use an audio editor: Audacity, ...
Snowknight26
21st February 2009, 03:25
I think you mixed your terms up tebasuna. Lossy != lossless.
AlanHK
21st February 2009, 08:31
In this post (http://forum.doom9.org/showthread.php?p=1243880#post1243880) there are several methods to downmix with AviSynth.
The downmix included in NicAc3Source is the simple Dolby ProLogic (the function Dmix6Dpl in the script).
Thanks.
In those 6-channel functions you don't specify the channel order you assume (the other functions have a channel order comment.)
I guess L,R,C... as for wave. But AC3 is L,C,R..., NicAudio presumably uses L,C,R.
Can you confirm?
So I tried:
# 6 channel AC3: fl,fc,fr,rl,rr,lf
# Downmix to stereo, Dolby ProLogic method
function Dmix6DplAC3(clip a)
{
flr = GetChannel(a, 1, 3)
fcc = GetChannel(a, 2, 2)
lrc = MixAudio(flr, fcc, 0.3205, 0.2265)
bl = GetChannel(a, 4)
br = GetChannel(a, 5)
sl = MixAudio(bl, br, 0.2265, 0.2265)
sr = MixAudio(bl, br, -0.2265, -0.2265)
blr = MergeChannels(sl, sr)
return MixAudio(lrc, blr, 1.0, 1.0)
}
Does that make sense?
(I'm just a stereo guy, have no experience with or hardware for these extra channels.)
I don't suppose there is a simple way to script so that it will work with either input?
After a downmix always is recommended a Normalize().
I find the standard Normalize not very useful. If it's an action movie a few gunshots and explosions and "Normalize" pushes the whole volume down much too low.
I like ReplayGain myself. Too bad there isn't a plugin for that.
tebasuna51
21st February 2009, 09:48
Thanks.
In those 6-channel functions you don't specify the channel order you assume (the other functions have a channel order comment.)
Inside AviSynth the channel order must be always the same than standard uncompressed PCM audio: FL,FR,FC,LF,BL,BR,...
I guess L,R,C... as for wave. But AC3 is L,C,R..., NicAudio presumably uses L,C,R.
Can you confirm?
I can confirm you (I make the last NicAudio versions), NicAudio supply the standard channel order from always.
Forget the internal channel order in compressed formats, a decoder must supply the uncompressed data in appropriate order.
Does that make sense?
Nope, your channel order is wrong.
I don't suppose there is a simple way to script so that it will work with either input?
Sorry, I don't understand your question.
I find the standard Normalize not very useful. If it's an action movie a few gunshots and explosions and "Normalize" pushes the whole volume down much too low.
Normalize can amplify or do nothing but never can attenuate. With Normalize you preserve the full dynamic range intended to be played in good audio equipment.
I like ReplayGain myself. Too bad there isn't a plugin for that.
You can make something equivalent with Sox plugin.
But you losse quality (full dynamic range) when use ReplayGain or similar.
AlanHK
21st February 2009, 10:43
Inside AviSynth the channel order must be always the same than standard uncompressed PCM audio: FL,FR,FC,LF,BL,BR,...
I can confirm you (I make the last NicAudio versions), NicAudio supply the standard channel order from always.
Forget the internal channel order in compressed formats, a decoder must supply the uncompressed data in appropriate order.
Nope, your channel order is wrong.
The reason I looked into this was that using the original Dmix6Dpl function, I found I had dialogue very strongly skewed to one side, the other just background noise.
After I changed the channel input from L,R,C to L,C,R as noted, people on the left could be heard on the left.
Could well be an encoding error.
So I won't automatically use the same mapping in every case, I'll have to check them out first.
Sorry, I don't understand your question.
I meant detecting the channel order and compensating -- but from what you say, this should not be necessary.
Normalize can amplify or do nothing but never can attenuate. With Normalize you preserve the full dynamic range intended to be played in good audio equipment.Okay, if Avisynth's does that. I was wary because some normalize functions do seem to mess it up.
You can make something equivalent with Sox plugin.
But you losse quality (full dynamic range) when use ReplayGain or similar.
I just export the audio, run ReplayGain, get its recommended adjustment, and put that back in my AVS script in AmplifydB. Probably not ideal, but seems to work.
(I've just found SoundOut can give that to me, so I'm trying that now.)
narshorn
17th March 2009, 21:18
Try Vobsnoop for AC3 extraction ... then Ciler's AC3 tool ... gives you clean .wav stereo downmix maybe ???
Regards,
narshorn
Audionut
17th March 2009, 23:15
I think you mixed your terms up tebasuna. Lossy != lossless.
Lossy compression formats suffer from generation loss: repeatedly compressing and decompressing the file will cause it to progressively lose quality. This is in contrast with lossless data compression.
http://en.wikipedia.org/wiki/Lossy_data_compression
Audionut
17th March 2009, 23:18
A better term is remixing (downmix)
Yes, but the resulting file then needs to be recompressed.
To the OP,
eac3to.exe input.ac3 output.ac3 -down2 -192
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.