Convert mp4 and flv video to mp3 with VLC
Download VLC at http://www.videolan.org
NOTE – FLV transcoding does not work in version 2.0.4. Make sure you’re using the most recent release.
Mac OS X Terminal
/Applications/VLC.app/Contents/MacOS/VLC -I dummy "/Users/yourname/Music/Input File.mp4" --sout='#transcode{acodec=mp3,vcodec=dummy}:standard{access=file,mux=raw,dst="/Users/yourname/Music/Output File.mp3"}' vlc://quit
Mac OS X Terminal (Multiple Files)
for file in /Users/$USER/Music/*.mp4; do /Applications/VLC.app/Contents/MacOS/VLC -I dummy "$file" --sout="#transcode{acodec=mp3,vcodec=dummy}:standard{access=file,mux=raw,dst=\"$(echo "$file" | sed 's/\.[^\.]*$/.mp3/')\"}" vlc://quit; done
Mac OS X GUI
- Open VLC
- File > Streaming/Exporting wizard…
- Transcode/Save to file
- Next
- Choose an input file under “Select a stream” or “Existing playlist item”
- Next
- Check “Transcode video”
- Codec: Dummy
- Check “Transcode audio”
- Codec: MP3
- Bitrate (kb/s): 128
- Next
- Encapsulation format: RAW
- Next
- Choose a destination file ending in .mp3. Note that if you click Browse, it will force you to use .raw, so choose both .mp3.raw and delete .raw in the input field.
- Next
- Finish
Windows Command Prompt
Change “C:\Input File.flv” and “C:\Output File.mp3”.
"%ProgramFiles%\VideoLAN\VLC\vlc.exe" "C:\Input File.flv" --sout=#transcode{acodec=mp3,vcodec=dummy}:standard{access=file,mux=raw,dst="C:\Output File.mp3"} vlc://quit
Windows Command Prompt (Multiple Files)
Change %USERPROFILE%\Music to the directory containing the files to convert (make sure you keep the \*.* at the end).
for %a in ("%USERPROFILE%\Music\*.*") do "%ProgramFiles%\VideoLAN\VLC\vlc.exe" "%a" --sout=#transcode{acodec=mp3,vcodec=dummy}:standard{access=file,mux=raw,dst="%a.mp3"} --intf=dummy --verbose=2 --play-and-exit
Note that this command will spawn multiple instances of VLC and convert each file in parallel, which can take a lot of CPU. I attempted to fix this using “–one-instance –playlist-enqueue” but the destination file does not get updated. As a workaround, you can throttle the invocations by adding this to the end of the command:
&& choice /T 30 /D y /M "Waiting 30 seconds..."
Windows GUI
- Open VLC
- Media > Convert / Save…
- Click [Add…] and select an input file
- Click [Convert / Save]
- Under “Destination” enter a destination file ending in .mp3
- Under “Settings” click the button with alt text “Create a new profile” to the right of the red “X”
- Enter a Profile Name (i.e. “MP3 Only”)
- On the /Encapsulation\ tab select “RAW”
- On the /Audio Codec\ tab check “Audio”
- Codec: MP3
- Bitrate: 128 kb/s
- Channels: 2
- Sample Rate: 44100
- Click [Save]
- Under “Settings” select the profile name from Step 7 (i.e. “MP3 Only”)
- Click [Start]
Instructions were written for VLC 1.0.5 “Goldeneye”
40 responses to “Convert mp4 and flv video to mp3 with VLC”
Trackbacks / Pingbacks
- July 20, 2012 -
- August 7, 2012 -
- August 16, 2012 -
- February 15, 2013 -
- February 19, 2014 -
- March 1, 2014 -
- March 24, 2015 -
- March 13, 2017 -
Thank you for this! I was able to use your WIndows GUI directions on Windows 7 with no problems.
You’re welcome! Glad it worked.
Done all this to a T…never can get it to actually save…just puts a “streaming” into the player which I have no idea what to do with…
Thanks, Josh
NOTE! – I had the same problem as Josh when using GUI (VLC2.0.3), but was OK with the Command Line, but I eventually found the problem was because I had the ‘Loop’ button set in the GUI. Seems the converter was getting to the end and then going and converting all over again, repeatedly! There seems to be no good reason to ever do this with a conversion, so I might report that as a bug.
*Update*
In VLC I kept getting an .acc file which I could’nt use for the application I needed it for I needed an MP3. So I did some searching and reading on forums and found a freeware application (paid if ya want all the bells and whistles) called AoA Audio Extractor. It worked perfectly the first try and gave me the MP3 I needed and had a very simple straight forward UI. Just thought I let everyone know…
Thanks, Josh
Thanks for putting this up, can say that it works in win 7 with V1.1.4 The Luggage
Noticed that the file length is not reported correctly ie. winamp says that the file is 1.36 min long, but its really 2.50, but it just keeps playing normally anyway.
nice oooooone
Awesome. I’ve been trying to track down encoding details using VLC on a Mac. Thanks!
Glad to hear that it worked for you.
Thanks for the post, keep it up 🙂
How can I attach subs to an .avi with VLC? I know how to watch the movie with subs, but I want to create a new file with the subs attached to it. Thanks!
Worked first time. Brilliant – thanks very much for taking the time to do this.
There is no need to for separate command for x64 just use %programfiles% environment variable. Just use:
“%ProgramFiles%\VideoLAN\VLC\vlc.exe” “C:\Input File.flv” –sout=#transcode{acodec=mp3,vcodec=dummy}:standard{access=file,mux=raw,dst=”C:\Output File.mp3″} vlc://quit
But how can you convert all files in one folder if its possible at all?
Thanks for the %ProgramFiles% variable!
I added instructions for batch converting a folder of files on Windows.
Thanks. It took me awhile to find this, and yours was the only one that worked.
Thanks so much. Just converted a batch of 42 mp4 videos to mp3s in one step!
Thnx man worked for me as well……
Thank you for this, I kept trying to convert with VLC but didn’t know to choose RAW and force to m3. Thanks!
Splendid, worked immediately.
I used the batch processing from commandline for Windows 7.
Only small drawback is if input file is “video.flv”, then output is “video.flv.mp3”
It should be easy to expand the filename with something like %~nI
But on the other hand, it is nice to see where the original file came from.
Keep up the good work.
Wow, that’s awesome! thanks a lot. It works
Besides Grant’s note on the “loop”, I found I was able to change it to do one song at a time of a whole folder by (1) breaking it into two bat files, (2) putting the bat files in the same folder as the movie files, (3) renaming the movie files to names with no spaces etc.
—
mp3tomp4a.bat:
for %%a in (“*.mp4”) do call mp4tomp3b.bat %%a
mp3tomp4b.bat:
“C:\Program Files (x86)\VideoLAN\VLC\vlc.exe” %1 –sout=#transcode{acodec=mp3,vcodec=dummy}:standard{access=file,mux=raw,dst=..\mp3\%1.mp3} –intf=dummy –verbose=2 –play-and-exit
—
I then rename all the files in “..\mp3”
Thanks a ton! Big Help! 🙂
Well does anyone have a problem having some noises
I also have problems with noise in the MP3 after converting (originally from mp4 movie, just want the audio). Sounds like a really dirty MP3 with too much bass. Help please.
How does one specify bitrate to use in the windows command line example? Thanks!
Change
--sout=#transcode{acodec=mp3,vcodec=dummy}
to--sout=#transcode{acodec=mp3,ab=128,vcodec=dummy}
replacing128
with the desired bitrate.Keeps saying that the path cant be find. What could possible be wrong. I copy pste the path its odd
NVM, found the error. Works perfectly =)
Thank you! It worked the same way with VLC 2.0.1 Twoflower on Mac
2014, VLC still cannot convert to audio WITHOUT adding dummy video codec! WOW!!
It sounded crazy to me but it works.
Loved the bit about using the Windows command prompt to start a VLC conversion. I usually recommend using Ffmpeg as described here https://addpipe.com/blog/extract-mp3-from-mp4/ because it works on any OS and even server side (almost all online tools/converters use it)
Hi, it’s 2016, but thank you for the script to convert multiple files.
Just did the batch convert in Mac Terminal. VLC 2.2.4 Works perfectly! Extra useful.