Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Question about Converter and encoders (Read 5533 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Question about Converter and encoders

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)?

Question about Converter and encoders

Reply #1
Anyone can help?

Question about Converter and encoders

Reply #2
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? 

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.

Question about Converter and encoders

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

Question about Converter and encoders

Reply #4
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.

Question about Converter and encoders

Reply #5
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
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? 
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?

Question about Converter and encoders

Reply #6
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.

Question about Converter and encoders

Reply #7
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.

Question about Converter and encoders

Reply #8
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?

Question about Converter and encoders

Reply #9
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?

Question about Converter and encoders

Reply #10
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.

 

Question about Converter and encoders

Reply #11
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.  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.

Question about Converter and encoders

Reply #12
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

Question about Converter and encoders

Reply #13
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.

Question about Converter and encoders

Reply #14
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'.

Question about Converter and encoders

Reply #15
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.