Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: apple lossless to flac on a mac (Read 5894 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

apple lossless to flac on a mac

After much searching, I finally determined that there is just no good way to go from apple lossless to FLAC on OS X.  However, I just bought an Infrant NAS, which cannot serve apple lossless files to a squeezebox, but can serve FLAC, so I need to convert 1300 cd's from lossless to flac.  Even worse, I only have enough storage for one library, so I have to do it in place.  So I wrote a tool to do so, preserving tags, etc.

It is a simple python script which parses through the 'iTunes Music Library.xml' file, looking for lossless files, and converting any it finds in place (or not.  It's an option).  It uses ffmpeg to decode the lossless file to wav (although if anyone knows where to find documentation on using quicktime to do that, I'd love to provide the option of using the only officially sanctioned decoder), and it encodes to flac via the command line flac app.  You'll have to brave the source code in order to modify the parameters that are handed to ffmpeg and flac, although it is well documented and should be easy to figure out, even for someone who doesn't know how to program.

Future changes will be to copy any image files from the source directory to the destination, if they are not the same.  That will preserve album art that isn't embedded in files. 

The code does not use any tags embedded in the lossless files themselves.  It grabs them from the XML description of the track, and then inserts them in the flac file.  All file names and directory structures are preserved, except for extension, of course.  IT Does write the intermediate form (.wav) to disk, so you must have room to store a single wav file (equal to the length of the longest track you'll be transcoding).  Currently, it doesn't delete the source lossless file, although it should, at least optionally.

It requires python, ffmpeg, and flac, but should run on any platform for which those tools exist.

It is licensed unde the GPL, which means you can use it how you please, but can't distribute it without keeping it under the GPL and including the source code.

It will be up on sourceforge as soon as those guys fix their interface so that you can create new projects.  It is currently broken.  That's why I am posting it here.  Please, I spent days searching, so hopefully someone else will find this useful, eventually. 

I'd love to hear about it if you wind up using it.

Hmmm...It appears that you cannot provide attachments around here, so here's a link:

alac2flac

apple lossless to flac on a mac

Reply #1
Looks like a useful program. I would very much like to use it but I am struggling with the Python basics. I have managed to get the  program to run OK. It parses the Library.xml file and creates all the appropraite folders but it doesn't convert anything. I assume I don't have ffmpeg and/or flac in the right place or right format. I have been struggling to find an executable of ffmpeg. Any and all help would be greatly appreciated.

I am a better listener than programmer.

Thanks Brian

apple lossless to flac on a mac

Reply #2
After much searching, I finally determined that there is just no good way to go from apple lossless to FLAC on OS X.  However, I just bought an Infrant NAS, which cannot serve apple lossless files to a squeezebox, but can serve FLAC, so I need to convert 1300 cd's from lossless to flac.  Even worse, I only have enough storage for one library, so I have to do it in place.  So I wrote a tool to do so, preserving tags, etc.



What you mean other than using Max (www.sbooth.org)?

apple lossless to flac on a mac

Reply #3
I doubt that max had this feature in January!? Old thread alert. Shame I missed it, seemed like a good project/development/post.

Kristian

 

apple lossless to flac on a mac

Reply #4
If you compile FFmpeg from current SVN, you can do both in 1 step since FFmpeg now has FLAC encoding.  It is not quite as full-featured as the flac reference encoder, but it does the job.

The simplest commandline for this would be:
ffmpeg -i input.m4a output.flac

-Justin