Created
June 20, 2015 13:38
-
-
Save dveeden/f7c881e1d38c9abb37f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Converts ogg vorbis to mp3 using gstreamer. | |
# Requires gstreamer-plugins-ugly for the lame mp3 encoding | |
if [ -z $1 ]; then | |
echo "Usage $0 <location>" | |
exit 1 | |
fi | |
location=$1 | |
echo "==> Location: ${location}" | |
find "${location}" -name "*\.ogg" -print0 | while read -d $'\0' oggfile | |
do | |
mp3file=${oggfile:0:-4}.mp3 | |
echo "==> Converting ${oggfile} to ${mp3file}" | |
gst-launch filesrc location=\"${oggfile}\" ! oggdemux ! vorbisdec ! audioconvert ! \ | |
lamemp3enc target=quality quality=2 ! id3v2mux ! filesink location=\"${mp3file}\" \ | |
&& rm "${oggfile}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment