IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
flac to mp3, without gui and without temp wav file
AlexanderTG
post Aug 23 2005, 19:52
Post #1





Group: Members
Posts: 216
Joined: 26-March 05
Member No.: 20965



hi

is it possible to transcode from flac to mp3 without using any of the available gui's and without creating a wave file from the flac file first and then converting that wave file to mp3.

i would like to understand how this can be done (if it can be done).

Ax

edit-----------
basically, what command line could be used to do this? im guessing i would need to make use of the stdin and stdout?

Thanks

This post has been edited by AlexanderTG: Aug 23 2005, 19:59
Go to the top of the page
+Quote Post
Digisurfer
post Aug 23 2005, 20:11
Post #2





Group: Members
Posts: 371
Joined: 10-August 04
From: Canada
Member No.: 16174



foobar2000 0.8.3 (foo_flac 1.0.17) + LAME 3.96.1 works fine for me.

Edit: Yeah I know that means a gui, so what it works. tongue.gif

This post has been edited by Digisurfer: Aug 23 2005, 20:13
Go to the top of the page
+Quote Post
NumLOCK
post Aug 23 2005, 20:11
Post #3


Neutrino G-RSA developer


Group: Developer
Posts: 852
Joined: 8-May 02
From: Geneva
Member No.: 2002



Hi,

At least in linux, you can try something like:
QUOTE
flac -d --stdout myfile.flac | lame -preset standard - myfile.mp3


smile.gif


--------------------
Try Leeloo Chat at http://leeloo.webhop.net
Go to the top of the page
+Quote Post
AlexanderTG
post Aug 23 2005, 20:20
Post #4





Group: Members
Posts: 216
Joined: 26-March 05
Member No.: 20965



does that mean it cant be done in a win32 environment?

how do programs like foobar2000 pass a flac stdout to the lame encoder?

This post has been edited by AlexanderTG: Aug 23 2005, 20:22
Go to the top of the page
+Quote Post
tycho
post Aug 23 2005, 20:28
Post #5





Group: Members
Posts: 345
Joined: 5-August 03
Member No.: 8183



Sure it can be done in a win32 console window (Start | Run | cmd.exe)
Make sure flac.exe and lame.exe are in one of the directories in the %PATH% variable (or specify full path to them):
CODE
C:\> flac.exe -d --stdout myfile.flac | lame.exe --preset fast standard - myfile.mp3
Go to the top of the page
+Quote Post
AlexanderTG
post Aug 23 2005, 20:40
Post #6





Group: Members
Posts: 216
Joined: 26-March 05
Member No.: 20965



cool that works!

so would i be right in saying that you can do the same thing using monkey's flac wavpack etc stdout to mp3 aac ogg mpc ?

would the command lines be the same only differences in the quality setting of the lossy format and the encoder names?
Go to the top of the page
+Quote Post
tycho
post Aug 23 2005, 20:52
Post #7





Group: Members
Posts: 345
Joined: 5-August 03
Member No.: 8183



QUOTE (AlexanderTG @ Aug 23 2005, 11:40 AM)
cool that works!

so would i be right in saying that you can do the same thing using monkey's flac wavpack etc stdout to mp3 aac ogg mpc ?

would the command lines be the same only differences in the quality setting of the lossy format and the encoder names?
*

Yes, but all encoders /decoders has their way to specify stdin/stdout, although most of the time its by giving "-" as file name, or specifying somthing like --stdout as in the flac decoder.
Go to the top of the page
+Quote Post
AlexanderTG
post Aug 23 2005, 21:14
Post #8





Group: Members
Posts: 216
Joined: 26-March 05
Member No.: 20965



thats excellent smile.gif

while the commandline script was running i clicked contro alt delete to bringup the taskbar and noticed there was no lame or flac to be seen. instead i saw this



is this normal? if it is how can i tell which one is lame and which one is flac?
Go to the top of the page
+Quote Post
gfngfgf
post Aug 23 2005, 22:10
Post #9





Group: Members
Posts: 899
Joined: 2-November 04
Member No.: 17951



Just a guess here, but MP3 and FLAC are designed for fast decoding, relatively slow encoding (at least, that's what I think), so the one using more of the CPU is probably LAME. Just a guess.
Go to the top of the page
+Quote Post
snookerdoodle
post Aug 24 2005, 00:13
Post #10





Group: Members
Posts: 120
Joined: 13-May 05
From: Albuquerque
Member No.: 22035



QUOTE (AlexanderTG @ Aug 23 2005, 12:52 PM)
is it possible to transcode from flac to mp3 without using any of the available gui's and without creating a wave file from the flac file first and then converting that wave file to mp3.

QUOTE (tycho @ Aug 23 2005, 01:28 PM)
Sure it can be done in a win32 console window (Start | Run | cmd.exe)
Make sure flac.exe and lame.exe are in one of the directories in the %PATH% variable (or specify full path to them):
CODE
C:\> flac.exe -d --stdout myfile.flac | lame.exe --preset fast standard - myfile.mp3

I'll just add that your mp3's will be missing tags from your flac files if they had them. AFAIK, the only way to get them out is with metaflac...

Mark
Go to the top of the page
+Quote Post
Daffy
post Aug 24 2005, 00:23
Post #11





Group: Members
Posts: 189
Joined: 30-September 01
From: North Carolina
Member No.: 114



Someone asked for something similar out of LamedropXPd a while ago and it never happened, although john33 said "maybe". Perhaps he forgot or felt it wasn't necessary. Would be nice though....yeahright.gif

flac support in lamedropxpd?
Go to the top of the page
+Quote Post
Mr_Rabid_Teddybe...
post Aug 24 2005, 00:46
Post #12





Group: Members
Posts: 1197
Joined: 3-September 03
From: Bergen, Norway
Member No.: 8667



Same commandline a bit shorter:
CODE
flac -dc myfile.flac | lame -V 2 --vbr-new - myfile.mp3

Ofcourse it would have been cool to be able to pass on the tags on commandline. I don't know anyway to do that.

BTW. The Lame options are for new versions. If you use 3.90.3 you shoud use --alt-preset standard or --alt-preset fast standard ofcourse...


--------------------
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
- Oceania Association of Autonomous Astronauts
Go to the top of the page
+Quote Post
DilbyŠ
post Aug 24 2005, 00:59
Post #13





Group: Members
Posts: 48
Joined: 15-July 05
Member No.: 23339



This is what you want, includes windows rightclick menu integration. Only problem is that it doesnt work with filenames with spaces, use Tag&Rename to do a batch rename to relpace spaces with underscores. It even tags the output files.

http://www.hydrogenaudio.org/forums/index....showtopic=27026

The link in the last post at the bottom.
Go to the top of the page
+Quote Post
Klyith
post Aug 24 2005, 01:21
Post #14





Group: Members (Donating)
Posts: 352
Joined: 10-July 04
From: Albany NY USA
Member No.: 15259



Aargh, Dilby, I was just writing a how-to on batch files and right click. I shoulda known that someone here would have already done that. Good thing I previewed or I would have looked silly.

Though I think anticrust's batch file is a bit over-complex... Having to interact with a batch is annoying, as are the limits for file locations. It's much easier just to have several smaller scripts that do one job. I also prefer operating on files, not directories. But the bits for transferring tags are neat, I may have to copy those.
Go to the top of the page
+Quote Post
Mr_Rabid_Teddybe...
post Aug 24 2005, 01:39
Post #15





Group: Members
Posts: 1197
Joined: 3-September 03
From: Bergen, Norway
Member No.: 8667



QUOTE (Klyith @ Aug 23 2005, 04:21 PM)
Though I think anticrust's batch file is a bit over-complex... Having to interact with a batch is annoying, as are the limits for file locations. It's much easier just to have several smaller scripts that do one job. I also prefer operating on files, not directories. But the bits for transferring tags are neat, I may have to copy those.
*

If you make some that differs in various aspects, it would ofcourse be nice if you posted yours for others to look at..... smile.gif


--------------------
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
- Oceania Association of Autonomous Astronauts
Go to the top of the page
+Quote Post
Klyith
post Aug 24 2005, 02:56
Post #16





Group: Members (Donating)
Posts: 352
Joined: 10-July 04
From: Albany NY USA
Member No.: 15259



QUOTE (Mr_Rabid_Teddybear @ Aug 23 2005, 08:39 PM)
If you make some that differs in various aspects, it would ofcourse be nice if you posted yours for others to look at..... smile.gif

I will definitely do so after I figure out how it all works. It uses some code I haven't seen before. Maybe I can use tag.exe to do tags. That might be faster and easier, and it would also be more universal.

Here's what I had written out before. The batch file is ultra simple, but the instructions for binding to file associations may be helpful for people who don't want to use an installer...

You can make a batch file with this:
CODE
[path\]flac.exe -dc %1 | [path\]lame.exe [lame options] - %1.mp3
[pause]
[] = optional. The "pause" will make the command box wait for you to press a key before it closes so you can see what happened. I particularly like that because I use --verbose in the lame options.

Then save the batch file somewhere (if you put it in the same directory as flac.exe and lame.exe you don't need the path. Now you can associate that to a new entry in the right click actions for all flac files.

Then, in and windows folder, open tools -> folder options -> file types. Find & select the entry for flac, and click the "advanced..." button, and then the "new..." button. In the box that pops up, the first text entry is for the name that will be on the right menu. You can call it anything you want, something like "Flac to Mp3" would be good. Then click the "browse" and find your batch file. After you hit ok, you need go to the end of the entry and add " %1". That's space percent one, nothing else. Now hit OK three times.

Now you can right click any flac file and automatically make an mp3 copy. Just be sure to only do one at a time, because if you have multiple files selected and try it they will all go at once instead of one at a time. If you want to do a bunch use something like foobar that can make a queue.
Go to the top of the page
+Quote Post
legg
post Aug 24 2005, 03:10
Post #17





Group: Members
Posts: 175
Joined: 5-March 05
From: Morelia, Mexico
Member No.: 20386



a batch that would convert all flac files in a directory to mp3?

CODE
for %%i in (*.flac) do [path\]flac.exe -dc %%i | [path\]lame.exe [lame options] - %%~ni.mp3
[pause]


BTW, the ~n is meant to remove the .flac extension of the filename, so that myfile.flac be converted to a myfile.mp3 file and not to a myfile.flac.mp3 file.


--------------------
Home page: http://lc.fie.umich.mx/~legg/indexen.php
Go to the top of the page
+Quote Post
Mr_Rabid_Teddybe...
post Aug 24 2005, 03:52
Post #18





Group: Members
Posts: 1197
Joined: 3-September 03
From: Bergen, Norway
Member No.: 8667



QUOTE (legg @ Aug 23 2005, 06:10 PM)
a batch that would convert all flac files in a directory to mp3?

CODE
for %%i in (*.flac) do [path\]flac.exe -dc %%i | [path\]lame.exe [lame options] - %%~ni.mp3
[pause]


BTW, the ~n is meant to remove the .flac extension of the filename, so that myfile.flac be converted to a myfile.mp3 file and not to a myfile.flac.mp3 file.
*

That works. Although not if there are any spaces in filenames. An a bit more aesthetically pleasing version (requires lame.exe and flac.exe in searchpath, e.g. System32) could be like the following. But no tags will still obviously be copied over. For that more advanced scripting will be required.

CODE
@echo off
title flac2mp3
for %%i in (*.flac) do flac.exe -dc %%i | lame.exe -V 2 --vbr-new - %%~ni.mp3
echo.
echo.
echo All done!
echo Hit any key to exit.
pause > nul
exit


--------------------
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
- Oceania Association of Autonomous Astronauts
Go to the top of the page
+Quote Post
legg
post Aug 24 2005, 04:01
Post #19





Group: Members
Posts: 175
Joined: 5-March 05
From: Morelia, Mexico
Member No.: 20386



[quote=Mr_Rabid_Teddybear,Aug 23 2005, 09:52 PM]
CODE
@echo off
title flac2mp3
for %%i in (*.flac) do flac.exe -dc "%%i" | lame.exe -V 2 --vbr-new - "%%~ni.mp3"
echo.
echo.
echo All done!
echo Hit any key to exit.
pause > nul
exit


That should do the trick to include filenames with spaces.


--------------------
Home page: http://lc.fie.umich.mx/~legg/indexen.php
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: 29th July 2014 - 19:17