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: Should I keep the original audio checksums of flac files in txt? (Read 417 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Should I keep the original audio checksums of flac files in txt?

Hello, after ripping an Audio CD to FLAC should I use something like below to store the MD5 hashes of the actual audios?:

Code: [Select]
$ metaflac --show-md5sum *.flac > audiosum.txt

I don't mean the MD5 hashes of the files themselves, like the ones generated with a tool like md5sum, but rather the MD5 hashes of the audio content.

So, metaflac outputs those audio MD5 hashes that don't change regardless of how many times the FLAC files are edited in tagging applications. However, I would like to have those MD5 hashes in text files for future comparison.

Do you also store them in text files and put them in each albums folder?
Any suggestion is appreciated. Thank you.

Re: Should I keep the original audio checksums of flac files in txt?

Reply #1
EAC or XLD ripping software does this. Select the proper settings to rip an authentic 1:1 bit-perfect CD copy with cue sheet and log file, along with the checksums. The proper settings are not trivial, they're dependent on your CD drive. For extra cred you can verify your results with the AccurateRip database.

You will find guides for ripping with a simple search. EAC or XLD software accomplishes your goal.

Re: Should I keep the original audio checksums of flac files in txt?

Reply #2
FLAC already has internal MD5s for the audio data, it is one of the few formats which can self detect if it is corrupted.

Re: Should I keep the original audio checksums of flac files in txt?

Reply #3
I'm wondering If I change the content of a FLAC file in terms of audio will that internal MD5 change? or only the newly genereated MD5 will change? In other words, the one shown with $ metaflac show--md5sum is backed in the file and stays like that forever?

I think there are two MD5s, the original one shown by metaflac, I think it's baked right in the file after ripping:

Code: [Select]
$ metaflac show--md5sum *.flac > ffp.txt

as described on:
http://wiki.etree.org/index.php?page=FlacFingerprint

and a new one obtained with ffmpeg:

Code: [Select]
$ ffmpeg -i "$f" -map 0:a -f md5 - 2>/dev/null

The two should match in order to be accurate.
I'm using Linux and do not have access to the tools you guys mentioned above. I'm wondering if there is any Linux tool that can work with these ffp.txt files, I mean to use these "ffp.txt" fingerprint files to do the comparison automatically.

Re: Should I keep the original audio checksums of flac files in txt?

Reply #4
I'm wondering If I change the content of a FLAC file in terms of audio will that internal MD5 change? or only the newly genereated MD5 will change? In other words, the one shown with $ metaflac show--md5sum is backed in the file and stays like that forever?
The MD5 is written into the file and does not change unless you go into the file and hack it. If for example you damage the file at block level, say replacing 4k of the audio by something else - then even if the "new" part is perfectly valid audio, a verifier will see that the audio does not match the MD5, and report error.

However, that assumes that you do not recompres using e.g. flac -f. Because if you do that, a new FLAC file will be written, and with that a new MD5.
High Voltage socket-nose-avatar

Re: Should I keep the original audio checksums of flac files in txt?

Reply #5
In other words, the one shown with $ metaflac show--md5sum is backed in the file and stays like that forever?
The md5 gets generated every time a FLAC file is created. So, if you "recompress" an existing FLAC file (from say -5 to -8), the md5 will be generated again. Or, for example, if you convert the FLAC to WavPack and back to FLAC. If everything goes well and no errors happen, the md5 will always be the same.
If some error happens at some point during those conversions, it's theoretically possible that a different md5 would be generated. Maybe due to some hardware malfunction or some software bug or whatever. I think it's very unlikely (and typically you'd get notified of it), but it's possible. Or, as Porcus said, if the existing file gets altered by an "external force".

So if you're paranoid, you can indeed keep a copy of the original md5. Keeping it in a txt file is one option, but IMO an even better one is keeping it inside the FLAC file itself, but in a completely separate tag. This also lets you compare the two md5 values easily.
I've made a thread about this, if you're interested: https://hydrogenaud.io/index.php?topic=120210.0