[Vorbis-dev] 5.1 surround channel coupling

Sebastian Olter qduaty at gmail.com
Thu Feb 1 07:45:06 PST 2007


2007/2/1, Ivo Emanuel Gonçalves <justivo at gmail.com>:
> E-mail me whatever files you need hosted, and I'll put them online.  I
> have some spare bandwidth for the next months.

As we have talk a moment ago, there are legal issues that prevent us
from making movie soundtracks public. The solution is anyone can
create such samples themselves. My procedure is:

Assume we have a ripped dvd file called "movie.vob", with a 5.1 audio
track. Download and install mplayer. Type:

mencoder movie.vob -o sound.avi -ovc frameno -oac pcm -channels 6 -af
pan=3:.7071:.7809:.6247:.7071:.7809:-.6247:.7071:-.7809:.6247:.7071:-.7809:-.6247:.7071:1:0:.7071:0:0,volume

The pan filter works as follows: first number is a number of output
channels, then they are exactly so many weights separated by colons
for an input channel, then next input channel, and so on. Channel
order is: L,R,LS,RS,C,LFE. All coefficients are angle sinuses and
cosinuses. The actual values are not so important but they have to
correlate (ambisonic encoding equations are quite easy to understand:
look at http://www.muse.demon.co.uk/ref/speakers.html). Actually my
initial setup was somewhat different (0.6202 instead of 0.7809), which
gave a longer X-axis.

The command creates an empty video with a 3-channel pcm sound. The
file is about 1 GB per hour. Oggenc can't handle avi, so we have to
issue

mplayer sound.avi -dumpaudio

This throws out a stream.dump file (raw audio). Then

oggenc -q0 -R 48000 -C 3 stream.dump

works as expected. After encoding, we can test the results:

mplayer movie.vob -audiofile stream.ogg -channels 6 -af
pan=4:0.3536:0.3536:0.3536:0.3536:0.3536:0.3536:0:0:0.3536:-0.3536:.5:-.5,volume

The pan filter in above command is intended for two speakers +
headphones, for convenience. It is diametric ambisonic decoding, so
there may be some phase-related issues. Plug your headphone jack into
the rear sound output, test with mono to be sure loudness is equal in
front and back channels.

A decoding setup for ITU 5.1 is discussed on
http://pcfarina.eng.unipr.it/Public/B-format/5_1_conversion/5_1_decoders.htm.


More information about the Vorbis-dev mailing list