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: Help converting FLAC/APE files to ALAC on a Mac (Read 38088 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Help converting FLAC/APE files to ALAC on a Mac

Reply #25
I'm just thinking about efficiency and something that is least susceptible to corruption.  The flac is only decoded once in order to convert to alac. 
The alac is decoded once to generate a checksum.  The pcm checksum from the alac encode is compared against the checksum stored in the flac that was created from an entirely different process (when the flac was originally created).

If one can't easily generate an md5 hash of pcm decoded from alac then it's moot, though I find that hard to believe.

IOW, maybe ffmpeg isn't the best tool for the job, but then again, maybe it is if you use a Mac.

Help converting FLAC/APE files to ALAC on a Mac

Reply #26
Your example uses 4 tools to do only a flac2tak conversion, when mine uses a single tool for any possible future multiformat lossless conversion, so what is wrong with ffmpeg? (And mac can run a real shell script natively, not that windows bat mess).

Quote
The pcm checksum from the alac encode is compared against the checksum stored in the flac that was created from an entirely different process (when the flac was originally created).

Right, that could be a valid one.
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Help converting FLAC/APE files to ALAC on a Mac

Reply #27
If it isn't valid then the integrity of the new alac file is the last thing you need to worry about.

Except to ask you how many times is ffmpeg decodes the flac file, I'm really not interested in escalating this into a pissing contest.  Note that I wasn't the one who referred to your code as a mess.

Help converting FLAC/APE files to ALAC on a Mac

Reply #28
Quote
Except to ask you how many times is ffmpeg decodes the flac file

This could be done in single decoding pass (I'd have to read the ffmpeg man for that a bit), right now it does it two times.
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Help converting FLAC/APE files to ALAC on a Mac

Reply #29
It is safest to compare to a checksum generated from a separate pass on data that isn't cached, so why not use the one stored in the file?

I shouldn't have taken your "bat mess" comment personally, I think you were just insulting Windows.

Help converting FLAC/APE files to ALAC on a Mac

Reply #30
Right, lets see if John 31415926 (and possibly other rare OSX users) can make a use of this tool, before any unnecessary complicated future development.

edit: Quick benchmark: Random album (60 min) is transcoded/crc checked in 42 seconds.
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Help converting FLAC/APE files to ALAC on a Mac

Reply #31
I'm probably just being paranoid, though I've fallen victim to a bad stick memory in the past.

FWIW, those pieces of code in my bat that do verification are commented out, but I rely on other methods of verification such as CUETools when appropriate.

Help converting FLAC/APE files to ALAC on a Mac

Reply #32
A few possible catches:

(1) It could be a good idea to check the integrity of the FLAC files in the process yes; does ffmpeg output an error if trying to convert from a FLAC that fails to match its md5sum?
(Of course, one could just take whatever file-pair might in the end turn out suspicious, and do that check to see what the explanation is.)

(2) Does ffmpeg transfer absolutely all tags?
-> are all Vorbis comments transferable to ALAC, and what will ffmpeg do if it encounters ones that are not?

(3) Does ffmpeg split by cuesheet? Does the OP want single-file-plus-cuesheets to be split? (Does iTunes support single-ALAC-plus-cuesheet?) Does ffmpeg generate external cuesheet with the correct references? Does it handle all non-compliances?

(4) Write a log file with the appropriate level of information (several lines per file to tell it is OK is likely not too readable ...)

Help converting FLAC/APE files to ALAC on a Mac

Reply #33
@Porcus
1. No idea, but I can code in metaflac md5sum check as first operation, that is if metaflac is found installed on the system (I can't seem to google out static flac binary).

FFMPEG also has an md5 format (dunno how i didn't see that yesterday), so if the input file is 16bit then the direct check with ffmpeg results is possible, however this will fail with files other than 16 bit, due to ffmpeg internal conversion to raw 16 bit format before md5 calculus (Haven't actually tested this yet).

2. No idea, seems like all the text tags are there in this new ALACs.

3. I will not bother with cue-sheets at all, I will not bother with itunes at all, ect.

4. yes to logging, but no promisses of being nice to look at, maybe like this:

Code: [Select]
ok /path/to/orig1.flac
ok, differs from stored md5 /path/to/orig2.flac
error /path/to/orig3.flac
ok /path/to/orig.ape
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Help converting FLAC/APE files to ALAC on a Mac

Reply #34
that is if metaflac is found installed on the system (I can't seem to google out static flac binary)


You mean, a metaflac binary for OS X? It seems to be part of http://sourceforge.net/projects/flac/files...win-ppc%2Bi386/ .

Help converting FLAC/APE files to ALAC on a Mac

Reply #35
version 2

https://dl.dropboxusercontent.com/u/7953236...ALACcheckV2.zip

changelog;
- does single pass for transcoding and md5 calculation
- will correctly handle highbit flac sources
- enabled APE extension as input (not tested, but should work)
- if you re-drop the files again (and ouput alac files are in place) it should just re-check original vs alac.
- droplet has pretty icon
- simple logging (md5log.txt), example;
Code: [Select]
   OK 3c0fc518b39a2ee434ac08f1620489b3 20. Janis Joplin - Come Back
   OK fc9d7e905d7c9ed6d7de11396d82ce99 19. Janis Joplin - My Own Tears
   OK 378474cfd769756a0e50ac484f501de4 18. Janis Joplin - Time
   OK 19d93fa397521f06f2036604259cb1bb 17. Janis Joplin - Little Girl Blues
   OK 919ef04f5ee86f86bf3cb76587e3e21f 16. Janis Joplin - Get It While You Can
   OK ce617e1c71e84ffff048ea5690cbe6ed 15. Janis Joplin - Trust Me


Shell script is embedded and can be edited (or stolen) directly in place.
(./audioToALACcheckV2.app/Contents/Resources/script)

p.s. Same script should run on linux if you fix the paths to ffmpeg and disable that "shift" at the beginning.
p.s.2. metaflac idea temporarily forgotten, droplet still takes only files as input (no dirs).
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

 

Help converting FLAC/APE files to ALAC on a Mac

Reply #36
Hi smok3,

You're doing all this generous work on my behalf, but you're so far above my league, it would take me days or weeks to be able to implement what you're doing.  I know nothing about scripts, command lines, and all the encode terminology you're using.  I'm at the point where I'm very pleased to have figured out how to set iTunes to encode a CD to AAC.  I'm getting the hang of using XLD, although I still use some of the parameters without understanding what they are ... I just found them recommended somewhere by someone who sounded knowledgeable.  Still don't know what CUE sheets do, although I know to drop them onto the XLD icon to get the ball rolling.  That's about as far as I've gone with these things.

My next step is to look at xACT ... Kees de Visser, one of the posters on this thread, said that it does ALAC and also confirm transcodes. 

I'd love to do something with what you're doing here as it sounds like you're creating something that addresses all my concerns, but you're obviously not a beginner and way ahead of me in my simple understanding of these things.

Help converting FLAC/APE files to ALAC on a Mac

Reply #37
Have you viewed the contents of a cue sheet in a text editor as I suggested?

Have you checked our wiki?
http://wiki.hydrogenaudio.org/index.php?title=Cue_sheet

Help converting FLAC/APE files to ALAC on a Mac

Reply #38
Thanks for that FAQ page on cue sheets, greynol.  Very helpful.  Having just read it, I guess I do know what cue sheets are - since I can see the effect they have when I drop a cue file onto XLD.  A single FLAC file is suddenly broken up into songs with all titles, pregaps, etc ready to go.  I thought there was more to CUEs than that, but they're really pretty straightforward.  Thx again.

Help converting FLAC/APE files to ALAC on a Mac

Reply #39
I'd love to do something with what you're doing here as it sounds like you're creating something that addresses all my concerns, but you're obviously not a beginner and way ahead of me in my simple understanding of these things.

I'am just trying to address the conversion of files with md5 check, specifically ape and flac to alac. As for cue-sheets, one could use another tool to do the splicing before my little dropplet (so I'am completely ignoring them).

It was an interesting learning experience and I found some really nasty default ffmpeg behaviour (with highbit depth stuff) and a way to workaround it.

Quote
You're doing all this generous work on my behalf

Nah, that all goes to my personal glory and I think I anger greynol a bit as well, so that's a plus as well.
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung


Help converting FLAC/APE files to ALAC on a Mac

Reply #41
Well, I was excited about the suggestion for using xAct for Mac to convert FLAC to ALAC with an extra step to confirm the transcode, but it's a no-go.  I downloaded the software and went through it, but xAct doesn't convert to ALAC.  The best it can do is convert to WAV or AIFF and then iTunes can convert that to ALAC.  That much I already had in XLD.

So, right now it seems I have the choice of either using XLD and having no confirmation that the transcodes are identical (ie, no errors were introduced during the lossless transcode) ... or buckling down and seeing if I can make sense of smok3's process that he came up with.  I have no idea if his steps are easy or hard ... I have never used command lines (don't know what they are) nor do I understand most of the terminology he uses.  I'm a pretty basic computer user.

Seems strange to me that converting FLAC to ALAC with a desire to confirm the transcode is not more common among Mac users.  I read about guys doing this conversion everywhere, but everyone seems to feel completely safe immediately deleting their FLACs, simply going on faith that their transcodes came out perfectly.  Hardly a mention anywhere on google about confirming lossless transcodes. 

Maybe I'm just being paranoid?  XLD doesn't make errors ... ever?


Would love to try Foobar2000, but, like I wrote, I have no access to a Windows computer for a project of this scale.

Help converting FLAC/APE files to ALAC on a Mac

Reply #42
...I downloaded the software and went through it, but xAct doesn't convert to ALAC.  The best it can do is convert to WAV or AIFF and then iTunes can convert that to ALAC...


It actually does. Bottom-right corner under the Encode tab. Please note that Apple Lossless and ALAC are one and the same.
The Loudness War is over. Now it's a hopeless occupation.

Help converting FLAC/APE files to ALAC on a Mac

Reply #43
...I downloaded the software and went through it, but xAct doesn't convert to ALAC.  The best it can do is convert to WAV or AIFF and then iTunes can convert that to ALAC...


It actually does. Bottom-right corner under the Encode tab. Please note that Apple Lossless and ALAC are one and the same.


Thank you for replying, Engelsstaub. 

Doop.  There it is.  I was looking at the decode screen and missed the ALAC option on the encode screen.  That, plus I video-googled FLAC to ALAC via xACT and some fellow had put up a video showing how he used xACT to encode to WAV, then to iTunes, then to ALAC.  He's either in the dark (like I was until just now) or the video comes from an old version of xACT that didn't yet have ALAC.

Engelstaub, as long as I have you already helping me ... once I've converted from FLAC to ALAC, can you tell me the steps in xACT to compare the two lossless files so I know no errors were introduced during transcoding?  Or do you know where a tutorial can be found?  (I've looked and found no instructions for this.)  I could probably figure it out with a couple of hours of trial and error, but if you know how to do it, I would greatly appreciate some experienced help.

Help converting FLAC/APE files to ALAC on a Mac

Reply #44
once I've converted from FLAC to ALAC, can you tell me the steps in xACT to compare the two lossless files so I know no errors were introduced during transcoding?

Are you overclocking your PC and worry that it will make computational errors? If not then don't bother comparing the lossless files. Their audio content will be identical.

Help converting FLAC/APE files to ALAC on a Mac

Reply #45
once I've converted from FLAC to ALAC, can you tell me the steps in xACT to compare the two lossless files so I know no errors were introduced during transcoding?

Are you overclocking your PC and worry that it will make computational errors? If not then don't bother comparing the lossless files. Their audio content will be identical.


I don't think I'm doing anything unusual with my Mac, so overclocking is not a concern. 

I read the following post on this forum:

http://www.hydrogenaudio.org/forums//lofiv...%20/t67377.html

If you don't care to read the whole thread, the main portion that I latched onto was:

"I am converting the FLAC files in my music collection to Apple Lossless. Is there any reason why I should keep a copy of the original FLAC files? I couldn't imagine any reason why I should, since no actual data is being lost during the conversion, but maybe there is an element to this I am missing?"

"No, there isn't any reason to keep the original FLAC files. Just make sure that your conversion software verifies your Apple lossless (ALAC) files. There are some errors that can be introduced during the encoding process due to processor load and other issues. These errors are rare but they can happen. That is why you want software that will check the CRC values. It will look at the CRC values of the FLAC files and compare them with the CRC values of the ALAC files. Everything is fine if they all match up."

---


I've gotten as far as learning that xACT does exactly that ... so I'm still hoping someone can give me the steps to do this comparison process so I don't have to learn it from scratch.

So, still looking to compare original FLACs and newly created ALAC files before I delete my originals.

Help converting FLAC/APE files to ALAC on a Mac

Reply #46
I would rank the importance of checking that files have been en/decoded correctly very low compared to the importance of keeping two separate copies of the files. If you wanted to keep both the original FLAC and the transcoded ALAC (on separate media and preferably in separate locations) then that would serve the backup function.

Help converting FLAC/APE files to ALAC on a Mac

Reply #47
Thanks, pdq.  I have no interest in keeping the FLACs. 

What I want is to convert FLAC to ALAC, confirm the ALAC is a perfect match, back the ALAC up to a separate drive, then delete the original FLAC.  I have an enormous number of albums and no interest in buying yet another hard drive (or two) to keep both formats.  (We'd now be up to drive space for original FLACs, drive space for copy ALACs, and drive space for lossy AACs.)  For now, if I can just get everything to ALAC and nothing else, I would be able to use iTunes for playback and not have to fuss with alternate file formats or non-iTunes players any longer.

Apparently confirming a newly created ALAC can be done in xACT. (I'm told it's routinely done in Foobar2000 by Windows users.)  I just want to learn how to use this feature.  If anyone can help, super.  I would really appreciate it.  If not, I'll learn what CRCs, MD5s, and checksums are and start rooting around xACT and see if I can figure it out.

If it's just too time-consuming, I'll give up and save the FLACs as backup.  But I prefer to verify the transcoded ALACs and delete the FLACs entirely. 

Fingers crossed that someone has done this and can pass the steps along to me.

Help converting FLAC/APE files to ALAC on a Mac

Reply #48
...Engelstaub, as long as I have you already helping me ... once I've converted from FLAC to ALAC, can you tell me the steps in xACT to compare the two lossless files so I know no errors were introduced during transcoding?  Or do you know where a tutorial can be found?  (I've looked and found no instructions for this.)  I could probably figure it out with a couple of hours of trial and error, but if you know how to do it, I would greatly appreciate some experienced help.


I actually don't use any verification methods other than use of the AccurateRip database if I'm concerned. (This can be done with your ALAC files even without a cue sheet by using "Open Folder as Disc.")

Never been that concerned about it and have never observed errors IME when transcoding from lossless-to-lossless. I could be mistaken but I'm almost certain xACT or XLD won't decode or encode through errors and would report them when the process is completed.

Really the AR database is the best way to verify any securely-ripped CDs IMO. If you have lossless stuff from web sources like Bandcamp, HDtracks, Qobuz, or other (questionable) places that weren't accurately ripped then it's a bit pointless (again IMO) to worry about bit-for-bit accuracy or whatever. I personally wouldn't. Either the files will play or they won't.

Sorry I can't be more helpful than that.
The Loudness War is over. Now it's a hopeless occupation.

Help converting FLAC/APE files to ALAC on a Mac

Reply #49
Thanks, Englesstaub.

From what little I've learned, it sounds like this idea of confirming ALACs made from FLACs is no minor project.  In my mind, I was picturing something like burning a DVD with Toast.  After Toast burns a DVD it automatically does a comparison between the newly burned disc and the source file and tells you afterward "DVD burn successful".  It doesn't seem like it's that straightforward with comparing the FLACs to ALACs.  Time consuming extra steps could make converting hundreds upon hundreds of FLACs unfeasible. 

Might just have to go on faith, transcode my files, and hope for what you've experienced ... no errors when transcoding lossless-to-lossless.  I guess the few problematic files I might run into (or however many) will be a small price to pay for just getting this finished and getting on with enjoying my music.

Thanks again.