Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: DPLII downmix AC3/DTS to stereo AAC (Read 8788 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

DPLII downmix AC3/DTS to stereo AAC

I'm trying to convert 5.1 AC3/DTS/FLAC movie soundtracks to stereo AAC (in order to play them on an Xbox 360).  I'll be outputting to a receiver which does Dolby Prologic II decoding and is hooked up to a 5.1 setup so I'd like to create a DPLII downmix in the AAC file.

This is on Linux, and I'm thinking my best bet is mplayer to do the decoding / downmixing and then neroAacEnc to encode to AAC.  mplayer doesn't seem to have any built in downmxing presets, but it does support a "pan" audio filter which lets you specify how each channel gets mixed.  Am I right in thinking what I need to do to create a DPLII downmix is use the following mix of channels:

# Dolby Pro Logic II Left Right  Center Rear Left Rear Right
# Left Total        1.000 0.000  0.707  -0.8165  -0.5774
# Right Total      0.000 1.000  0.707  0.5774    0.8165

I'm using the following channel mappings for various codecs - are these correct (I've just got them through some Googling
# AAC, DTS:  FC , FL , FR , SL , SR , LFE
# AC3:        FL, FC, FR, SL, SR, LFE
# FLAC:      FL, FR, FC, LFE, SL, SR

I'm trying it using that, and I get audio which sounds garbled in high-volume bits (as if there was clipping).  Does that mean I need to normalize the audio too before passing it to neroAacEnc?

My mplayer command is:
mplayer input.dts -vc null -vo null -ao pcm:fast:file=output.wav -af pan:2:0.707:0.707:1:0:0:1:-0.8165:0.5774:-0.5774:0.8165:0:0

And I'm then using neroAacEnc:
neroAacEnc -ignorelength -lc -q 0.5 -if input.wav -of output.m4a

Am I right in thinking that the AAC file output should sound fine when played on normal stereo speakers, as well as getting some surround effects in a surround setup through a DPLII-compatible receiver?

DPLII downmix AC3/DTS to stereo AAC

Reply #1
I'm currently using something like this:

mkfifo mypipe.ac3
mplayer -vo null -dumpaudio -dumpfile mypipe.ac3 -aid 128 soandso.vob

and a52dec (from the liba52 package) do to the decoding of mypipe.ac3 (24 bit stereo downmix) and neroAacEnc for encoding.

This all works without intermetiate WAV files. The reason I went this way is because mplayer only decodes to 16 bit PCM. I had some trouble though getting a52dec & neroAacEnc to work with 24 bit accuracy.

Anyhow, I think a52dec supported two different stereo downmix modes: "normal" and "pro logic downmix". (I might be wrong and I can't verify it at the moment)

Quote
Am I right in thinking that the AAC file output should sound fine when played on normal stereo speakers, as well as getting some surround effects in a surround setup through a DPLII-compatible receiver?

Usually a pro logic decoder seems to amplify compression artefacts. I don't know whether this problem is still exists (probably depends on the lossy encoder and the format). You might have to increase the quality level. Other than that it should sound fine with or without DPLII decoder.

Cheers,
SG

 

DPLII downmix AC3/DTS to stereo AAC

Reply #2
For DTS you have to apply a 90° phase shift to the rear channels before you downmix them (not so for AC3).