Help converting FLAC/APE files to ALAC on a Mac
Reply #68 – 2014-03-31 19:21:29
Good job smok3 on the script and drag&drop interface. I played with it over the weekend and compared with results that I obtained with a script that I had been working on following this discussion and hints from you and greynol and came with a few questions. (I am using the terminal to call my script and installed ffmpeg and flac with homebrew.) 1. I converted a bunch of flac files with your script and in terminal using the basic ffmpeg -i file.flac -acodec alac out.m4a call and noticed that your script produced significantly larger files, i.e. flacFile=54.7M, your script ALAC=74.7M and basic ffmpeg call ALAC=52.2M. After looking at your script, I noticed that you use the -compression_level 0 option which seems to be the reason of the larger size. Is there a reason why you use it other than for speed of conversion ?? My understanding is that the compression level would only speed up the process, but has no effect on quality. As a matter of fact, after computing the md5 for each of the 3 files, they had the same crc, so we can assume the audio was exactly the same.... right 2. You also use -loglevel warning sorry for my ignorance, but why exactly (I am not challenging you, just curious since I don't know what it does) 3. In my script, I am using metaflac to read the md5 from the flac metadata flacOrigCrc=$(metaflac --show-md5sum "$file.flac") and then compare it with the calculated flac as an additional security to make sure that the flac file is in good shape, and believe it or not, in my 150 test flacs, I found 3 that were corrupted (probably because of moving from a HD to another of HD faults), so I think that this is an important feature !!! Like you, I looked around to find a flac binary but couldn't find one. I guess we will have to figure a way to compile it !!! 4. It is sad that unlike FLAC, the ALAC container doesn't have a metadata tag for the audio md5, so for now, in my script, I write the audio_md5sum in the comment tag, but if somebody knows a way to add custom tags to a m4a file, it would be great to add the checksum under it's own tag. So a very simple check utility could be written to check if the audio part of an ALAC file is corrupted after moving it... I still have some cleanup to do but I will post my script when it is clean !!! (and quite honestly smok3, I am taking some parts of yours that are very well thought !!!)