IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
oggenc and channel mask, question regarding unusual (6.1, etc.) configurations
msoltyspl
post Nov 1 2010, 01:52
Post #1





Group: Members
Posts: 10
Joined: 27-February 10
Member No.: 78578



Using latest official tools compiled from sources - so 1.4.0, 1.3.1 and 1.2.0 of tools, vorbis and ogg respectively.

Generally - if I have for example flac file with 0x70F (6.1) or 0x63F (7.1) channel mask included - the oggenc will create proper ogg file with necessary WAVEFORMATEXTENSIBLE_CHANNEL_MASK "comment". But, if I try to encode the same data from wav files (with necessary channel info present), the mask will not be included in the resulting ogg file.

Is this expected behavior ? Or is there some specific switch I should use to make oggenc add proper channel mask to the ogg file ?
Go to the top of the page
+Quote Post
john33
post Nov 1 2010, 10:00
Post #2


xcLame and OggDropXPd Developer


Group: Developer
Posts: 3764
Joined: 30-September 01
From: Bracknell, UK
Member No.: 111



QUOTE (msoltyspl @ Nov 1 2010, 01:52) *
Using latest official tools compiled from sources - so 1.4.0, 1.3.1 and 1.2.0 of tools, vorbis and ogg respectively.

Generally - if I have for example flac file with 0x70F (6.1) or 0x63F (7.1) channel mask included - the oggenc will create proper ogg file with necessary WAVEFORMATEXTENSIBLE_CHANNEL_MASK "comment". But, if I try to encode the same data from wav files (with necessary channel info present), the mask will not be included in the resulting ogg file.

Is this expected behavior ? Or is there some specific switch I should use to make oggenc add proper channel mask to the ogg file ?

I could be wrong because I haven't checked this out, but I suspect that the channel mask comment is being copied from the flac file comment rather than being created by oggenc.


--------------------
John
----------------------------------------------------------------
My compiles and utilities are at http://www.rarewares.org/
Go to the top of the page
+Quote Post
msoltyspl
post Nov 1 2010, 17:41
Post #3





Group: Members
Posts: 10
Joined: 27-February 10
Member No.: 78578



Most likely, yes.

Well, I'm testing a bit those configurations to see when they actually work properly. The results are not too encouraging on the decoding side at least. I made trivial 6.1 wav file for testing with 0x70F setup (maybe I messed up something ?):

http://soltys.ziu.info/temp/61v2.7z (wav file - 48khz, 24bit)
http://soltys.ziu.info/temp/61v2.flac (flac encoded from that wav file)

Any ogg file I do from those (so without mask from wav, or with mask from flac) is not played properly - tested with: winamp (bad channel order in each case - wav, flac, ogg), foobar (doesn't recognize the file), official oggcodecs (assumes only 2 channels) ffmpeg-tryouts' libavcodec (bad channel order) and tremor (crash).

In comparison, flac (including mkv) and wav (excluding mkv) play fine through libavcodec and foobar.

Peeking into oggenc/audio.c - it seems that the oggenc should be able to handle it just fine through wav_open() function which has tests for different channels setup, 0x70f in particular. So my guess is that the blame is on decoders/players side.

This post has been edited by msoltyspl: Nov 1 2010, 17:42
Go to the top of the page
+Quote Post
john33
post Nov 1 2010, 18:13
Post #4


xcLame and OggDropXPd Developer


Group: Developer
Posts: 3764
Joined: 30-September 01
From: Bracknell, UK
Member No.: 111



QUOTE (msoltyspl @ Nov 1 2010, 17:41) *
Most likely, yes.

Well, I'm testing a bit those configurations to see when they actually work properly. The results are not too encouraging on the decoding side at least. I made trivial 6.1 wav file for testing with 0x70F setup (maybe I messed up something ?):

http://soltys.ziu.info/temp/61v2.7z (wav file - 48khz, 24bit)
http://soltys.ziu.info/temp/61v2.flac (flac encoded from that wav file)

Any ogg file I do from those (so without mask from wav, or with mask from flac) is not played properly - tested with: winamp (bad channel order in each case - wav, flac, ogg), foobar (doesn't recognize the file), official oggcodecs (assumes only 2 channels) ffmpeg-tryouts' libavcodec (bad channel order) and tremor (crash).

In comparison, flac (including mkv) and wav (excluding mkv) play fine through libavcodec and foobar.

Peeking into oggenc/audio.c - it seems that the oggenc should be able to handle it just fine through wav_open() function which has tests for different channels setup, 0x70f in particular. So my guess is that the blame is on decoders/players side.

As you've seen, audio.c will map up to 7.1 with or without the WAVEFORMATEXTENSIBLE header as though the header was present. The resulting multichannel ogg file should subsequently be decoded to the default order with the correct header, but that does depend on the decoder used, certainly my decoder on Rarewares does. smile.gif Anything over 7.1 is encoded in the channel order presented.


--------------------
John
----------------------------------------------------------------
My compiles and utilities are at http://www.rarewares.org/
Go to the top of the page
+Quote Post
msoltyspl
post Nov 1 2010, 21:09
Post #5





Group: Members
Posts: 10
Joined: 27-February 10
Member No.: 78578



QUOTE (john33 @ Nov 1 2010, 18:13) *
As you've seen, audio.c will map up to 7.1 with or without the WAVEFORMATEXTENSIBLE header as though the header was present. The resulting multichannel ogg file should subsequently be decoded to the default order with the correct header, but that does depend on the decoder used, certainly my decoder on Rarewares does. smile.gif Anything over 7.1 is encoded in the channel order presented.


Yea, and indeed your oggdec works fine (contrary to 1.4.0's oggdec - which decodes that 6.1 weirdo into silence).

Any suggestions about directshow filter that could potentially output channels in correct order (apart from workarounds such as channel swapping / manual mixer settings) ?
Go to the top of the page
+Quote Post
john33
post Nov 1 2010, 23:09
Post #6


xcLame and OggDropXPd Developer


Group: Developer
Posts: 3764
Joined: 30-September 01
From: Bracknell, UK
Member No.: 111



QUOTE (msoltyspl @ Nov 1 2010, 21:09) *
Yea, and indeed your oggdec works fine (contrary to 1.4.0's oggdec - which decodes that 6.1 weirdo into silence).

Any suggestions about directshow filter that could potentially output channels in correct order (apart from workarounds such as channel swapping / manual mixer settings) ?

I'm afraid I've no idea whether the 'opencodecs' DSFilters work correctly in this regard, or not, as I've not tried them.


--------------------
John
----------------------------------------------------------------
My compiles and utilities are at http://www.rarewares.org/
Go to the top of the page
+Quote Post
msoltyspl
post Nov 3 2010, 00:40
Post #7





Group: Members
Posts: 10
Joined: 27-February 10
Member No.: 78578



Actually, I think I might have found a bug in oggenc after all. According to vorbis specs:

QUOTE
seven channels
the stream is 6.1 surround. channel order: front left, center, front right, side left, side right, rear center, LFE


Order as defined by 0x70F is FL, FR, FC, LFE, BC, SL, SR, so the permutation row for 6.1 entry should be:

0, 2, 1, 5, 6, 4, 3

But it is (in audio.c):

0, 2, 1, 4, 5, 6, 3

All the channel-permutation rows for other channel setups are fine. Only 6.1 one is wrong.


If I change the order to the former, then for example - libavcodec has no problems with playing the file with correct channel order. What do you think ?

ps.
I submitted tickets for both oggenc and oggdsf, for what it's worth.

This post has been edited by msoltyspl: Nov 3 2010, 01:34
Go to the top of the page
+Quote Post
john33
post Nov 3 2010, 09:46
Post #8


xcLame and OggDropXPd Developer


Group: Developer
Posts: 3764
Joined: 30-September 01
From: Bracknell, UK
Member No.: 111



QUOTE (msoltyspl @ Nov 3 2010, 00:40) *
Actually, I think I might have found a bug in oggenc after all. According to vorbis specs:

QUOTE
seven channels
the stream is 6.1 surround. channel order: front left, center, front right, side left, side right, rear center, LFE


Order as defined by 0x70F is FL, FR, FC, LFE, BC, SL, SR, so the permutation row for 6.1 entry should be:

0, 2, 1, 5, 6, 4, 3

But it is (in audio.c):

0, 2, 1, 4, 5, 6, 3

All the channel-permutation rows for other channel setups are fine. Only 6.1 one is wrong.


If I change the order to the former, then for example - libavcodec has no problems with playing the file with correct channel order. What do you think ?

ps.
I submitted tickets for both oggenc and oggdsf, for what it's worth.

I'll check it out. The channel permutation has been wrong before. wink.gif


--------------------
John
----------------------------------------------------------------
My compiles and utilities are at http://www.rarewares.org/
Go to the top of the page
+Quote Post
john33
post Nov 3 2010, 16:51
Post #9


xcLame and OggDropXPd Developer


Group: Developer
Posts: 3764
Joined: 30-September 01
From: Bracknell, UK
Member No.: 111



It would certainly appear that you are correct, but let's see whether there is a response before I make the changes to my compiles.


--------------------
John
----------------------------------------------------------------
My compiles and utilities are at http://www.rarewares.org/
Go to the top of the page
+Quote Post
xiphmont
post Nov 4 2010, 19:36
Post #10


Xiph.org


Group: Developer
Posts: 176
Joined: 24-September 01
Member No.: 16



QUOTE (john33 @ Nov 3 2010, 11:51) *
It would certainly appear that you are correct, but let's see whether there is a response before I make the changes to my compiles.


gmaxwell woke me up to the Trac report; msoltyspl looks to be correct, committed his patch.
Go to the top of the page
+Quote Post
john33
post Nov 4 2010, 19:41
Post #11


xcLame and OggDropXPd Developer


Group: Developer
Posts: 3764
Joined: 30-September 01
From: Bracknell, UK
Member No.: 111



QUOTE (xiphmont @ Nov 4 2010, 19:36) *
gmaxwell woke me up to the Trac report; msoltyspl looks to be correct, committed his patch.

Thanks Monty, I'll update the compiles on Rarewares post-haste, well, in the next 24 hours. wink.gif


--------------------
John
----------------------------------------------------------------
My compiles and utilities are at http://www.rarewares.org/
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd December 2014 - 16:47