Help - Search - Members - Calendar
Full Version: encoding 6-channel WAV to FLAC
Hydrogenaudio Forums > Lossless Audio Compression > FLAC
randal1013
what do i need in the command line?

i'm using flac 1.2.1 and foobar .9.4.4

normal encode options don't work and i have no idea how to get flac to handle 6-channel files.
jcoalson
need more info than "doesn't work"
randal1013
i dont have any more info. what i have are 6-channel WAV files that i'd like to convert to flac, but i don't know what to put in the command line. you develop flac, right? if you had 6-channel WAV files you wanted to convert to flac, how would you do it?
jcoalson
assuming you're on windows and you have flac installed, open a shell and do "flac 6channel.wav" or whatever the wav file name is.

didn't foobar give you some kind of error message?
randal1013
yeah, foobar said it doesn't work, check the parameters. and the flac frontend says they're not wave_format_extensible, whatever the hell that means.

i have "-s -8 - -o %d" in my command line. it works fine with 2 channel files, but not with 6 channel files. i know flac can handle 6 channel files because i can convert my 6 channel WAVs with dbpoweramp. the only problem there is, dbpoweramp uses flac 1.1.4, and i'd rather use one program to do all my converting. since "-s -8 - -o %d" aren't the right parameters, then what parameters do i need?
Egor
QUOTE(randal1013 @ Sep 20 2007, 10:29) *
i have "-s -8 - -o %d" in my command line.

foobar2000 produces incompatible (sort of non-standard) multichannel files, see here: WAVEFORMATEXTENSIBLE, output wav files

You have to add the "--channel-map=none" switch to your command line parameters:
"-s -8 --channel-map=none - -o %d"
randal1013
^when i try those parameters, foobar converts the file ok, but then when i try to playback the file, i get "Unsupported format or corrupted file".
Egor
QUOTE(randal1013 @ Sep 20 2007, 11:25) *
^when i try those parameters, foobar converts the file ok, but then when i try to playback the file, i get "Unsupported format or corrupted file".

Works for me, foobar2000 0.9.4.4, flac 1.2.1. Check the extension, it must be "flac".

QUOTE
Duration : 3:27.008 (9936384 samples)
Sample Rate : 48000 Hz
Channels : 6
Bits Per Sample : 16
Bitrate : 1641 kbps
Codec : FLAC
Encoding : lossless
Tool : reference libFLAC 1.2.1 20070917


Edit. The parameters used: "--ignore-chunk-sizes -s --best --channel-map=none - -o %d"
randal1013
my WAVs are 24BPS. when i convert them to 16BPS, they play, but not when i preserve them at 24BPS.


is there a parameter for BPS? i don't see the --channel-map=none parameter on the flac site, where did you get that from?
Egor
QUOTE(randal1013 @ Sep 20 2007, 12:54) *
my WAVs are 24BPS. when i convert them to 16BPS, they play, but not when i preserve them at 24BPS.

You should define output bitdepth in foobar2000: Preferences->Playback->Output. If your soundcard or it's driver do not support 24 bit playback, set Output bitdepth to 16 bit value. FLAC itself does support 24 bit multichannel audio.

QUOTE(randal1013 @ Sep 20 2007, 12:54) *
is there a parameter for BPS? i don't see the --channel-map=none parameter on the flac site, where did you get that from?

There is no option for bitdepth in flac.exe, because flac preserves original bitdepth (it's a lossless codec - no loss). However, you can use foobar2000' on-the-fly bitdepth conversion feature.

The --channel-map option is undocumented, but there is additional information on these forums (and official mailing list too).
randal1013
the 24BPS WAVs play fine on my PC, and i can convert them to wavpack and they play fine (and i it converts with the same parameters i use for stereo/16BPS CD rips). i don't know what dbpoweramp does differently, but it can convert my 6 channel / 24BPS wavs to flac and play fine, but like i said earlier, it uses flac 1.1.4. either i'm missing something in my foobar parameters, or flac 1.2.1 just can't handle 6 channel / 24BPS files.
jcoalson
QUOTE(randal1013 @ Sep 20 2007, 09:52) *
flac 1.2.1 just can't handle 6 channel / 24BPS files.
it can
randal1013
QUOTE(jcoalson @ Sep 20 2007, 14:48) *

QUOTE(randal1013 @ Sep 20 2007, 09:52) *
flac 1.2.1 just can't handle 6 channel / 24BPS files.
it can


then what do i need in the command line?
jcoalson
if the wav file has a channel assignment and order that matches one of FLAC's, you don't need --channel-map=none. if it doesn't match, you need --channel-map=none to make flac preserve the non-standard order. sounds like your wav file needed --channel-map=none and it encoded ok with it.

I don't use foobar much so I don't know why it won't play.
Egor
QUOTE(randal1013 @ Sep 21 2007, 03:46) *
then what do i need in the command line?

Use the following preset with fb2k:
CODE
Preset: Custom
Encoder: flac.exe
Extension: flac
Parameters: --ignore-chunk-sizes -s --best --channel-map=none - -o %d
Format is: lossless
Highest BPS mode supported: 24 bit
Encoder name: FLAC


I have just verified that both foobar2000 0.9.4.4 and Winamp 5.35 play 6ch/24bit/48kHz FLAC fine. Flac.exe was from sf.net's "flac-1.2.1-win.zip" package.
Also, if you aren't using standard foobar2000 configuration (a 3rd-pty output plugin, DSP or something), try reverting to the standard configuration (DirectSound output, no DSPs etc.).
randal1013
well this is a big WTF. i tried that command line, didn't work. re-downloaded/re-installed flac 1.2.1 and foobar 9.4.4. still didn't work. just for the hell of it, i downloaded flac 1.2.0. guess what - it works! looks like i'll be sticking with 1.2.0 for my DVD-A rips.
Egor
QUOTE(randal1013 @ Sep 21 2007, 12:44) *
well this is a big WTF. i tried that command line, didn't work. re-downloaded/re-installed flac 1.2.1 and foobar 9.4.4.

Aha, confirmed sad.gif

Flac.exe from the flac-1.2.1b.exe package produces broken 24bit flacs. Foobar2000 0.9.4.4 won't play it, Winamp 5.35 will play with skips.

Edit. Channel count and samplerate don't matter, all 24 bit audio is affected.
tebasuna51
QUOTE(jcoalson @ Sep 21 2007, 01:51) *

if the wav file has a channel assignment and order that matches one of FLAC's, you don't need --channel-map=none. if it doesn't match, you need --channel-map=none to make flac preserve the non-standard order. sounds like your wav file needed --channel-map=none and it encoded ok with it.

The undocumented parameter --channel-map=none is used only to force Flac accept standard wav header instead WAVE_FORMAT_EXTENSIBLE wav header. Then a correct mapped wav (FL-FR-FC-LF-BL-BR) with standard header can be used with:
flac --channel-map=none standard_header.wav -o correct_mapped.flac

QUOTE
I don't use foobar much so I don't know ...

Foobar sends (STDOUT->STDIN) uncompressed data with a standard wav header (we can force bitdepth, channel-mapping, samplerate,... with DSP functions but not use a WAVE_FORMAT_EXTENSIBLE wav header).

Then for use flac multichannel output with Foobar always need the --channel-map=none undocumented parameter, sorry.

EDIT:
Maybe --channel-map=0x3F can be used to send flac the correct MaskChannels?
The only significative difference betwen standard and WAVE_FORMAT_EXTENSIBLE header is this field.
jcoalson
QUOTE(Egor @ Sep 21 2007, 01:42) *
QUOTE(randal1013 @ Sep 21 2007, 12:44) *
well this is a big WTF. i tried that command line, didn't work. re-downloaded/re-installed flac 1.2.1 and foobar 9.4.4.

Aha, confirmed sad.gif

Flac.exe from the flac-1.2.1b.exe package produces broken 24bit flacs. Foobar2000 0.9.4.4 won't play it, Winamp 5.35 will play with skips.

Edit. Channel count and samplerate don't matter, all 24 bit audio is affected.
ok, I have just finished checking into this.

first, it is not generating corrupt files. second, this behavior should occur with certain 24bit files on any flavor of flac-1.2.1, including both versions of the installer.

what is happening is that the encoder is taking advantage of 1.2.x features to encode the 24bit file more efficiently. this was not supposed to be released yet to give s/w more time to update to a 1.2.x decoder, but was picked up by a CVS merge that was too broad.

probably the reason it's not playing in foobar is the decoder is pre-1.2.x, but it could also be related to how it handles 6ch FLAC files.

I am going to post this info to the 'flac 1.2.1 released' thread soon, please follow up with any questions regarding this specific problem there.

QUOTE(tebasuna51 @ Sep 21 2007, 05:57) *
QUOTE(jcoalson @ Sep 21 2007, 01:51) *
if the wav file has a channel assignment and order that matches one of FLAC's, you don't need --channel-map=none. if it doesn't match, you need --channel-map=none to make flac preserve the non-standard order. sounds like your wav file needed --channel-map=none and it encoded ok with it.
The undocumented parameter --channel-map=none is used only to force Flac accept standard wav header instead WAVE_FORMAT_EXTENSIBLE wav header.
all --channel-map=none does is to not try and figure out the channel order, instead encoding channels as the same order they appear in the input. if the input is WAVEFORMATEXTENSIBLE it will also save the channel mask in a tag.

QUOTE(tebasuna51 @ Sep 21 2007, 05:57) *
Maybe --channel-map=0x3F can be used to send flac the correct MaskChannels?
The only significative difference betwen standard and WAVE_FORMAT_EXTENSIBLE header is this field.
that won't work, --channel-map is intended to specify the channel assignments in a format-independent way, but only --channel-map=none is currently implemented.

there may be a --channel-mask option in the future for use with old WAVEFORMATEX multichannel files which will automatically reorder the channels to FLAC order if possible.

Josh
Egor
QUOTE(jcoalson @ Sep 24 2007, 07:58) *
second, this behavior should occur with certain 24bit files on any flavor of flac-1.2.1

Flac.exe from the "flac-1.2.1-win.zip" is not affected, dunno why:
QUOTE(foobar2000 file properties dialog - file is being played back)
Sample Rate : 48000 Hz
Channels : 6
Bits Per Sample : 24
Bitrate : 1642 kbps
Codec : FLAC
Tool : reference libFLAC 1.2.1 20070917

The same file encoded with the "installer-shipped" version isn't playable.

QUOTE(jcoalson @ Sep 24 2007, 07:58) *
what is happening is that the encoder is taking advantage of 1.2.x features to encode the 24bit file more efficiently. this was not supposed to be released yet to give s/w more time to update to a 1.2.x decoder, but was picked up by a CVS merge that was too broad.

So, will you update the encoder (downgrade) until 1.2.x decoders are propagated enough? Otherwise, only Audition and the next version of Winamp would be compatible... (Or maybe, a Known issues entry?)

QUOTE(jcoalson @ Sep 24 2007, 07:58) *
probably the reason it's not playing in foobar is the decoder is pre-1.2.x, but it could also be related to how it handles 6ch FLAC files.

foobar2000 0.9.4.4 is based on FLAC 1.1.0 decoder (ain't gonna be updated soon sad.gif ), and Winamp 5.35 is on 1.1.4. Though, next version of Winamp (5.36) will be 1.2.x-compatible.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.