iTunes Alternative Encoders

What is it?

The iTunes Alternative Encoders pack includes two AppleScripts for iTunes that allow to (re-)encode almost any audio file to either Ogg Vorbis using oggenc or MP3 using LAME.
So, why is it different from similar scripts? It offers 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/MP3.

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 customized by means of editing some simple options in the scripts.
Since version 1.2 compilations are correctly handled too.
Version 1.4 introduced a feature to split up the encoding process into simultaneously running parts, which essentially is a form of multithreading. This means you can take advantage of your dual-core / quad-core / multi-CPU system when encoding large amounts of files. Read below how to configure this.


{iTunesAlternativeEncoders} New items in the iTunes Script menu{iTunesAlternativeEncoders} Settings dialog of the Ogg Vorbis Encoder script{iTunesAlternativeEncoders} Ogg Vorbis encoder just started{iTunesAlternativeEncoders} Ogg Vorbis encoder finished encoding the first track

Download (OS X Universal)

This file includes statically compiled Universal binaries of the aoTuV (beta 5) enhanced version of oggenc and mov123. Both are optimized for G4 and Intel Core. The sourcecodes are available here, here and here.
Due to legal and patent restrictions I can’t supply a compiled universal binary of LAME.
You’ll need to get it from the usual sources: RareWares or Fink


Unzip the zip file via the Finder. Open the extracted folder. Copy the “Utilities” directory along with both scripts to your /Users/{YOU}/Library/iTunes/Scripts directory, where {YOU} is your account name. You may have to create the “Scripts” folder if you don’t have any other iTunes scripts installed.
The universal binaries are located in the subdirectory “Utilities”. By default the scripts will automatically use the binaries in that directory.
If you want to use your own binaries in a different location, make sure to delete the files in the Utilities directory. Alternative you may want to edit the scripts and change the properties oggencCheck, lameCheck, mov123Check to false and specify the real locations of the binaries by setting the properties oggencBase, lameBase, mov123Base.

Configuration & customization

Both scripts are without frills. There isn’t any UI to configure the various options (and there probably will never be).
In order to customize the settings you’ll need to use the AppleScript editor included with OS X. Normally, if you double-click one of the scripts, the system will open it in the script editor.
You should see various properties. Most of them are self-explanatory or carry a short description.
Probably the most important properties are:

property (lame|oggenc)Options = “…”

This property contains the command line options for the encoder.
The following links will show some possible settings:
oggencOptions : oggenc manpage (recommended setting: use -q n ; don’t force a bitrate as this will probably degrade quality.)
lameOptions : LAME manpage | List of recommended LAME settings

property baseDestination : “Volumes:Data:Music:sorted:MobileMP3:” — Encoding Destination

Change this to whereever you want to save your encoded files by default.
For instance if you wanted to save the encoded files somewhere in your home directory, you may use something like this: “Users:{YOU}:Music:Encoded Files:”, where {YOU} is your account name.

property threadCount : 1 — number of “threads” to split the encoding into, use this to take advantage of multiple CPUs / cores

The thread count is set to 1 by default, which will spawn only one encoding process. While this is optimal on single-core single-CPU systems, this doesn’t make perfect use of that multi-core/multi-CPU beast on or under your desk. ;)
For instance change this to 2 if you want to stress your dual-core or dual-CPU system.
Rule of thumb is threadCount = number of CPUs / cores.

Once you’ve changed the properties, save the script.


Version 1.5 (2007-09-22):
+ Fixed some tag encoding issues in the Ogg Vorbis script:
All tags will now be encoded in UTF-8, so Umlauts and other special characters will work okay. (OS X Universal)

Version 1.4 (2007-03-08):
+ support for splitting encoding up into multiple “threads” to take advantage of multiple CPUs / cores
Adjust property threadCount to a value higher than 1 to enable support. Ideally set this to the number of CPUs or cores in your system.
+ faster startup (OS X Universal)

Version 1.3 (2006-11-30):
+ Universal binary of Ogg Vorbis Encoder updated to aoTuV beta 5 (OS X Universal)

Version 1.2 (2006-10-21):
+ made compatible with iTunes 7
+ support for compilations added
+ modified LAME script included
+ optimized universal binaries of mov123 and aoTuV (beta 4.51 / Release 1) enhanced Ogg Vorbis Encoder bundled (OS X Universal)

Version 1.1 (2006-05-15):
+ merged several changes from the original iTunes-LAME script 1.0.4b
+ automatically determines location of oggenc and mov123 (at least it tries to)
+ supports reencoding every media type supported by Quicktime and iTunes
(even audio in video files, Apple Lossless Files and direct ripping from Audio CD)
+ supports flat and structured storage modes:
* flat structure is enabled by default for all playlists except “Library” and “Bibliothek” (Library in german version of iTunes)
– flat structure will directly write encoded output files into the destination directory
* structured storage will write encoded output files into a directory structure defined by the “outdirTemplate” property below.

21 thoughts on “iTunes Alternative Encoders

  1. Hi there, new to macs and keen to use your app, but after working out how to create the scripts folder and install the folder and two files there I got the following error message when i tried to rip a cd. Any simple ideas how to fix this? Completely clueless so far, but would like the option of slightly better audio quality than itunes mp3 encoder.

    LAME was not found. You may need to change the path in the script (the lamebase property) or install LAME.



  2. Hi Pete,

    Thanks for checking out my scripts!
    You’re probably missing the LAME encoder binary, which due to patent restrictions in several countries is not included in the package. However, you may download it seperately. There are some comments above in the download section that give hints where to download it. :)
    Once you’ve got the dmg file, mount it (by doubleclicking it) and copy the executable named “lame” to your Library/iTunes/Scripts/Utilities directory. You should also have “mov123” and “oggenc” in that folder. Those were included with my download.

    I hope this helps.

  3. Hi again. Happily ripping through my cd collection (and avoiding hours of studying) but have noticed that a few tracks playback with either a pause a few secs into the track, or occasionaly some static somewhere. Not quite sure how as the discs seem fine and itunes plays the tracks normally straight from disc. Tried ripping the tracks again and the same ones always have the same problem! Any ideas why this might be happening? using the 3.97 lame version. Also have yet to experiment with trying to change the default locations/lame settings.



  4. never mind – restarted and closed most other apps and it re-ripped those discs fine. Cheers. Will be recommending package as iTunes-LAME doesn’t seem to have a universal binary or support itunes 7.

  5. Hey Pete, good to hear you got the issue resolved. Perhaps it was a problem with your soundcard? I’m using an USB attached soundcard on my Mac Mini and sometimes when running certain apps the driver will switch the soundcard into an invalid mode and I get a lot static and noise in the sound. This mostly happens when the soundcard decides to turn off the digital out and then reattaches it again. Timing problem perhaps, no idea. But from you description it doesn’t sound like it’s a soundcard-related problem.

  6. Hello Andre,

    Thank you very much for your script, it easily allows to encode audio files in vorbis ogg format. I just had some issues finding where to locate the files (you actually have to create a new “Scripts” folder in (user)/Library/iTunes )

    Well, now I can enjoy the cleanliness of iTunes and the audio quality of ogg files (the best codec to my ears)… Your script deserves to get more publicized, because there is nothing else like it on the web.

    Thanks again !

  7. Hi Andre,

    Thanks for updating your script with the latest OggEnc ! Is it possible to simply update the OggEnc file in “your” Utilities folder ? Problem is I don’t know where to find the OggEnc compiled for Mac Os X :)

    The other issue, basically : there is a “server error” when i’m trying to download your zip file.



  8. Hi Xavier, sorry for the server problem, wrong permissions on the file and I didn’t check the download afterwards. So, it’s fixed now. Stupid me!
    You can of course just copy the “oggenc” binary from “Utilities” folder in the ZIP file to the “Utilities” folder in ~/Library/iTunes/Scripts/Utilities.
    – Andre

  9. hi again andre,

    thanks a lot for the quick answer, that’s what I call “involvment” ;-) I just downloaded the file, i’ll try it out later on few of my new CDs.

    I really hope your script will be found by other mac os x users,

    Have a nice day,


  10. Wow!!

    I’ve been looking for an easy way to encode Ogg’s on my mac for many months now and just happened to stumble into this. I’d been using Oggdrop but it seems very out of date (not using the latest and finely tuned versions of the code).

    Thank you, Thank you…….

    This really should be linked on the Xiph site…..


  11. hi again andre,

    finally got round to looking at the options i can change to simplify the encoding process and managed to change the default preset (eliminating a lot of copy/paste action). however i’m not entirely sure how to alter the default destination. what i do at present is (using the set destination option) create a new folder in itunes music for each disk i rip, then add the contents to the library after encoding. Thus itunes sorts out the album/track info and hierarchy. Is there a simple way to automate this process?



  12. Hey Pete, sorry for the late reply!
    Yes, there is a way to automate it:
    Use the AppleScript Editor to set the property useTunesTags to true in the LAME script.
    This will cause the encoded files to be added to your iTunes library. If you’ve set iTunes to manage your music library, it will automatically copy the encoded files from your destination directory right into the managed “iTunes Music” folder. In this case, make sure to clear the destination directory after encoding or you’ll end up having duplicates.
    Hope this helps.

  13. Okay, I had a chance to work a bit on the scripts today.
    I had this idea for a long time, namely taking advantage of more than one CPU in a system. I’ve been manually splitting up the list of files to encode before, and started the encoding for each chunk. However, this wasn’t quite convenient.
    So here it is: A new release with (optional) built-in support for it. No more hassles. Actually it didn’t take long to implement it. ;)
    Hope you like it.

  14. I am having trouble ripping my CDs into the iTunes folder without it using the flat directory instead of structured. What setting am I missing here?

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.