Archive | April 2010

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

  1. Open VLC
  2. File > Streaming/Exporting wizard…
  3. Transcode/Save to file
  4. Next
  5. Choose an input file under “Select a stream” or “Existing playlist item”
  6. Next
  7. Check “Transcode video”
  8. Codec: Dummy
  9. Check “Transcode audio”
  10. Codec: MP3
  11. Bitrate (kb/s): 128
  12. Next
  13. Encapsulation format: RAW
  14. Next
  15. 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.
  16. Next
  17. 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

  1. Open VLC
  2. Media > Convert / Save…
  3. Click [Add…] and select an input file
  4. Click [Convert / Save]
  5. Under “Destination” enter a destination file ending in .mp3
  6. Under “Settings” click the button with alt text “Create a new profile” to the right of the red “X”
  7. Enter a Profile Name (i.e. “MP3 Only”)
  8. On the /Encapsulation\ tab select “RAW”
  9. On the /Audio Codec\ tab check “Audio”
  10. Codec: MP3
  11. Bitrate: 128 kb/s
  12. Channels: 2
  13. Sample Rate: 44100
  14. Click [Save]
  15. Under “Settings” select the profile name from Step 7 (i.e. “MP3 Only”)
  16. Click [Start]

Instructions were written for VLC 1.0.5 “Goldeneye”

Advertisements