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: Different Resulting FLACs on Different Computers? (Read 2267 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Different Resulting FLACs on Different Computers?

My question is pretty straightforward:

Can encoding the same WAVE file on 2 different computers (different hardware setups) even using identical command line strings result in different FLAC files?

This seems to be what I'm seeing, and I don't think there is any problem.  I would just like to know if that is correct.

The command line used was:

>> flac --best --replay-gain --cuesheet="file.cue" "file.wav"

FLAC 1.1.4 was used.  FLAC files of differing size were created:

File 1 = 291,359,570 bytes
File 2 = 291,428,007 bytes

A "metaflac" readout indicates the headers are identical except for the SEEKTABLE.  Both tables have the same number of seek points, but the "stream_offset" values are different between the two files.

I am assuming that the encoding algorithms may be able to take advantage of different features between the different hardware sets, resulting in slightly higher compression rate, but I'd like to be sure.

Both FLAC files when decoded will produce the original WAVE, verified by md5sum.


Different Resulting FLACs on Different Computers?

Reply #2
Did you use the same FLAC encoder version for the test?
If not, that could be the cause.
But even if you did, there's still a slim chance that resullts will be different. And that's most likely not due to the FLAC encoder using different format features on different machines.

WAV->FLAC conversion is not injective which means there are many possible FLAC versions for the same WAV file. The encoder is allowed to make some decisions of his own about how exactly to code the signal. Different FLAC files are possible if the encoder strategy differs and/or the calculations with floating point numbers are handled slightly different on the machines used. But there's no need to worry. These calculations are only done to decide between one of many possible ways to encode the data losslessly. So, it's safe.

Cheers!
SG

Different Resulting FLACs on Different Computers?

Reply #3
Thanks for the quick replies.  I had missed that in the FAQ, but that is exactly it.

All WAVE files are identical, just the resulting FLACs were different.  I knew both were valid and functioned properly, and I was just curious as to the difference.

Basically, I am trying to convince a friend to use FLAC, and upon being asked "Is everything here correct?" there was some worry that there was small difference in the files.

Edit:
Quote
Did you use the same FLAC encoder version for the test?

FLAC 1.1.4 was used in both cases.

 

Different Resulting FLACs on Different Computers?

Reply #4
i found that using a build with sse vs one without sse causes different file sizes, for example.

i wouldn't worry as long as the stored md5 sum of the raw audio data is the same. as an additional check, although unncecessary imho, you could decode the flac into a raw file and verify its md5 sum against the one stored in the flac metadata.