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: MS DOs lame flac to mp3 command line (Read 21540 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

MS DOs lame flac to mp3 command line

Hi

I have tried this:

C:\flac>lame.exe -V2 -r --noreplaygain -b 320 musikk1.flac musikk1.mp3

this makes musikk1.flac to musikk1.mp3 in 320 kbps with no replaygain
the problem is that musikk1.mp3 only is  white noice... not so fun!

I need to use switch -r for raw, but i'm not shure if flac is raw...

I don't understand...

I use lame v3.98, since v 4 is in alfa and don't work for me in foobar2000.

Anybody who can help me out to make a command line to convert lame to mp3?

Thanks in advance

Lysaar


MS DOs lame flac to mp3 command line

Reply #1
You need to download a LAME compile using libsndfile, to be able to encode flac files directly from the command line.

MS DOs lame flac to mp3 command line

Reply #2
1. Why -V2 and -b320 at the same time?
2. lame is a console program, not MS-DOS one.
3. You have 2 possibilities:
* decode flac to wav, then encode wav to mp3
* download special version of lame: "LAME 3.98.4 using libsndfile"

 

MS DOs lame flac to mp3 command line

Reply #3
Standard builds of LAME don't have a FLAC decoder built in.

You can either use flac.exe in decode mode (-d) and pipe to LAME via stdout, or grab the LAME compile from rarewares.org that uses libsndfile for reading input files and that does have a FLAC decoder.

Also, LAME 3.98.4 works just fine with foobar2000, so if you're already comfortable and familiar with fb2k, that would definitely be the easiest route.

Edit: ECHO, Echo, echo!
"Not sure what the question is, but the answer is probably no."

MS DOs lame flac to mp3 command line

Reply #4
C:\flac>lame.exe -V2 -r --noreplaygain -b 320 musikk1.flac musikk1.mp3


Get rid of the -r switch- FLAC is not raw PCM. Also, why are you using -V2 with -b 320? This make no sense  either get rid of the -b 320 or the -V switch.




MS DOs lame flac to mp3 command line

Reply #5
Standard builds of LAME don't have a FLAC decoder built in.


Thanks, I wasn't aware that the standard Windows build is not linked to libsndfile.

You can either use flac.exe in decode mode (-d) and pipe to LAME via stdout, or grab the LAME compile from rarewares.org that uses libsndfile for reading input files and that does have a FLAC decoder.


You need to use -c for FLAC to output to stdout.

MS DOs lame flac to mp3 command line

Reply #6
Also, why are you using -V2 with -b 320? This make no sense  either get rid of the -b 320 or the -V switch.

I think I have seen mention of this to get 320 kbps files but using the vbr psy model.

MS DOs lame flac to mp3 command line

Reply #7
I think I have seen mention of this to get 320 kbps files but using the vbr psy model.


Ah, thanks- I didn't know this. I haven't used LAME in a long time- my prefer codec is Vorbis.


MS DOs lame flac to mp3 command line

Reply #8
Also, why are you using -V2 with -b 320? This make no sense  either get rid of the -b 320 or the -V switch.

I think I have seen mention of this to get 320 kbps files but using the vbr psy model.

And I would assume that using a model optimized for VBR performs worse when forced to operate with CBR than one optimized for CBR.
It's only audiophile if it's inconvenient.

MS DOs lame flac to mp3 command line

Reply #9
Thanks a lot folks!

I am rebuilding my house, today i do building, not converting :-) I try this LAME 3.98.4 using libsndfile later.

One q: do iunderstand correct that with libsndfile i can do a batch job in MS dos to make mp3's?


Why V2 and 320, because i have tried all types of switches, this was svitches that did enconding, but ony white noice.

I can use foobar, but i like to automate my prosesses.

My idea is to rip to flac. When riping is finished the ripping program starts a "convert_flac_to_mp3.bat" file that goes throug my flac files and then batch convert them to mp3 and put them in my mp3 folder.
maybe I need to use tag.exe to copy tags in this bat file, i dont know yet.

Mp3 i use for gadgets, flac for inhouse stereo.

Lysaar


MS DOs lame flac to mp3 command line

Reply #10
One q: do iunderstand correct that with libsndfile i can do a batch job in MS dos to make mp3's?


With libsndfile you don't need to decode the file with FLAC and pipe it to LAME. So instead of doing:

Code: [Select]
flac -d -c infile | lame -V2 --noreplaygain - outfile

you can just use:

Code: [Select]
lame -V2 --noreplaygain infile outfile


of course you can write a simple bat file to step through all your files.

maybe I need to use tag.exe to copy tags in this bat file, i dont know yet.


If the FLAC files are tagged already, you can use metaflac to get the tags you are interested in and feed them to lame.

MS DOs lame flac to mp3 command line

Reply #11
And I would assume that using a model optimized for VBR performs worse when forced to operate with CBR than one optimized for CBR.

It is not being "forced to operate with CBR". It is still a vbr encoding, just that it is guaranteed to always have the maximum number of bits available to it.

MS DOs lame flac to mp3 command line

Reply #12
hey hey hey

Now i have converted flac to mp3 and sound is good.

Now i need to fiigure out how to make a command line in dos to copy flac tags to my new mp3.

i tried
c:\flac\metaflac musikk1.flac musikk1.mp3

no result...
do i firsthave to read tags into variables end then write variable content into mp3?

Still happy for help!

Lysaar

MS DOs lame flac to mp3 command line

Reply #13
Now i need to fiigure out how to make a command line in dos to copy flac tags to my new mp3.

This is a much larger task than just converting the sound data, I'm afraid.

There is a metaflac switch (write "metaflac --help" and see for yourself) which enables writing all tags to a file or stdout:
Code: [Select]
--export-tags-to=FILE Export tags to a file.  Use '-' for stdout.  Each line
                      will be of the form NAME=VALUE.  Specify
                      --no-utf8-convert if necessary.

Maybe it can be of use.

And in lame there are several switches for writing tags to the MP3 file, even embedded album art (taken from "lame --longhelp"):
Code: [Select]
 ID3 tag options:
    --tt <title>    audio/song title (max 30 chars for version 1 tag)
    --ta <artist>   audio/song artist (max 30 chars for version 1 tag)
    --tl <album>    audio/song album (max 30 chars for version 1 tag)
    --ty <year>     audio/song year of issue (1 to 9999)
    --tc <comment>  user-defined text (max 30 chars for v1 tag, 28 for v1.1)
    --tn <track[/total]>   audio/song track number and (optionally) the total
                           number of tracks on the original recording. (track
                           and total each 1 to 255. just the track number
                           creates v1.1 tag, providing a total forces v2.0).
    --tg <genre>    audio/song genre (name or number in list)
    --ti <file>     audio/song albumArt (jpeg/png/gif file, 128KB max, v2.3)
    --tv <id=value> user-defined frame specified by id and value (v2.3 tag)
 

Having said this, I would also recommend checking out Robin Bowes flac2mp3 script since it seems to do exactly what you want. To run it you need to install (the scripting language) Perl, but that is not so hard. Just follow the instructions on his web page: http://projects.robinbowes.com/flac2mp3/trac . Remember either to give the full path to your lame.exe and flac.exe files in the beginning of the script, or to make sure that the paths are in the environmental variables of your OS.

I have made a modified version which also handles embedded album art. You can find it here: ftp://gnypp45main.dynalias.net/flac2mp3_wPics.zip (This version does work on MSwin as well as *nix systems.)

MS DOs lame flac to mp3 command line

Reply #14
Having said this, I would also recommend checking out Robin Bowes flac2mp3 script since it seems to do exactly what you want.


Another precanned option which does a lot more is "Perl Audio Converter":

http://pacpl.sourceforge.net/

but you need to install Cywin. The only part that doesn't work in Windows is CD ripping/encoding.


MS DOs lame flac to mp3 command line

Reply #15
Having said this, I would also recommend checking out Robin Bowes flac2mp3 script since it seems to do exactly what you want.


Another precanned option which does a lot more is "Perl Audio Converter":

http://pacpl.sourceforge.net/

but you need to install Cywin. The only part that doesn't work in Windows is CD ripping/encoding.


I have seen on their website a MS dos look alike shell. http://pacpl.sourceforge.net/images/pac_console.jpg
and it seems to be possible to convert "any" formats.

I ask agein, since i am no unix guy.
With Cywin installed + Perl Audio converter can i access this script from my MS dos bat file?

Bat file (conseptual):
c:\flac\lame -V2 musikk1.flac musikk1.mp3
c:\flac\"perlscript" musikk1.flac musikk1.mp3

Thanks again


MS DOs lame flac to mp3 command line

Reply #16
I have seen on their website a MS dos look alike shell. http://pacpl.sourceforge.net/images/pac_console.jpg
and it seems to be possible to convert "any" formats.


That is just the perl script running in a Unix shell.

I ask agein, since i am no unix guy.
With Cywin installed + Perl Audio converter can i access this script from my MS dos bat file?


I have no experience with it- I don't use Windows. However, from looking at the Cygwin docs, it looks like it can be done:

Quote
With Cygwin installed, users have access to many standard UNIX utilities. They can be used from one of the provided shells such as bash or from the Windows Command Prompt. Additionally, programmers may write Win32 console or GUI applications that make use of the standard Microsoft Win32 API and/or the Cygwin API. As a result, it is possible to easily port many significant UNIX programs without the need for extensive changes to the source code. This includes configuring and building most of the available GNU software (including the development tools included with the Cygwin distribution).


(emphasis mine)

MS DOs lame flac to mp3 command line

Reply #17
My idea is to rip to flac. When riping is finished the ripping program starts a "convert_flac_to_mp3.bat" file that goes throug my flac files and then batch convert them to mp3 and put them in my mp3 folder.


If you want to do large batch jobs, change the extension from .bat to .cmd. When windows sees a .bat extension, For backward compatibly, it runs in 16bit mode. The .cmd will speed it up considerably.
Glass half full!

MS DOs lame flac to mp3 command line

Reply #18
Quote
When windows sees a .bat extension, For backward compatibly, it runs in 16bit mode. The .cmd will speed it up considerably.


?? Simply not true.

MS DOs lame flac to mp3 command line

Reply #19
@Lysaar: Can you stop talking about MS-DOS, please?! Use the terms command prompt, console, terminal, shell,... but not MS-DOS! MS-DOS is an operating system, and a dead one.

(Yes, it matters. LAME cannot run on MS-DOS since many years ago, but it IS a console program).


In my experience, it still is much more easy to use foobar to do the job, and if not, use something like mediacoder or other batch encoding programs.


MS DOs lame flac to mp3 command line

Reply #21
@ JAZ: Shure, i did this because when i dont explain it like this on other forums i get a lot of linux answers. But thanks, i take this with me :-)
To all of you, thanks so far!

I have almost given up to make a command line bat/cmd file to convert from FLAC to MP3. This because i struggle to copy the tags.

This means that i have to convert to mp3 (use command line, i think it is more easy than foobar)
Then i use FlacSquisher which i found easy.

I cant find if FlacSquisher can use commnd line switches, anybody who knows? Maybe i can do it in registry, i only need path in and out?

I still hope that sombody can contribute to help me further to make a bat/cmd file that loops thrugh my flac files and make tagged mp3's

Lysaar

MS DOs lame flac to mp3 command line

Reply #22
FlacSquisher can use command line switches; you can adjust the encoding options right in the main window (or if you go into Options->Encoding Options, you can adjust the settings graphically).

Can you tell me what command line switches you want to use? I'd love to get any suggestions you might have on how to improve FlacSquisher.

MS DOs lame flac to mp3 command line

Reply #23
FlacSquisher can use command line switches; you can adjust the encoding options right in the main window (or if you go into Options->Encoding Options, you can adjust the settings graphically).

Can you tell me what command line switches you want to use? I'd love to get any suggestions you might have on how to improve FlacSquisher.


I will give you input, but i need some days, heavy work load these days. But shortly mye idea is (conseptual)

Flac files stored on c:\flac\artist\album\*.flac
MP3 converted from flac files into c:\MP3\album\*.mp3

When the convert_to_mp3.cmd is run it scans and compare c:\flac\*.* to see if there is missing mp3 files in c:\mp3\*.*

Start
    copmare: if mp3 is missing then convert the file with lame
and
    copy tags with flacSquisher
else
    goto start and compare next flac
end

so a command line could look like this
c:\FlacSquisher\FlacSquisher.exe -CopyAllTagsFromFlacFile c:\flac\*.* c:\mp3\

I hope you understand.

Lysaar

MS DOs lame flac to mp3 command line

Reply #24
FlacSquisher can't be run from the command-line, but that's essentially how it operates:

1. Scan the Flac directory
2. For each Flac file, check if a corresponding MP3 file exists.
3. If it does exist, do nothing.
4. If it doesn't exist, encode the file, and add tags.