Help - Search - Members - Calendar
Full Version: Using Lame by command line
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - General
Boiled Beans
I've decided after using RazorLame, it is difficult to get the required settings by fiddling with the options.

So I want to learn how to use Lame the command-line way. I've searched the forum but don't seem to find any info. I'm a complete newbie at using the command line so can anyone help or point me to guides?

For example, I want to encode mp3s just like how I configured EAC to do, "-V 2 --vbr-new"

So how do I do that?

And what does %s %d when placed at the end of the line do?

And just another question, in EAC, under Compression Options, Lame.DLL tag, is the info there important, considering I've selected User Defined Encoder?
Nick.C
%s = source file;
%d = destination file.
Synthetic Soul
QUOTE(Boiled Beans @ Mar 26 2008, 05:26) *
So I want to learn how to use Lame the command-line way. I've searched the forum but don't seem to find any info. I'm a complete newbie at using the command line so can anyone help or point me to guides?
A good place to start are the LAME docs:

http://lame.cvs.sourceforge.net/*checkout*...html/index.html

QUOTE(Boiled Beans @ Mar 26 2008, 05:26) *
For example, I want to encode mp3s just like how I configured EAC to do, "-V 2 --vbr-new"

So how do I do that?
The easiest - and probably best - command line to use those settings would be:

CODE
LAME.EXE -V2 --vbr-new "<input>.wav"

The only other thing you should add would be an output filename, if you didn't want "<input>.wav.mp3":

CODE
LAME.EXE -V2 --vbr-new "<input>.wav" "<output>.mp3"


QUOTE(Boiled Beans @ Mar 26 2008, 05:26) *
And what does %s %d when placed at the end of the line do?
Those are EAC placeholders, and are replaced by EAC with the source and destination filenames. They do not relate to using LAME on the command line.

QUOTE(Boiled Beans @ Mar 26 2008, 05:26) *
And just another question, in EAC, under Compression Options, Lame.DLL tag, is the info there important, considering I've selected User Defined Encoder?
No, they will not affect your external compression settings.

k.eight.a
QUOTE(Boiled Beans @ Mar 26 2008, 06:26) *
I'm a complete newbie at using the command line so can anyone help or point me to guides?

For example, I want to encode mp3s just like how I configured EAC to do, "-V 2 --vbr-new"

So how do I do that?

And what does %s %d when placed at the end of the line do?
Exact Audio Copy
LAME
EAC & Lame
EAC Guides

This is enough reading but you will find answers to your questions...
Boiled Beans
QUOTE(Synthetic Soul @ Mar 26 2008, 15:57) *

QUOTE(Boiled Beans @ Mar 26 2008, 05:26) *
So I want to learn how to use Lame the command-line way. I've searched the forum but don't seem to find any info. I'm a complete newbie at using the command line so can anyone help or point me to guides?
A good place to start are the LAME docs:

http://lame.cvs.sourceforge.net/*checkout*...html/index.html



Just read the link, very comprehensive guide, showing all the different settings!

I tried to apply some of the settings, but I'm still stuck at the command line. How exactly do you use it? By default, it shows C:\Documents and Settings\Owner>
If I type Lame.exe after that line, it gives an error.
My Lame.exe is found in C:\Program Files\Exact Audio Copy
And my ripped .wav files are found in C:\Album Art

So how exactly do I navigate in command line? Or do Lame.exe and . wav files need to be in the same directory?

And also, is there a command which will encode all the wavs in a folder at one go instead of entering the input name individually?


Regarding %s and %d, I've read the link as well, what exactly do you mean by Source file and Destination file placeholder? Will the encoding process still work if I remove them from EAC?
Synthetic Soul
QUOTE(Boiled Beans @ Mar 27 2008, 08:45) *
I tried to apply some of the settings, but I'm still stuck at the command line. How exactly do you use it? By default, it shows C:\Documents and Settings\Owner>
If I type Lame.exe after that line, it gives an error.
My Lame.exe is found in C:\Program Files\Exact Audio Copy
And my ripped .wav files are found in C:\Album Art

So how exactly do I navigate in command line? Or do Lame.exe and . wav files need to be in the same directory?
With the command line you either need to:
  • Specify the full path to a file (including an executable)
  • Just refer to the file name (e.g.: LAME.EXE) if you are working in the same folder as the file
  • Just refer to the file name if it is in a folder in your PATH (e.g.: your Windows directory).
If your lame.exe is in "C:\Program Files\Exact Audio Copy", and your WAVE files in "C:\Album Art", then I would tend to navigate to "C:\Album Art" and then use:

CODE
"C:\Program Files\Exact Audio Copy\LAME.EXE" -V2 --vbr-new file.wave

In actual fact, what I do, is place all my command line executables in a folder in my PATH so that I only need to use the file name whichever folder I am working from.

Of course you could work from "C:\Documents and Settings\Owner" and just use:

CODE
"C:\Program Files\Exact Audio Copy\LAME.EXE" -V2 --vbr-new "C:\Album Art\file.wave"

One tool I find really useful is Clickie. This small application adds an "Open MS-DOS Prompt" content menu item to any folder in Windows. This makes it very easy to open a console with the working directory set to the folder of your choice (rather than having to use CD from within the console).

QUOTE(Boiled Beans @ Mar 27 2008, 08:45) *
And also, is there a command which will encode all the wavs in a folder at one go instead of entering the input name individually?
For this, you need to use the command FOR. Follow the link, and here's a simple example, to be run from "C:\Album Art":

CODE
FOR %G IN (*.wav) DO "C:\Program Files\Exact Audio Copy\LAME.EXE" -V2 --vbr-new "%G"

If you want to be doing more on the command line I would suggest taking a look around the site I am linking to for DOS commands.

QUOTE(Boiled Beans @ Mar 27 2008, 08:45) *
Regarding %s and %d, I've read the link as well, what exactly do you mean by Source file and Destination file placeholder? Will the encoding process still work if I remove them from EAC?
If encoding to MP3 the source file is a WAVE, and the destination an MP3. EAC uses the %s (source) and %d (destination) placeholders as tokens within the command line that you enter to represent where it should substitute the actual file names, as detirmined by the temporary WAVE file that EAC creates, and the file naming scheme the suer has specified.

Synthetic Soul
QUOTE(Boiled Beans @ Mar 27 2008, 08:45) *
Will the encoding process still work if I remove them from EAC?
No, not when using "User Defined Encoder", which is recommended. Otherwise, LAME will not know what file to encode, and what to call the encoded file.
pdq
@Boiled Beans:

Are you sure you are ready to use command line encoding? I'm not saying you shouldn't learn to use the command line under Windows, but you clearly need to spend some time first learning about command line in general and directory structures under Windows, etc.

You have been fortunate that people here at HA have been very patient with you (which doesn't always happen, I'm sorry to say), but I think you might be better served to do a little homework first.

Please don't take this as criticism, I'm just trying to be helpful.

Regards,
Paul.
Boiled Beans
QUOTE(Synthetic Soul @ Mar 27 2008, 17:37) *

With the command line you either need to:
  • Specify the full path to a file (including an executable)
  • Just refer to the file name (e.g.: LAME.EXE) if you are working in the same folder as the file
  • Just refer to the file name if it is in a folder in your PATH (e.g.: your Windows directory).
If your lame.exe is in "C:\Program Files\Exact Audio Copy", and your WAVE files in "C:\Album Art", then I would tend to navigate to "C:\Album Art" and then use:

CODE
"C:\Program Files\Exact Audio Copy\LAME.EXE" -V2 --vbr-new file.wave

In actual fact, what I do, is place all my command line executables in a folder in my PATH so that I only need to use the file name whichever folder I am working from.

Of course you could work from "C:\Documents and Settings\Owner" and just use:

CODE
"C:\Program Files\Exact Audio Copy\LAME.EXE" -V2 --vbr-new "C:\Album Art\file.wave"

One tool I find really useful is Clickie. This small application adds an "Open MS-DOS Prompt" content menu item to any folder in Windows. This makes it very easy to open a console with the working directory set to the folder of your choice (rather than having to use CD from within the console).

For this, you need to use the command FOR. Follow the link, and here's a simple example, to be run from "C:\Album Art":

CODE
FOR %G IN (*.wav) DO "C:\Program Files\Exact Audio Copy\LAME.EXE" -V2 --vbr-new "%G"

If you want to be doing more on the command line I would suggest taking a look around the site I am linking to for DOS commands.


Ah yes, thanks very much, I just got my first file encoded using that method.


QUOTE(Synthetic Soul @ Mar 27 2008, 17:37) *

If encoding to MP3 the source file is a WAVE, and the destination an MP3. EAC uses the %s (source) and %d (destination) placeholders as tokens within the command line that you enter to represent where it should substitute the actual file names, as detirmined by the temporary WAVE file that EAC creates, and the file naming scheme the suer has specified.


I understand now, that means it's essentially it's the same as "-V2 --vbr-new "<input>.wav" "<output>.mp3", with the input and output replaced by %s and %d, thanks!


QUOTE(pdq @ Mar 27 2008, 21:29) *



Please don't take this as criticism, I'm just trying to be helpful.


Yes, I don't mind. I just didn't know where to start as I've searched the forums and don't see any topics regarding it.
Synthetic Soul
QUOTE(Boiled Beans @ Mar 27 2008, 14:11) *
QUOTE(pdq @ Mar 27 2008, 21:29) *
Please don't take this as criticism, I'm just trying to be helpful.
Yes, I don't mind. I just didn't know where to start as I've searched the forums and don't see any topics regarding it.
It is not so much the command of LAME that is the issue, but more a familiarity with the command line. You won't find much help here with that, but I'm sure that there are some great sites out there.

The site I have referred to, SS64.com, has been invaluable to me; however I'm not sure that it will give you that core understanding that you need, like using double quotes on paths with spaces, using the tab key to autocomplete file names, navigating through your drives, etc.

It is well worth your time persevering though, as I find it very useful to be able to use the various encoders from the command line, rather than rely on 3rd party applications to do something very simple.

Good luck with it.
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.