convert WMV video to MP3 audio file via command line

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
johnpank
Blank Cone
Blank Cone
Posts: 14
Joined: 28 Jan 2014 02:18

convert WMV video to MP3 audio file via command line

Postby johnpank » 28 Jan 2014 02:43

I'm tying to use the following command to convert a WMV video to MP3 audio file and it is failing:
vlc -I dummy "f:\tmp\x.wmv" --sout=#transcode{acodec=mp3,vcodec=dummy}:standard{access=file,mux=raw,dst="F:\tmp\x.mp3"}

I found this command online and did not build it myself. It was supposedly working for WMA, AAC, OGG and M4A files. I am trying to convert the WMV file.

When I run it, another command window flashes briefly and disappears and I do not know how to see the error messages.

Can you suggest an alternative? Thanks for any help.

johnpank
Blank Cone
Blank Cone
Posts: 14
Joined: 28 Jan 2014 02:18

Re: convert WMV video to MP3 audio file via command line

Postby johnpank » 28 Jan 2014 23:33

I realize now that the command I was using is only for converting an audio file to another audio format. I found the wiki page on extracting the audio from a video file. I tried this command to just extract the audio, but still with no success:

vlc "f:\tmp\x.wmv" --no-sout-video --sout-audio --no-sout-rtp-sap --no-sout-standard-sap --ttl=1 --sout-keep --sout=#standard{access=file,mux=raw,dst="F:\tmp\xwmv.wma2"}

The WMV file contains a WVC1 video stream and a WMA2 stereo audio stream.

Any ideas on just extracting the audio? I'd prefer a command to convert directly to MP3, but if need be, I would do it in two steps.

bat999
Cone that earned his stripes
Cone that earned his stripes
Posts: 200
Joined: 19 Dec 2007 02:35

Re: convert WMV video to MP3 audio file via command line

Postby bat999 » 29 Jan 2014 18:47

The WMV file contains a WVC1 video stream and a WMA2 stereo audio stream.
Any ideas on just extracting the audio? I'd prefer a command to convert directly to MP3, but if need be, I would do it in two steps.
Hi
To convert to mp3 the command should be something like this:-

Code: Select all

vlc "f:\tmp\x.wmv" -I dummy -vvv --sout="#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux=dummy,dst='F:\tmp\x.mp3'}" vlc://quit
But maybe your version of VLC has been built without an mp3 encoder. :x

If mp3 fails, check that the command converts OK with ogg like this:-

Code: Select all

vlc "f:\tmp\x.wmv" -I dummy -vvv --sout="#transcode{vcodec=none,acodec=vorb,ab=128,channels=2,samplerate=44100}:std{access=file,mux=ogg,dst='F:\tmp\x.ogg'}" vlc://quit
To extract the wma2 audio track, use a command like this:-

Code: Select all

vlc "f:\tmp\x.wmv" -I dummy -vvv --sout="#transcode{vcodec=none}:std{access=file,mux=asf,dst='F:\tmp\x.wma'}" vlc://quit

johnpank
Blank Cone
Blank Cone
Posts: 14
Joined: 28 Jan 2014 02:18

Re: convert WMV video to MP3 audio file via command line

Postby johnpank » 30 Jan 2014 04:52

Thanks a lot, bat999! Your last two commands worked perfectly (to convert to OGG and to extract the WMA).
But the one to convert directly to MP3 did not work. I got the message box "Ooops VLC media player has crashed ...."
I can convert the OGG file directly to MP3 with no problem, using the following command, so I appear to have the right codecs.

Code: Select all

vlc "f:\tmp\x.ogg" --sout=#transcode{acodec=mp3,vcodec=dummy}:standard{access=file,mux=raw,dst="F:\tmp\x.mp3"}
But if I try to use this command to convert the WMA file to MP3, I also get the error "Ooops VLC media player has crashed ...."

I notice that that your command to convert to MP3 has "mux=dummy", whereas the one for OGG has "mux=ogg". Is this correct?

My debugging is made very difficult by the fact that each command that I enter pops up another command prompt to run it, which then disappears quickly when finished. Is there a way to have the VLC command execute in the command prompt window that I am running it in? I can't even see the output of "vlc --help", because of this behavior.

bat999
Cone that earned his stripes
Cone that earned his stripes
Posts: 200
Joined: 19 Dec 2007 02:35

Re: convert WMV video to MP3 audio file via command line

Postby bat999 » 30 Jan 2014 15:50

I notice that that your command to convert to MP3 has "mux=dummy", whereas the one for OGG has "mux=ogg". Is this correct?
Yes :)

If you're going to convert the wmv file to mp3 in 2 jumps, it's better to use wav instead of ogg.
Like this:-

Code: Select all

vlc "f:\tmp\x.wmv" -I dummy -vvv --sout="#transcode{vcodec=none,acodec=s16l,channels=2,samplerate=44100}:std{access=file,mux=wav,dst='F:\tmp\x.wav'}" vlc://quit
Then this:-

Code: Select all

vlc "f:\tmp\x.wav" -I dummy -vvv --sout="#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux=dummy,dst='F:\tmp\x.mp3'}" vlc://quit

johnpank
Blank Cone
Blank Cone
Posts: 14
Joined: 28 Jan 2014 02:18

Re: convert WMV video to MP3 audio file via command line

Postby johnpank » 30 Jan 2014 19:41

Bat999, thanks again! Those commands work just as you have them. It would be nice to have a single step but doing it in two steps is fine.

Edited Correction: I lose all the ID3 tags by converting to WAV in the two steps, so I do need to find out how to go from WMV to MP3 in one step.

senglory
New Cone
New Cone
Posts: 4
Joined: 13 Apr 2023 22:44

Re: convert WMV video to MP3 audio file via command line

Postby senglory » 13 Apr 2023 22:48

To extract the wma2 audio track, use a command like this:-

Code: Select all

vlc "f:\tmp\x.wmv" -I dummy -vvv --sout="#transcode{vcodec=none}:std{access=file,mux=asf,dst='F:\tmp\x.wma'}" vlc://quit

Used this command with "vlc://quit" at the end - VLC just exits and produces a zero-length WMA file. What did I do wrong?

Lotesdelere
Cone Master
Cone Master
Posts: 9787
Joined: 08 Sep 2006 04:39
Location: Europe

Re: convert WMV video to MP3 audio file via command line

Postby Lotesdelere » 14 Apr 2023 09:51

To extract the wma2 audio track, use a command like this:-

Code: Select all

vlc "f:\tmp\x.wmv" -I dummy -vvv --sout="#transcode{vcodec=none}:std{access=file,mux=asf,dst='F:\tmp\x.wma'}" vlc://quit

Used this command with "vlc://quit" at the end - VLC just exits and produces a zero-length WMA file. What did I do wrong?

Looks like you didn't specify any audio codec.

senglory
New Cone
New Cone
Posts: 4
Joined: 13 Apr 2023 22:44

Re: convert WMV video to MP3 audio file via command line

Postby senglory » 14 Apr 2023 10:39



Looks like you didn't specify any audio codec.
Nope, if I use this cmd line

Code: Select all

vlc.exe "GPID.webm" -I dummy -vvv --sout="#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux=dummy,dst='C:\Users\sengl\Videos\GPID.mp3'}"
I get the MP3 file, but VLC still hang in memory for a while instead of quitting after finishing. But if I add vlc://quit, I get the MP3 file of zero size. What should I change in my cmd line to have VLC quitting upon finishing working on this conversion?

Lotesdelere
Cone Master
Cone Master
Posts: 9787
Joined: 08 Sep 2006 04:39
Location: Europe

Re: convert WMV video to MP3 audio file via command line

Postby Lotesdelere » 15 Apr 2023 10:26

mux=raw

senglory
New Cone
New Cone
Posts: 4
Joined: 13 Apr 2023 22:44

Re: convert WMV video to MP3 audio file via command line

Postby senglory » 15 Apr 2023 11:40

mux=raw
Thanks, works like a charm!

senglory
New Cone
New Cone
Posts: 4
Joined: 13 Apr 2023 22:44

Re: convert WMV video to MP3 audio file via command line

Postby senglory » 12 Jul 2023 22:25

I'm getting back with converting to MP3. For most of WebM files my VLC with this command

Code: Select all

vlc.exe "1.webm" -I dummy -vvv --sout="#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux=raw,dst='C:\Users\user\Videos\1.mp3'}" vlc://quit
creates an MP3 file successfully. But from time to time I get a zero-length 1.mp3 file. What should I do to get a correctly converted WMV file here?


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 16 guests