IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Question about Converter and encoders, Does order of switches matter?
EpicForever
post Feb 22 2013, 23:30
Post #1





Group: Members
Posts: 706
Joined: 14-September 11
From: Szczecin, PL
Member No.: 93712



I love foobar's "Converter" option. I tried to tune compression options beyond built-in presets with encoders command line switches - like in EAC. But after several tries I'm not sure weather some options really work. Encoders like LAME or FLAC have many available command line switches. Does order of them matter? I mean - is it possible, that putting some switch after another one can disable the one that is latter (effectively exclude it from processing options)? For example - does matter if "--sector-align" option in FLAC is the last one (after all "-T" switches for tags) or before them? Does it matter if "-V" (verification) switch is before or after compression parameters (like "-8", "-A")? I tried to read FLAC documentation but I see there only general explanations of all switches, but no info about revelance of their order. And how about the same question for LAME? And what if used switches explicitly exclude each other (like setting generally mid quality preset "--preset medium" and switch "-q0" which generally gives best available quality, or setting "-h", which is equivalent of "-q2" and "q0" one after another)?
Go to the top of the page
+Quote Post
EpicForever
post Feb 28 2013, 14:30
Post #2





Group: Members
Posts: 706
Joined: 14-September 11
From: Szczecin, PL
Member No.: 93712



Anyone can help?
Go to the top of the page
+Quote Post
marc2003
post Feb 28 2013, 14:43
Post #3





Group: Members
Posts: 4440
Joined: 27-January 05
From: England
Member No.: 19379



QUOTE
I tried to read FLAC documentation but I see there only general explanations of all switches, but no info about revelance of their order


does that not tell you something? surely if it were relevant, it would be in the docs? blink.gif

and i don't see why this topic is in the foobar2000 section? you'd get better answers in the various codec sub-forums.

as for me, i'm blissfully ignorant of all such things and am happy to use the presets with little sliders on. tongue.gif
Go to the top of the page
+Quote Post
EpicForever
post Feb 28 2013, 15:24
Post #4





Group: Members
Posts: 706
Joined: 14-September 11
From: Szczecin, PL
Member No.: 93712



Well, it's connected with Converter component. But you have right, now I see that I should go to other relevant HydrogenAudio subforum...

This post has been edited by EpicForever: Feb 28 2013, 15:27
Go to the top of the page
+Quote Post
marc2003
post Feb 28 2013, 15:53
Post #5





Group: Members
Posts: 4440
Joined: 27-January 05
From: England
Member No.: 19379



QUOTE (EpicForever @ Feb 28 2013, 14:24) *
Well, it's connected with Converter component.


not really - you're using custom settings.

if you had a query about the switches the presets use then this would be the right place to ask about it.
Go to the top of the page
+Quote Post
db1989
post Feb 28 2013, 18:55
Post #6





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



I have moved this from fb2k: General and reopened it, and closed your duplicate under FLAC. It would have made more sense to request a move originally rather than reposting, considering that replies had already been made. The fact that this first incarnation is of broader scope is another reason to favour it, to save you feeling the need to post it a third time in MP3 - General, etc.

QUOTE (marc2003 @ Feb 28 2013, 13:43) *
QUOTE
I tried to read FLAC documentation but I see there only general explanations of all switches, but no info about revelance of their order
does that not tell you something? surely if it were relevant, it would be in the docs? blink.gif
My sentiments exactly. If you’re not told that it matters, it shouldn’t matter. The exception is badly written documentation. But, and I feel as though I’m stating the blatantly obvious here, if you want to determine whether order affects behaviour, why don’t you just run some tests of your own?
Go to the top of the page
+Quote Post
EpicForever
post Feb 28 2013, 19:12
Post #7





Group: Members
Posts: 706
Joined: 14-September 11
From: Szczecin, PL
Member No.: 93712



FLAC runs so quickly that I can't even be sure weather it shows information about performing verification process or no... Maybe I should create specific wave file for purpose of testing it (very long one). In case of "--sector-align" I don't even know how to test it...
Same goes to LAME and question about permanently excluding switches. I am not sure how to test it. Let's have a look on switches "-q0" and "-h". What would be signification which switch was effectively used in resulting file if both are really high quality? Differences will be basically inaudible. What kind of examination can I perform to know that? If someone will help me with this I can test it on my own.
Go to the top of the page
+Quote Post
pdq
post Feb 28 2013, 19:25
Post #8





Group: Members
Posts: 3377
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



If you want answers more specific than "sometimes order matters, and sometimes it doesn't" then you will need to ask specific questions.

For example, in lame the -h switch is just shorthand for a -q switch, so if you use both then the second one overrides the first.
Go to the top of the page
+Quote Post
EpicForever
post Feb 28 2013, 21:28
Post #9





Group: Members
Posts: 706
Joined: 14-September 11
From: Szczecin, PL
Member No.: 93712



I already asked specific questions. About exact command line switches for both FLAC and LAME. Anyway I got partial answer to one of my questions. Switches that are further in "chain" override the ones that are right after the beginning. That's what happens to switches that are contrary in LAME. How about FLAC? What if I set "flac.exe -8 -V -5 --sector-allign -3" ? Does it work in the same way? File will be compressed with "-3" factor? But compressed just one time or recompressed? And how about verification of "--sector-allign" option - any suggestion?
Go to the top of the page
+Quote Post
db1989
post Feb 28 2013, 21:34
Post #10





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



I don’t intend to stop you from asking or anyone from answering such questions, but I have to ask: Does it matter? Why does it matter? Are you ever going to be cornered into a situation where you have to submit a command-line so packed with potentially contradictory switches?
Go to the top of the page
+Quote Post
EpicForever
post Feb 28 2013, 23:28
Post #11





Group: Members
Posts: 706
Joined: 14-September 11
From: Szczecin, PL
Member No.: 93712



I got such situation in EAC when I ripped my own Audio CDs for the first time, to MP3 format. EAC had setting that couldn't be omitted - "Low quality" vs. "High quality". "High quality" is equal to "-h" switch - which is equal to "-q2" switch. I added my own command line parameters. One of them was "-q 0". I never knew weather my files were encoded with "-q2" or "-q0". After 4 or 5 years I just wanted to know how LAME handles such stupid situations. EAC still has that setting, were one value HAVE to be chosen - "low" or "high" quality of encoding... So now I know (if pdq isn't wrong). "-q 0" was added after "-h" - then my files were encoded correctly - exactly as I wanted them to be encoded.

I hope that tomorrow I'll check what with "-V" option in FLAC - weather placement in "chain" of switches matters or not.

This post has been edited by EpicForever: Feb 28 2013, 23:31
Go to the top of the page
+Quote Post
db1989
post Feb 28 2013, 23:49
Post #12





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



QUOTE (EpicForever @ Feb 28 2013, 22:28) *
EAC had setting that couldn't be omitted - "Low quality" vs. "High quality". "High quality" is equal to "-h" switch - which is equal to "-q2" switch. […] EAC still has that setting, were one value HAVE to be chosen - "low" or "high" quality of encoding

Those values have no effect whatsoever when LAME is configured as a “User defined encoder”, unless you specifically create a command-line with token-delimited alternative parameters for the two modes. See the page on EAC placeholders for the relevant syntax.

The results that you described only apply if you use EAC’s built-in scheme for LAME* and I thought we all realised a long time ago that EAC’s built-in schemes are not worth the trouble. tongue.gif Of course, if that is what you were using at the time, I understand your concern. However, in any case, it’s not true to say that EAC will always add switches according to one or the other mode.

* Actually, I’m not even sure whether they apply then, either; however, that’s the only context in which EAC would automatically add options to LAME without your say-so.

This post has been edited by db1989: Feb 28 2013, 23:52
Reason for edit: asterisked
Go to the top of the page
+Quote Post
EpicForever
post Mar 1 2013, 00:22
Post #13





Group: Members
Posts: 706
Joined: 14-September 11
From: Szczecin, PL
Member No.: 93712



I configured EAC at that time to save command line parameters to ENCODEDBY field. When I chose "high quality" there was "-h" as one of the first parameters, when I chose "low quality" there was other letter as one of the first switches. LAME was configured as a “User defined encoder”. Just to clarify situation and justify my question. I don't have that files anymore so maybe I should try to rip them again to see... spectrals? but as far as I remember low pass filtering (cut off frequency value) is bounded with bitrate, so low pass should be the same for "-h" as for 'q0" I suppose, as bitrate was just 320 kbps... As you can see I don't have any idea what could be checked experimentally. So I thought that maybe there are some wise heads who can help wink.gif
Go to the top of the page
+Quote Post
pdq
post Mar 1 2013, 03:59
Post #14





Group: Members
Posts: 3377
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



You clearly haven't a clue what -h and -q actually do, so my recommendation is to use either -V or -b and default everything else. The lame developers have selected the optimum default values so that ordinary users don't have to think about them.
Go to the top of the page
+Quote Post
Rollin
post Mar 1 2013, 08:00
Post #15





Group: Members
Posts: 189
Joined: 5-March 08
Member No.: 51815



QUOTE (EpicForever @ Mar 1 2013, 00:28) *
And how about verification of "--sector-allign" option - any suggestion?

If you encode files ripped from CD "--sector-align" will have NO effect
http://flac.sourceforge.net/documentation_...ns_sector_align
QUOTE
Align encoding of multiple CD format files on sector boundaries. This option is only allowed when encoding files all of which have a 44.1kHz sample rate and 2 channels. With --sector-align, the encoder will align the resulting .flac streams so that their lengths are even multiples of a CD sector (1/75th of a second, or 588 samples). It does this by carrying over any partial sector at the end of each file to the next stream. The last stream will be padded to alignment with zeroes.
This option will have no effect if the files are already aligned (as is the normally the case with WAVE files ripped from a CD). flac can only align a set of files given in one invocation of flac.
WARNING: The ordering of files is important! If you give a command like 'flac --sector-align *.wav' the shell may not expand the wildcard to the order you expect. To be safe you should 'echo *.wav' first to confirm the order, or be explicit like 'flac --sector-align 8.wav 9.wav 10.wav'.
Go to the top of the page
+Quote Post
Arnold B. Kruege...
post Mar 1 2013, 21:07
Post #16





Group: Members
Posts: 3651
Joined: 29-October 08
From: USA, 48236
Member No.: 61311



QUOTE (EpicForever @ Feb 22 2013, 17:30) *
I love foobar's "Converter" option. I tried to tune compression options beyond built-in presets with encoders command line switches - like in EAC. But after several tries I'm not sure weather some options really work. Encoders like LAME or FLAC have many available command line switches. Does order of them matter?


You are really talking about how programs are written. More specifically you are talking about command line parsing.

The general rule is to parse the command line and then if the parsed command line makes sense, do what it directs.

In general parameters are parsed one at a time in the order given. If a several parameters change the same setting, then usually the last instance of that parameter change rules.

All of this is the discretion of the program designer/coder. If someone wants to be sloppy or anal, that is what happens. If someone wanted to parse in reverse order, so be it.
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: 1st August 2014 - 07:29