Skip to content

Instantly share code, notes, and snippets.

@rdetert
Created July 15, 2011 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdetert/1084359 to your computer and use it in GitHub Desktop.
Save rdetert/1084359 to your computer and use it in GitHub Desktop.
Want to convert your music files to mp3 because you've had the same CD in your car for 3 years? I thought so.
#!/bin/sh
vlc="/Applications/VLC.app/Contents/MacOS/VLC"
ext="mp3"
dest="/Users/ryan/Desktop/mp3/"
for ARG in "$@"; do
NEWFILE="$dest$(basename "$ARG").$ext"
$vlc -I dummy -vvv "$ARG" --sout "#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100}:std{mux=raw,dst=\"$NEWFILE\",access=file}" vlc://quit
done
# usage: $ ./mp3_convert /path/to/my/music\ files/*.m4a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment