RSS LJ

April 21, 2004

ogg→mp3 (, )

by fluffy at 8:45 PM
I know this is total geek sacrilege, but I'm converting (yes, transcoding!) my oggs to mp3. But so far it's okay.

Basically, I've gotten sick of the lack of usable ogg support on OSX (the ogg-qt component is lackluster, slow, and crappy, and doesn't provide track numbers so it can't even be used to listen to whole albums without manually creating a playlist, and for some reason it also doesn't support streaming off a network share), and of course I have a nice iPod arriving on Friday which can't do oggs at all. And really, I don't give a crap about the patents or IP issues, and the whole "ogg is patent-free" stuff is unproven.

Unfortunately, all of my CDs are still packed away for a while, but I decided to do some transcoding tests (source albums were dirty water and Please Let Your Faith and Patience Be Mine by Jeff Fal, various Chopin, and random songs off of Sgt. Pepper's Lonely Hearts Club Band) and, even with intense listening on my best headphones, the mp3s sound no different than the oggs, and are actually a bit smaller.

So, here's the script (which I saved as ogg2mp3):

#!/bin/sh

LAMEOPTS='-b 32 -V 2 -m j'

for src in "$@" ; do
        dest="`dirname $src`/`basename $src .ogg`.mp3"

        artist="`ogginfo $src | grep -i ARTIST= | cut -f2- -d=`"
        album="`ogginfo $src | grep -i ALBUM= | cut -f2- -d=`"
        title="`ogginfo $src | grep -i TITLE= | cut -f2- -d=`"
        track="`ogginfo $src | grep -i TRACKNUMBER= | cut -f2- -d=`"
        year="`ogginfo $src | grep -i YEAR= | cut -f2- -d=`"

        if [ ! -f $dest ] ; then
                nice -19 ogg123 -d wav -f - "$src" | lame $LAMEOPTS - "$dest"
        fi

        echo "Tagging $dest as $artist - $title"
        id3v2 -t "$title" -a "$artist" -A "$album" -T "$track" -y "$year" $dest
done
For best results, run find . -name '*.ogg' | xargs ogg2mp3 and let it churn for a while. (It'll take about 54 hours total on my slow G4/450.)

I did briefly experiment with using iTunes to convert oggs to AAC, but it didn't give enough customizability (no VBR, for example) and I really hate the unconfigurable way that iTunes names its files, especially for various artists compilations (which I have a few of).

So, bye ogg. Pragmatism wins out. Again.

Comments

#2370 big fat idiot 04/22/2004 05:57 am Pragmatism v. Ideology
It seems to me that the drive to have purity of free software on top of a closed operating system is rather, ah, inconsistent. While I do admit that in this case various gradings of free/closed may be important to some, it seems to me that the majority of those would be opting for one of the BSDs that doesn't have a closed system layered on top or one of the Linuxes or FreeDOS, etc.

In either case, I'm happy that the mp3s are working out for you. New toys are fun. Music is fun. New toys that play music are fun squared.
#2371 fluffy 04/22/2004 07:20 am
Heh, good point. I hadn't thought about it that way.