Should Vorbis Encoding be deterministic?

299 Views Asked by At

If I use Vorbis to encode the same audio source file with the same parameters should expect the two output files to be binary identical? Right now it is not for me, but only in a very small percentage of cases.

Are there any special parameters that are required when setting up the encoder to force it to run in a deterministic-mode?

Thanks

1

There are 1 best solutions below

0
On

Yes, but not really. The encoder will usually (always?) be deterministic with the audio data, but may not be deterministic with the metadata and framing. Since Vorbis puts the metadata in the 2nd packet, any changes there will show a binary difference within the first few KB of the file, and could potentially mess with the file's Ogg framing (though that is unlikely).

Your best bet for determining whether the encoder is deterministic is to decode both files and binary-compare the raw audio data for both. If the encoder is deterministic (the decoder pretty much has to be per the spec), they should match exactly.