Sunday, November 24, 2013

Using VLC to convert audio files or extract audio to mp3

Using VLC to convert in Windows is mostly self guiding, however using the VLC on OSX can get a bit tricky, especially when you only want to convert/extract to an audio file like mp3.

From the VLC File menu select Streaming/Exporting Wizard


A new window will be opened and select Transcode/Save to file



From the next screen select the file you want to have converted and in the final screen select the transcoding options as follows:


(video to dummy and audio transcode to MP3). Next, you have to select the output format, just select RAW.


Finally select the output file. You cannot set it to mp3 and will need to use the raw extension.


Once it is converted, you can rename it from .raw to .mp3

For the advanced users under us you can also use the terminal:

/Applications/ -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

If you want to convert multiple files:

for file in /Users/$USER/Music/*.mp4; do /Applications/ -I dummy "$file" --sout="#transcode{acodec=mp3,vcodec=dummy}:standard{access=file,mux=raw,dst=\"$(echo "$file" | sed 's/\.[^\.]*$/.mp3/')\"}" vlc://quit; done

No comments: