Log in

View Full Version : Convert 6 channels to 2


rig99
24th February 2007, 20:22
I have this pesky little problem with 6 channel ac3. My problem is trying to convert 6 channel ac3 to 2 channel mp2. I thought I had found a way to do it by using something like this
avs2wav -n myfile.avs - | twolame -s 48000 -b 128 - mymp2file.mp2
but that didnt work so I tried using bepipe
that also didnt work so I tried using toolame instead of twolame and replaced "twolame -s 48000 -b 128" with "toolame -s 48 -b 128"
that didnt work either. I read somewhere that twolame/toolame can't handle 6 channel audio. So that got me thinking this combo of stdin with twolame/toolame isnt going to work. I searched for a way to use stdin with besweet but couldnt find anything about it. Is there any way at all to convert 6 channel audio served by avisynth to stereo mp2 without ever using a gui tool?

tebasuna51
24th February 2007, 21:01
Is there any way at all to convert 6 channel audio served by avisynth to stereo mp2 without ever using a gui tool?

You need downmix 6 channel to 2. You can use for instance:
# 1) ac3 decoder with DRC enabled
a = NicAc3Source("G:\input.ac3",DRC=1)

# 2) Downmix dpl II
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3, 3)
lrc = MixAudio(flr, fcc, 0.3254, 0.2301)
bl = GetChannel(a, 5)
br = GetChannel(a, 6)
sl = MixAudio(bl, br, 0.2818, 0.1627)
sr = MixAudio(bl, br, -0.1627, -0.2818)
blr = MergeChannels(sl, sr)
MixAudio(lrc, blr, 1.0, 1.0)

# 3) Upsample if needed
ssrc(48000)

# 4) Normalize
Normalize()

See also my recent post (http://forum.doom9.org/showthread.php?p=957798#post957798).

Edit:
bepipe --script "Import(^myfile.avs^)" | twolame -b 128 - mymp2file.mp2
works fine for me.