Ogg Vorbis Encoding Script for iTunes

Update: This has been renamed to iTunes Alternative Encoders. Get the new version here.

Lately I’ve been looking for a good way to re-encode my iTunes music files for use in my Zaurus. Since I don’t need to have 256 kbit/s MP3s or Apple Lossless files with those el cheapo headphones, the best way to go is with Vorbis and its excellent properties at 96 kbit/s. Compared with other formats, the quality is pretty nice.
There are already several attempts at creating iTunes scripts to re-encode to Ogg Vorbis or Lame. One of them is Lincoln Ramsay’sEncode with oggenc” iTunes script. It’s pretty neat already. However, it didn’t fully satisfy my special requirements. ;)

So, here is my modified version of his script:

It adds support for all audio filetypes supported by iTunes and Quicktime due to the use of “mov123” by the slimserver project. This includes Apple Lossless, AAC, Audio-CDs and standard MP3! Even audio tracks in video files can be re-encoded to Ogg Vorbis.
It also adds support for structured and flat storage. The “flat” mode writes the output files directly to the destination directory, whereas the “structured” mode writes those encoded files ordered in subdirectories similar to the way iTunes does when it is managing music files. All this can be customised by means of editing some simple options.

Download my script here: iTunesOggVorbisEncoder1.0.zip
Also, you’ll need to install oggenc and mov123:

If you have Fink, just install the package “vorbis-tools” and you’ll get oggenc. Alternatively you can download an older version right here: http://www.illadvised.com/~jordy/ (Note: this is a PPC-only binary)
As for mov123, I have compiled a universal binary (Sourcecode is here). You can download it here. Just copy this binary to /usr/local/bin.

Make sure to edit the options in my script file to point to the right locations of oggenc and mov123.
Now, save the script to your homedirectory ~/Library/iTunes/Scripts and restart your iTunes. The script should now appear in the script menu.

In order to re-encode, just select some files and execute the script. If you select files from your library, these will be encoded and saved in “structured” mode as described above. Files selected in playlists are saved in “flat” mode by default. You can always change the behavior be editing the option “structuredPlaylists” within the script file.

4 thoughts on “Ogg Vorbis Encoding Script for iTunes

  1. This works great. Word of advice, depending on how many apps you have created on your system, the path “/usr/local/bin/” might not exist, you can create the folder “bin” and search for “/usr/local/” and put it in there. Thanks.

  2. Hi, very nice script!!

    But it doesn’t work for me to create automatically the folders Artist:Album:. It uses alwas flat style. What’s wrong?

    Regards, Raphael

  3. Hi Raphael,

    I hope you’ve downloaded the newest version of the script and not the one on this page. You can find the current version here: http://katastrophos.net/andre/blog/software/itunes-encoder-scripts/

    It depends on how you’re using the script.
    Playlists are always encoded in the flat mode. There is a property called “structuredPlaylists” in the AppleScript, that you can change to modify this behavior and define which playlists should be handled in structured mode. By default, files selected from the library are always treated that way.

    Probier das mal aus, ansonsten nochmal eben Bescheid geben. :)
    Deine OnMyCommand-Erweiterung muß ich mir gleich mal anschauen. Sowas fehlt mir auf meinem Mac noch! Cool.

    Schönen Gruß,
    Andre

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.