Help - Search - Members - Calendar
Full Version: LAME MP3 command-line questions
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - General
Seraphic
Hi,

I am new to LAME and trying to work out a script. So far I have the following (have not changed title/artist etc. yet):
Using 3.98.2 so do not need to add "--vbr-new and -h", correct?

CODE
lame -V 0 --tt "title" --ta "artist" --tl "album" --ty "year" --tc "comment" --tn "track[/total]" --tg "genre" --ti "file" --tv "id=value" sample.wav sample1.mp3


My question is though, what are the correct ID3Tags for copyright and URL?
And do I need to specify stereo, joint-stereo, or duel-channel? If so, how do you do that?
Was also interested to know, when using VBR, are you able to configure it so say it uses a minimum bit-rate of 128, an average bit-rate of 192, and a maximum bit-rate of 256? And again if so, how would you do that?

Now in regards to batch encoding. I did some searching and came across the below script:

CODE
@echo off
rem WinXP CMD file to encode all WAV files in a folder to MP3s via LAME.EXE..
rem Make sure this cmd file resides in the same folder as LAME.EXE.
rem
rem The argument to this cmd file should be the full path to the folder containing the WAV files.

rem Display our arguments..
echo Full Arg: %1
echo Drive: "%~d1"
echo Path: "%~p1"
echo Name: "%~n1"
echo Ext: "%~x1"
rem Change to arg drive and path
%~d1
cd "%1"
cd

rem Encode with Lame..
for %%z in (*.wav) do "%~dp0lame.exe" --preset standard "%%z" "%%~nz.mp3"

pause

:end


How it should work is that you name the above file something.cmd and move it into the folder with lame.exe.
Then create a shortcut, the move it to your desktop, now you should be able to just drag and drop your folder with the .wav tracks onto the .cmd file and it will batch encode them to .mp3.
I have not tried it yet because I was unsure where to add my encode settings from the first part of this thread to the batch encode script. Would think it would replace the "--preset standard" part.
Could anyone help?

Thanks
greynol
QUOTE (Seraphic @ Jul 27 2009, 16:01) *
My question is though, what are the correct ID3Tags for copyright and URL?

http://www.id3.org/id3v2.3.0

QUOTE (Seraphic @ Jul 27 2009, 16:01) *
And do I need to specify in the above script stereo, joint-stereo, or duel-channel? If so, how do you do that?

Unless you wish to negatively affect your sound quality or create files that are larger than necessary to obtain the same quality, you should let Lame encode channel information as it sees fit.

QUOTE (Seraphic @ Jul 27 2009, 16:01) *
Was interested to know, when using VBR, are you able to configure it so say use a minimum bit-rate of 128, an average bit-rate of 192, and a maximum bit-rate of 256? And again if so, how would you do that?

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

Lastly, -h is not necessary in the command line you specified; it does nothing.
Seraphic
QUOTE (greynol @ Jul 27 2009, 19:16) *
QUOTE (Seraphic @ Jul 27 2009, 16:01) *
My question is though, what are the correct ID3Tags for copyright and URL?

http://www.id3.org/id3v2.3.0


A lot of information there, but would it be this then?:
--tcop "copyright" or maybe --tc "copyright"
--tcom "url" or maybe --tu "url"

QUOTE (greynol @ Jul 27 2009, 19:16) *
QUOTE (Seraphic @ Jul 27 2009, 16:01) *
And do I need to specify in the above script stereo, joint-stereo, or duel-channel? If so, how do you do that?

Unless you wish to negatively affect your sound quality or create files that are larger than necessary to obtain the same quality, you should let Lame encode channel information as it sees fit.


Alright then.

QUOTE (greynol @ Jul 27 2009, 19:16) *
QUOTE (Seraphic @ Jul 27 2009, 16:01) *
Was interested to know, when using VBR, are you able to configure it so say use a minimum bit-rate of 128, an average bit-rate of 192, and a maximum bit-rate of 256? And again if so, how would you do that?

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


Based on that information, it would seem it would be:
-V 0 -B 256
But wouldn't that just mean max bit-rate of 256 and not minimum bit-rate of 128 and average bit-rate of 192?

QUOTE (greynol @ Jul 27 2009, 19:16) *
Lastly, -h is not necessary in the command line you specified; it does nothing.


I am using 3.98.2 so it would seem I do not need to add "--vbr-new or -h", correct?
Based on what you said, it would seem to be "Yes."

And last, any comments on the batch script questions I posted?

Thanks
pdq
You can specify both the minimum and maximum bitrates for variable bitrate encoding (-b for minimum and -B for maximum), but this is generally discouraged. Let Lame pick the optimum bitrate for each frame.

You can not specify an average bitrate with VBR. If you really want to specify the average bitrate, which is also generally discouraged, then what you want is ABR instead.
Seraphic
QUOTE (pdq @ Jul 27 2009, 22:14) *
You can specify both the minimum and maximum bitrates for variable bitrate encoding (-b for minimum and -B for maximum), but this is generally discouraged. Let Lame pick the optimum bitrate for each frame.

You can not specify an average bitrate with VBR. If you really want to specify the average bitrate, which is also generally discouraged, then what you want is ABR instead.


Reason why I was looking into those is because I want to use VBR, but have more control then just 0 through 9.
But sounds like it is best to let LAME do its own thing.

So are these the correct tags for ID3?
--tcop "copyright" or maybe --tc "copyright"
--tcom "url" or maybe --tu "url"

CODE
@echo off
rem WinXP CMD file to encode all WAV files in a folder to MP3s via LAME.EXE..
rem Make sure this cmd file resides in the same folder as LAME.EXE.
rem
rem The argument to this cmd file should be the full path to the folder containing the WAV files.

rem Display our arguments..
echo Full Arg: %1
echo Drive: "%~d1"
echo Path: "%~p1"
echo Name: "%~n1"
echo Ext: "%~x1"
rem Change to arg drive and path
%~d1
cd "%1"
cd

rem Encode with Lame..
for %%z in (*.wav) do "%~dp0lame.exe" --preset standard "%%z" "%%~nz.mp3"

pause

:end


And where would I add my script into the above code?
Should it replace "--preset standard"?

lame -V 0 --tt "title" --ta "artist" --tl "album" --ty "year" --tc "comment" --tn "track[/total]" --tg "genre" --ti "file" --tv "id=value" sample.wav sample1.mp3
lvqcl
By the way: "--preset (fast) standard" is "-V 2", and "-V 0" is "--preset (fast) extreme".
And if you want average bitrate to be about 192 kbps, you should use "-V 2".
Seraphic
QUOTE (lvqcl @ Jul 28 2009, 11:09) *
By the way: "--preset (fast) standard" is "-V 2", and "-V 0" is "--preset (fast) extreme".
And if you want average bitrate to be about 192 kbps, you should use "-V 2".


So something like this:

for %%z in (*.wav) do "%~dp0lame.exe" --preset standard "%%z" "%%~nz.mp3"

To this:

for %%z in (*.wav) do "%~dp0lame.exe" --preset (fast) extreme --tt "title" --ta "artist" --tl "album" --ty "year" --tc "comment" --tn "track[/total]" --tg "genre" --ti "file" --tv "id=value" "%%z" "%%~nz.mp3"
kornchild2002
lvqcl was trying to explain to you how -V 2 and -V 0 compared to older Lame command line entries. Stick to using -V values. So use either -V 2 or -V 0, don't use the old --preset (fast) extreme command unless you are using a version of Lame that is older than 3.97.
lvqcl
Seraphic: if you want to get MP3s with (approximate) bitrate ~200 kbps, use
CODE
for %%z in (*.wav) do "%~dp0lame.exe" -V 2 --tt "title" --ta "artist" --tl "album" --ty "year" --tc "comment" --tn "track[/total]" --tg "genre" --ti "file" --tv "id=value" "%%z" "%%~nz.mp3"

With "-V 0" insread of "-V 2" you'll get ~260 kbps.

kornchild2002: thanks. wink.gif
kornchild2002
I hope I didn't overstep my boundaries by speaking for you. I just knew what you were trying to get across with your post.
lvqcl
QUOTE (kornchild2002)
I hope I didn't overstep my boundaries by speaking for you. I just knew what you were trying to get across with your post.

I feel that my english isn't as good, so I don't mind if someone makes things more clear.
Seraphic
QUOTE (lvqcl @ Jul 28 2009, 14:17) *
Seraphic: if you want to get MP3s with (approximate) bitrate ~200 kbps, use
CODE
for %%z in (*.wav) do "%~dp0lame.exe" -V 2 --tt "title" --ta "artist" --tl "album" --ty "year" --tc "comment" --tn "track[/total]" --tg "genre" --ti "file" --tv "id=value" "%%z" "%%~nz.mp3"

With "-V 0" insread of "-V 2" you'll get ~260 kbps.

kornchild2002: thanks. wink.gif


Thanks everyone for your help.
Alright, I'll give the above script a go and see how it goes.
It would seem the batch encoder script was written for an older version of Lame, so hope there are no issues when using it with the newest version.

My last question is in regards to URL and Copyright ID3Tags.
They are not listed on the Lame ID3Tag page. So are these correct then?:
--tcop "copyright" or maybe --tc "copyright"
--tcom "url" or maybe --tu "url"
Seraphic
I had a chance to try the script today and it works really well.
Was able to do a batch encode of over fifty tracks.

Just trying to figure out the correct ID3Tages for Composer, Copyright, and URL.
If anyone knows what they are it would be appreciated if you would post them.

Thanks
[JAZ]
--tv TCOP="Copyright"
--tv TCOM="Composer"


If you want an URL, it may be one of the fields that start with W http://www.id3.org/id3v2.3.0#head-871541c0...72e7b41595b36cc
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-2009 Invision Power Services, Inc.