Skip to main content

Topic: FFMpeg/libav and SoX don’t output identical WAVs when decoding FLAC/WV (Read 3188 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • 2012
  • [*][*][*]
FFMpeg/libav and SoX don’t output identical WAVs when decoding FLAC/WV
Hello.

I noticed that the result of decoding (lossless) files to WAV is not bit-exact when using ffmpeg/avconv vs. sox.

The difference is very small but It doesn't take place only at the header of the file. xdelta tells me it takes place every 8388608 bytes.

Also, the filesize is different (e.g. 51525310 with avconv and 51525308 with sox).

The result is exactly the same if the source is FLAC or WavPack. So, this is not codec-specific.

Is there an explanation to this? Is one of the tools at fault or the difference is not in audio data?
saldl: A lightweight well-featured CLI downloader optimized for speed and early preview.
https://saldl.github.io

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
FFMpeg/libav and SoX don’t output identical WAVs when decoding FLAC/WV
Reply #1
The difference is very small but It doesn't take place only at the header of the file. xdelta tells me it takes place every 8388608 bytes.

What is the difference?

Are you comparing the actual audio streams or just the entire files (i.e. including frame headers, etc.)?

If the former, do you mean that the decoders produce different streams to one another? What about when they are compared to the original input file? Does either produce an identical stream to that?

Quote
Also, the filesize is different (e.g. 51525310 with avconv and 51525308 with sox).

Again: does either produce an identical file-size to the input WAV?

Sorry, but a lot more information is needed here.

  • 2012
  • [*][*][*]
FFMpeg/libav and SoX don’t output identical WAVs when decoding FLAC/WV
Reply #2
The difference is very small but It doesn't take place only at the header of the file. xdelta tells me it takes place every 8388608 bytes.

What is the difference?

Are you comparing the actual audio streams or just the entire files (i.e. including frame headers, etc.)?


I was comparing the files.

Quote
Quote
Also, the filesize is different (e.g. 51525310 with avconv and 51525308 with sox).

Again: does either produce an identical file-size to the input WAV?



I don't have a source WAV. The sources available to me right now are FLACS and WavPacks.

Quote
If the former, do you mean that the decoders produce different streams to one another? What about when they are compared to the original input file? Does either produce an identical stream to that?


I didn't check this before posting (sorry). The streams are indeed identical.

Running:
Code: [Select]
 avconv -i $wav_file -f u16le $raw_file

gives bit-exact raw files.

And taking any wav file then compressing with wavpack or flac then decoding back to WAV gives the same file per tool (All WAVs decoded using the same tool are bit-exact regardless of the decoder of the input).

So, I guess both tools are doing their job properly.
saldl: A lightweight well-featured CLI downloader optimized for speed and early preview.
https://saldl.github.io