Help - Search - Members - Calendar
Full Version: FLAC Discrepancy
Hydrogenaudio Forums > Lossless Audio Compression > FLAC
echo1434
Hello,

I was just about to pretty much stop using wav in favor of FLAC, and I decided to run one final test just to convince myself that FLAC is a perfect format.

I extracted a wav file and converted it to FLAC three different ways:

1) direct rip to FLAC using PlexTools
2) rip to wav, then converted using FLAC Frontend
3) wav (same file as above), converted using dbPowerAMP


This was all done using Level 6. All extraneous info (ID tags, etc.) were stripped and the file sizes compared. To my surprise, they weren't exactly the same. Just a few hundred bytes variance, but if this really is a perfect format shouldn't the end results all be the same (assuming all other variables remain constant)? For example, I can rip a wav file with different programs (even using a different drive), and the file sizes are always EXACTLY the same.

All three FLAC conversions were made from the exact same wav file. I've even experimented a bit further, but I won't bore you with the details. All I know is that different programs seem to be producing slightly different resulsts. Am I missing something here? Can anyone please explain this? Thanks in advance.
krmathis
The three different applications might not use an identical flac encoder/version.
Which might lead to different file sizes for the encoded flac files. This is fine as long as the decoded PCM stream is bit identical to the original!
Saoshyant
As far as I know, FLAC isn't ZIP, but a lossless format. So data is moved around with every single conversion. That means you can't have the same bit output after all the conversion steps you have taken, but though bits are slightly different the audio has remained the same.

If you'd like to run tests, you probably should use tools with peak graphical info and compare diferent and equal samples to check for differences. Ultimately, an ABX test isn't a bad idea either.

edit: beaten by krmathis :|
kalmark
But yes, ABX test is a useless, bad idea, as FLAC is lossless. You know, like in no loss. Like in all FLACs made of the same WAV would be the same (have the same encoded PCM stream).
You could use foobar2000 with its binary compare plugin to compare the encoded PCM data of these files. Or use any other tool capable of a similar binary compare on the decoded PCM streams (not the original FLACs, of course).

edit: Well of course if the binary comparison fails, ABXing might make some sense... But FLAC is mathematically lossless, so this won't happen smile.gif
Maurits
If you want to compare two files with audio-data you should be sure you compare the audio-data and the audio-data only. If you just look at two files from 'the outside' and notice size differences it could be caused by different fileheaders. The audio part would be exactly the same but file sizes would still be different.

I think in comparing wav files it's usually the RIFF headers which could differ.
Cartman_Sr
QUOTE
I think in comparing wav files it's usually the RIFF headers which could differ.


Yes I think this is right. Look here
Cosmo
FLACs contain an internal MD5 checksum of the raw audio data.

It can be checked by command line with "metaflac --show-md5sum",
or the "fingerprint" option with the frontend tool.
pepoluan
QUOTE(Cartman_Sr @ May 26 2006, 00:10) *
QUOTE
I think in comparing wav files it's usually the RIFF headers which could differ.
Yes I think this is right. Look here
How about using the RIFFstrip utility, posted in this thread?

And don't forget to post your thanks to the author (not me!) if you find that useful. smile.gif
spoon
>As far as I know, FLAC isn't ZIP, but a lossless format. So data is moved around with every single conversion

Nope, it is a Zip type compression, where what goes in exactly equals what comes out.

With lossless formats you can only compare the data when converted back to wave, not byte compare on the lossless file itself.

Wave files can have different wave headers, hold the mouse over all the wave files and dbpoweramp will show which type of header there is, each header (waveformat, waveformatex, waveformatextensible) has a few bytes difference in length.
jcoalson
regarding the RIFF data replies: this doesn't have to do with his WAVE file, he's asking why the same WAVE file converted to FLAC with three different programs don't yield identical FLAC files.

the answer is that there are many insignificant reasons they could be different, but they don't need to be exactly the same to be lossless. there's nothing to worry about.

Josh

edit:clarifications
pepoluan
QUOTE(jcoalson @ May 26 2006, 02:33) *
regarding the RIFF data replies: this doesn't have to do with his WAVE file, he's asking why the same WAVE file converted to FLAC with three different programs don't yield identical FLAC files.
Ah, if that's the case, he can verify correctness by decoding the FLACs and comparing the resulting WAVs, right? Or will in this case FLAC generate different RIFF headers?

jcoalson
if all those three use flac.exe then they should decode to the exact same wave file. if not, then it's depends on how each tool writes the WAVE file.

the easiest/fastest way to know is 'metaflac --show-md5sum file1.flac file2.flac file3.flac'; they should all be the same.

Josh
foxyshadis
This also assumes that the drive rips exactly the same sequence of bytes each time (not exactly guaranteed if it's not EAC). If any of the encoding methods used any additional options to change the size, or added tags, then the CRC should still be identical, at least.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.