Log in

View Full Version : sox FLAC 5.1 to AAC 2.0 DPLII mixer problem


OtonVM
26th December 2011, 21:18
Hello!

I have a problem with mixer values for sox when converting flac files from an audio DVD that are in 5.1 surround sound.

Excerpt from the script:
ffmpeg -i "$a" -vn -acodec pcm_f32le -f wav - |
sox -V3 --guard --show-progress --multi-threaded --ignore-length --bits 32 --rate 48000 --encoding floating-point --channels 6
--type wav - --type wav - remix -m 1v0.2646,3v0.1870,4v0.1870,5v0.2991,6v0.1323 2v0.2646,3v0.1870,4v0.1870,5v-0.1323,6v-0.2291 gain -n |
ffmpeg -v -1 -y -i - -acodec pcm_f32le -f wav "$OUTF_WAV"

I'm using values for mixer, found on a thread here, but in the end I get a stereo (or DPLII) mix that is very much leaning to the left channel. I can clearly hear this and it's obvious in Audition.

So I tried rejiggering the values based on what MediaInfo says are the channel positions: Front: L C R, Back: L R, LFE

The result is this:1v0.2646,2v0.1870,6v0.1870,4v0.2291,5v0.1323 3v0.2646,2v0.1870,6v0.1870,4v-0.1323,5v-0.2291 and I might be REALLY wrong here, I don't know. Here I also get a stereo mix, more centered but still leaning to the left.

What am I doing wrong?

Selur
26th December 2011, 23:19
I use the same downmix in Hybrid and thought it sounded okay. :)
I would:
1. add '-v -10' to the decoding ffmpeg call (not sure if otherwise some unwanted interference ends up in the pipe to sox)
2. remove the '--multi-threaded' in sox (since some Hybrid users had problems with it,..)

Why do you use pcm_f32le and not for example 'pcm_s16le' ?

If there really is a problem with the downmix I would be interested in a better one too. :)

Cu Selur

OtonVM
27th December 2011, 11:29
Removed '--multi-threaded' (it's just audio anyway).

I doubt that ffmpeg verbosity has any influence since it's probably a different stream of data (stderr vs stdout); I had to fight with that when piping in python. I did it anyway.

I use 'pcm_f32le' since I'm mixing together more streams into one so I think that more bits for sox to work with are better. When I'm converting stereo to stereo I leave everything at default.
I try not to resample at any point so not to induce any artifacts. Also afconvert (on mac) has than more data to work with.

Result: same!
http://img546.imageshack.us/img546/7711/screenshot20111227at111.png
Left channel is still much louder.


(btw, hybrid looks cool but doesn't run on my mac (I have QT installed), error: "Sorry, but support for options has been dropped, use .ini file instead!")

Selur
27th December 2011, 11:32
"Sorry, but support for options has been dropped, use .ini file instead!"
this should only happen is Hybrid is called with additional command line parameters,.. (works here on my mac without a problem, but you never no the feedback from other mac users is next to null so I never know for sure,... :))

OtonVM
27th December 2011, 11:41
this should only happen is Hybrid is called with additional command line parameters,.. (works here on my mac without a problem, but you never no the feedback from other mac users is next to null so I never know for sure,... :))

Nope, I'm just running it from the finder. I'm on SL btw. (But I think I'll either post on your forum or use it on win.)

Selur
27th December 2011, 21:16
I exchanged the Hybrid download with a static build, hope that works.

OtonVM
30th December 2011, 17:22
So, no new ideas?

Selur
30th December 2011, 17:31
Didn't look at it, since I'm just to deaf to fix the problem. :)

b66pak
30th December 2011, 19:45
@OtonVM

to downmix to stereo (without LFE) use:
remix -m 1v0.3694,3v0.2612,5v0.3694 2v0.3694,3v0.2612,6v0.3694

to downmix to stereo with LFE (not recommended) use:
remix -m 1v0.2929,3v0.2071,4v0.2071,5v0.2929 2v0.2929,3v0.2071,4v0.2071,6v0.2929
_

Selur
30th December 2011, 20:10
okay, to sum them all up, here are the once I use in Hybrid:
//5.1toStereo
1v0.3694,3v0.2612,5v0.3694 2v0.3694,3v0.2612,6v0.3694
//5.1toStereo (dpl)
1v0.3205,3v0.2265,4v0.2265,5v0.2265 2v0.3205,3v0.2265,4v-0.2265,5v-0.2265
//5.1toStereo (dpl2)
1v0.3254,3v0.2301,5v0.2818,6v0.1627 2v0.3254,3v0.2301,5v-0.1627,6v-0.2818
//5.1toStereo (lfe)
1v0.2929,3v0.2071,4v0.2071,5v0.2929 2v0.2929,3v0.2071,4v0.2071,6v0.2929
//5.1toStereo (dpllfe)
1v0.2613,3v0.1847,4v0.1847,5v0.1847,6v0.1847 2v0.2613,3v0.1847,4v0.1847,5v-0.1847,6v-0.1847
//5.1toStereo (dpl2lfe)
1v0.2646,3v0.1870,4v0.1870,5v0.2291,6v0.1323 2v0.2646,3v0.1870,4v0.1870,5v-0.1323,6v-0.2291

b66pak is right and posted the '5.1 to Stereo' and the '5.1toStereo (lfe)' and the first one you used was the '5.1toStereo (dpl2lfe)' so all the others might be worth a try,...

Cu Selur