FFMpeg/libav and SoX don’t output identical WAVs when decoding FLAC/WV, Moved from General Audio (TOS #6) |
![]() ![]() |
FFMpeg/libav and SoX don’t output identical WAVs when decoding FLAC/WV, Moved from General Audio (TOS #6) |
Feb 7 2012, 22:58
Post
#1
|
|
|
Group: Members Posts: 46 Joined: 7-February 12 Member No.: 96993 |
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? |
|
|
|
Feb 7 2012, 23:11
Post
#2
|
|
|
Group: Super Moderator Posts: 4336 Joined: 23-June 06 Member No.: 32180 |
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. |
|
|
|
Feb 7 2012, 23:44
Post
#3
|
|
|
Group: Members Posts: 46 Joined: 7-February 12 Member No.: 96993 |
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 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. |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 21st May 2013 - 09:16 |