IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Format options defaults
JJZolx
post Oct 19 2008, 18:06
Post #1





Group: Members
Posts: 378
Joined: 26-November 04
Member No.: 18345



I'm looking at a program which uses Flac encoding in a transcoding operation, and trying to figure out what the options listed below do. Do they tell Flac about the format of the input or what to produce in its output?

Are there default values for each of these?

CODE
format options:
      --endian={big|little}    Set byte order for samples
      --channels=#             Number of channels
      --bps=#                  Number of bits per sample
      --sample-rate=#          Sample rate in Hz
      --sign={signed|unsigned} Sign of samples (the default is signed)


This post has been edited by JJZolx: Oct 19 2008, 18:07
Go to the top of the page
+Quote Post
Egor
post Oct 19 2008, 18:32
Post #2





Group: Members
Posts: 826
Joined: 29-September 04
Member No.: 17374



These options are for RAW input only, i.e. WAV without a header.

There is no default value - for each option you must specify a value, but I can give some hints:

Endian is little for Windows machine,
bps is 16 for a CD-Audio content
sample rate is 44100 Hz for CD-Audio
sign is signed most probably.
Go to the top of the page
+Quote Post
JJZolx
post Oct 19 2008, 19:12
Post #3





Group: Members
Posts: 378
Joined: 26-November 04
Member No.: 18345



QUOTE (Egor @ Oct 19 2008, 11:32) *
These options are for RAW input only, i.e. WAV without a header.

There is no default value - for each option you must specify a value, but I can give some hints:

Endian is little for Windows machine,
bps is 16 for a CD-Audio content
sample rate is 44100 Hz for CD-Audio
sign is signed most probably.


Thanks. That's how it's being used. The output is WAV from LAME, with no header (long story why it's transcoding Mp3 to Flac, but it's necessary).

So these option _must_ be specified, or else Flac will have no idea what to do and will fail or ... will it? I would have thought that it would default to assuming redbook CD format of 2ch/16bit/44.1kHz.

Should --force-raw-format also be given, or will it matter?
Go to the top of the page
+Quote Post
Nick.C
post Oct 19 2008, 19:25
Post #4


lossyWAV Developer


Group: Developer
Posts: 1772
Joined: 11-April 07
From: Wherever here is
Member No.: 42400



QUOTE (JJZolx @ Oct 19 2008, 19:12) *
Should --force-raw-format also be given, or will it matter?
If the stream has no WAV chunks in it, only raw audio, then --force-raw-format is unnecessary.


--------------------
lossyWAV -q X -a 4 --feedback 4| FLAC -8 ~= 320kbps
Go to the top of the page
+Quote Post
JJZolx
post Oct 20 2008, 03:42
Post #5





Group: Members
Posts: 378
Joined: 26-November 04
Member No.: 18345



What does this bit mean, from the detailed Help?

QUOTE
flac checks for the presence of a AIFF/WAVE header to decide whether or not to
treat an input file as AIFF/WAVE format or raw samples. If any input file is
raw you must specify the format options {-fb|fl} -fc -fp and -fs, which will
apply to all raw files. You can force AIFF/WAVE files to be treated as raw
files using -fr.


There's no documentation of -fb -fl -fc -fp -fs or -fr options. Can I assume these are short forms of --endian big, --endian little, --channels, --bps, --sampe-rate and --force-raw-format, respectively? Or is this an outdated bit of documentation?

This post has been edited by JJZolx: Oct 20 2008, 04:34
Go to the top of the page
+Quote Post
jcoalson
post Oct 20 2008, 22:13
Post #6


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



oops, the -fs, etc options are ancient short forms of the new long options (gotta fix that)
-fs = --sample-rate
-fc = --channels
-fp = --bps
-fb = --endian=big
-fl = --endian=little

flac tries to detect wave/aiff from the file header. if it does not see a valid header it assumes raw samples, in which case you have to specify all those options (and --sign=...) so it knows the raw format; it doesn't make any assumptions about it.

you only have to use --force-raw-format if the detection fails (which I've never heard of). but it won't hurt to use it if you know you're feeding it raw samples.
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: 20th April 2014 - 22:27