View Full Version : Looking for a command line wma to mp3 converter
gmoniey
3rd October 2007, 18:37
I have searched much of google, and installed many a program, but I have yet to find an application which will allows me to convert my wma's to mp3's through the command line without loading the GUI.
I have found a few which will take command line arguments, but they all seem to load the GUI and start processing. I am trying to integrate this conversion process into a small script, and i would rather not have the GUI show up.
Does anyone know of any software which will do this? Or better yet, know how to perform the conversion programmatically? (in either ruby or java).
thanks!
Mr_Odwin
5th October 2007, 11:23
You could use a pipe from ffmpeg to lame. For example:
ffmpeg.exe -i 01.wma -vn -f wav - | lame.exe -V 6 - 01.mp3
gmoniey
9th October 2007, 18:25
Hi Mr_Odwin,
sorry for the later response, I have been out of town. I tried what you said on my windows machine, and I ended up with a 500 byte
mp3 file (which obviously doesnt work). Here is the output of the command:
ffmpeg.exe -i 01.wma -vn -f wav - | lame.exe -V 6 - 01.mp3
FFmpeg version SVN-r10464, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-liba52 --enab
le-avisynth --enable-libamr-nb --enable-libamr-wb --enable-libfaac --enable-libfaad --enable-libgsm
--enable-libmp3lame --enable-libnut --enable-libogg --enable-libtheora --enable-libvorbis --enable-l
ibx264 --enable-libxvid --cpu=i686 --enable-memalign-hack --extra-ldflags=-static
libavutil version: 49.5.0
libavcodec version: 51.43.0
libavformat version: 51.12.2
built on Sep 10 2007 10:31:22, gcc: 4.2.1
Input #0, asf, from '01.wma':
Duration: 00:03:46.9, start: 1.579000, bitrate: 193 kb/s
Stream #0.0: Audio: wmav2, 44100 Hz, stereo, 192 kb/s
Output #0, wav, to 'pipe:':
Stream #0.0: Audio: pcm_s16le, 44100 Hz, stereo, 1411 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
LAME version 3.89 MMX (alpha 4, May 30 2001 08:36:29) (http://www.mp3dev.org/)
CPU features: i387, MMX (ASM used), SIMD, SIMD2
Using polyphase lowpass filter, transition band: 15115 Hz - 15648 Hz
Encoding <stdin> to 01.mp3
Encoding as 44.1 kHz VBR(q=6) j-stereo MPEG-1 Layer III (ca. 11x) qval=0
size= 39112kB time=227.0 bitrate=1411.2kbits/s
video:0kB audio:39112kB global headers:0kB muxing overhead 0.000110%
Any ideas? Thanks!
tebasuna51
10th October 2007, 00:04
I tried what you said on my windows machine, and I ended up with a 500 byte mp3 file (which obviously doesnt work).
The method work. Maybe your wma source or your versions of ffmpeg/lame have any problem.
With old ffmpeg version and lame 3.97 work fine for me:
ffmpeg.exe -i High.wma -vn -f wav - | lame.exe -V 6 - 01.mp3
FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-mingw32 --enable-memalign-hack --enable-gpl --enable-a52 --enable-dts --enable-mp3lame
--enable-faac --enable-amr_nb --enable-faad --enable-amr_wb --enable-pp --enable-x264 --enable-xvid --enable-theor
a --enable-libogg --enable-vorbis
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on May 13 2006 18:31:30, gcc: 4.1.0 [Sherpya]
Input #0, asf, from 'High.wma':
Duration: 00:01:33.7, start: 2.600000, bitrate: 64 kb/s
Stream #0.0: Audio: wmav2, 44100 Hz, stereo, 64 kb/s
Output #0, wav, to 'pipe:':
Stream #0.0: Audio: pcm_s16le, 44100 Hz, stereo, 1411 kb/s
Stream mapping:
Stream #0.0 -> #0.0
LAME 3.97 32bits (http://www.mp3dev.org/)
CPU features: MMX (ASM used), SSE (ASM used), SSE2
Using polyphase lowpass filter, transition band: 15115 Hz - 15648 Hz
Encoding <stdin> to 01.mp3
Encoding as 44.1 kHz VBR(q=6) j-stereo MPEG-1 Layer III (ca. 13x) qval=3
size= 16128kB time=93.6 bitrate=1411.2kbits/s
video:0kB audio:16128kB global headers:0kB muxing overhead 0.000266%
gmoniey
10th October 2007, 17:44
Hi,
Is there any chance you could forward me the executable you used?
I don't necessarily care to have the "latest" version, just something that works.
Thanks!
tebasuna51
11th October 2007, 00:39
Is there any chance you could forward me the executable you used?
I don't necessarily care to have the "latest" version, just something that works.
I can recommend download the last stable Lame 3.97 (http://www.rarewares.org/mp3-lame-bundle.php), from rarewares.
I test, after download, ffmpeg SVN-r10464 (http://ffdshow.faireal.net/mirror/ffmpeg/) and work for me without problems.
buzzqw
11th October 2007, 06:55
just remember the lame pipe bug (as in soundout manual explain...)
BHH
tebasuna51
11th October 2007, 11:47
just remember the lame pipe bug (as in soundout manual explain...)
I never get this lame pipe bug. I try with SoundOut, BeHappy/Bepipe/Wavi, ... and with ffmpeg, like in command line show in the thread, without problems.
The bug is only present when send (by stdin pipe) aiff, mp3 or uncompressed audio with non standard wav header (fmt size <> 16), then a fskip() are requested and a fseek() over stdin in Windows system return a error.
With a standard wav header (fmt size = 16), like BeHappy/bepipe/ffmpeg send, and SoundOut/Wavi with correct output selected, the fsikp() is not used and all must be ok.
BTW seems the bug is solved in Lame 3.98b5 (http://lame.cvs.sourceforge.net/lame/lame/frontend/get_audio.c?view=log), also available in rarewares.
gmoniey
11th October 2007, 18:12
it worked!
thank you all very much for your help. It seems that the bit rate jumps around (when i play it in winamp)..from 128 to 160 (i only tested it with 1 file)
but i am sure that there is a command line option for lame to statically define the bit rate. I will find out.
thanks again!
Dark Shikari
11th October 2007, 18:33
it worked!
thank you all very much for your help. It seems that the bit rate jumps around (when i play it in winamp)..from 128 to 160 (i only tested it with 1 file)
but i am sure that there is a command line option for lame to statically define the bit rate. I will find out.
thanks again!
Why do you want to keep the bitrate constant? VBR is generally a good thing.
Sharktooth
11th October 2007, 18:47
it's a good thing if you stay away from avi...
gmoniey
11th October 2007, 19:34
ohh, i wasnt aware it was a good thing. The only reason i thought it should be constant was because all mp3s i have seem to have a constant bitrate...but as long as it sounds, good...its good for me
gmoniey
31st October 2007, 17:59
This thread may be dead...but I have another quick question. I have been trying to write a script in ruby which does this conversion for me, and on the windows platform, the pipe (|) doesnt seem to want to work (it conflict with ruby for some reason)
So I was curious as to how to split this command into 2, with a temporary file.
thanks!
Irakli
31st October 2007, 18:50
ohh, i wasnt aware it was a good thing. The only reason i thought it should be constant was because all mp3s i have seem to have a constant bitrate...but as long as it sounds, good...its good for me
It is indeed a good thing because:
A)Variable bitrate is part of MP3 specs, so all players should be able to play that files.
B)VBR ("-V" swiches in lame 3.97) files almost always have highest possible quality for given filesize.
tebasuna51
31st October 2007, 21:19
This thread may be dead...but I have another quick question. I have been trying to write a script in ruby which does this conversion for me, and on the windows platform, the pipe (|) doesnt seem to want to work (it conflict with ruby for some reason)
So I was curious as to how to split this command into 2, with a temporary file.
Easy:
ffmpeg.exe -i High.wma -vn -f wav temp.wav
lame.exe -V 6 temp.wav 01.mp3
gmoniey
1st November 2007, 00:21
thanks...worked out perfect!
trodas
19th June 2009, 17:06
This thread shoud be sticky in Audio, because the wma decoding problem is terrible and ffmpeg really help.
ffmpeg.exe -i High.wma -vn -f wav temp.wav
Thanks for this solution!
trodas
20th June 2009, 19:03
The only problem arise with wma v3 (audio 0x0162) is not supported ATM. Anyone know what to do to get the audio using some small utility to wav uncompresed? Thanks!
D:\Tools\Lame>ffmpeg.exe -i x.wma -vn -f wav x.wav
FFmpeg version SVN-r16573, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --extra-cflags=-fno-common --enable-memalign-hack --enable-pthr
eads --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-libtheora
--enable-libspeex --enable-libfaac --enable-libgsm --enable-libx264 --enable-lib
schroedinger --enable-avisynth --enable-swscale --enable-gpl
libavutil 49.12. 0 / 49.12. 0
libavcodec 52.10. 0 / 52.10. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libswscale 0. 6. 1 / 0. 6. 1
built on Jan 13 2009 02:57:09, gcc: 4.2.4
Input #0, asf, from 'x.wma':
Duration: 00:10:49.08, start: 3.000000, bitrate: 257 kb/s
Stream #0.0: Audio: 0x0162, 48000 Hz, stereo, s16, 256 kb/s
Output #0, wav, to 'x.wav':
Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Unsupported codec (id=86056) for input stream #0.0
b66pak
20th June 2009, 19:17
use lameXP:
http://forum.doom9.org/showthread.php?t=119749
or BeHappy (with basswma plugin):
http://www.codeplex.com/BeHappy
_
trodas
21st June 2009, 10:26
Oh, thanks a bunch, mate! At first I thought - what the hell to do with some Lame frontend, but hey, it says that I have to download some of the WMD decoder thing and then it decoded wma3 right to wav just nicely! Great!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.