Help - Search - Members - Calendar
Full Version: Bit for bit verification of transcode
Hydrogenaudio Forums > Lossless Audio Compression > Lossless / Other Codecs
Enigman
Hi -

I recently converted my entire library from APE to FLAC, using jRMC. Somehow, a certain number of the FLACs (10%?) now have pops, clicks, or other artifacts in them, which obviously should never have happened with a lossless>lossless conversion.

I'm less concerned with why this happened, and more concerned with verifying the conversion and figuring out which files need to be reconverted (which seems to have done the trick for the few files I tested).

Can anyone recommend a tool which will decompress an APE and FLAC file and run a comparison on them to verify if the conversion was 100% accurate? The trick is going to be matching the FLAC and APE files up, since they are on separate drives right now.

Thanks!!
greynol
Decompress both of them to waves and use fsum.exe or md5sum.exe to create checksums for comparison.
bjackson128
foobar2000 can verify that the audio information in two files is identical. After installing foobar2000, you'll need to go to the additional components page and download the components for Monkey's Audio decoding support and the Binary Comparator.

Then all you need to do is load the songs in foobar, select them both, right click "Utils -> Bit-compare tracks..."

edit: I do it this way because you don't have to decompress to WAV and I like the GUI approach, but now at least you have two options.
Enigman
Is there any easy way to do this for 1000s of files?
Fandango
You want to create a batch file for that, I don't know of any gui program that does this for you. foobar2000 can only compare two files at once and can not for example two directory trees.

In case you have enough disc space, you can decode the 1000 files to wav and use CloneSpy (which isn't developed anymore and likes to skip files).

But writing a batch file that decodes the FLACs and APEs when needed and then compares them via a program like md5sum would be the most effective way.

I would search for batch files that compare two different directory trees (in case your apes and flacs are seperated) and edit it to decompress the audio files to temporary files and then compares the later.
dpaint4
I'm fairly certain it would be faster, and easier to just ditch the faulty transcodes completely and do it again with a modified setup. Do the transcode with Foobar this time, for instance. 1000 files could be an overnight operation, but at least you wouldn't have to sit there and COMPARE the things. And the sofware is already set up to batch.

If you do this be sure to enable artist and album folders so they don't all end up in one massive directory.

As a test, find one bad transcode track and do the transcode again with Foobar or whatever you'd like, and see if it happens again on the same track. If not, do the tanscode with that setup.
audiomars
QUOTE(dpaint4 @ Jun 15 2006, 03:28) *

----snip----
If you do this be sure to enable artist and album folders so they don't all end up in one massive directory.

As a test, find one bad transcode track and do the transcode again with Foobar or whatever you'd like, and see if it happens again on the same track. If not, do the tanscode with that setup.
----snip----


Remember to keep the DSP and Use Replaygain settings uniform for both transcodes or better still, just disable them when transcoding.
disintegrated
QUOTE
Then all you need to do is load the songs in foobar, select them both, right click "Utils -> Bit-compare tracks..."
QUOTE(Enigman @ Jun 14 2006, 23:25) *

Is there any easy way to do this for 1000s of files?


Yes..
Add ape files to a playlist
Add flac files to your playlist
song0001.ape
song0002.ape
song0003.ape
...
song0001.flac
song0002.flac
song0003.flac
...
Select all
Right click and go for Utils -> Bit-Compare tracks

foo_bitcompare should now compare the first half of the selected tracks against the second.
QUOTE
I recently converted my entire library from APE to FLAC, using jRMC. Somehow, a certain number of the FLACs (10%?) now have pops, clicks, or other artifacts in them, which obviously should never have happened with a lossless>lossless conversion.

I'm less concerned with why this happened, and more concerned with verifying the conversion and figuring out which files need to be reconverted (which seems to have done the trick for the few files I tested).

My guess is a faulty .ape decoder and not a problem on flac's side.
I had a similar problem some months ago.
My .ape files occasionally produced unrepeatable CRC-errors while transcoding (foobar warned about this but continued)
producing pops, clicks or even noise until the end of the track.
Transcoding again helped around this (as you figured out yourself too).
Synthetic Soul
How much history does foobar's console hold?

If bitcomparing 1000s of files the results of the initial comparisons may be lost, if the console only holds a few KiB of info.

I don't mean to be the harbinger of doom, but it's better to consider this now than later.

I can't help thinking the suggestion of transcoding all files again is the easiest. Just set it going and forget about it...
bjackson128
Yeah, you should probably just transcode again... I just did a quick test in foobar and it actually took longer to bit-compare the tracks than it did to just transcode from one format to the other.
disintegrated
Huh.. forgot about the console limits.. huh.gif
Is it possible in foobar 0.92 to increase console's history?
Or better: is it possible to redirect console's output to a log file?

QUOTE(Synthetic Soul @ Jun 15 2006, 16:41) *

I can't help thinking the suggestion of transcoding all files again is the easiest. Just set it going and forget about it...
Why do you think that the new set of .flac files will be error free?
Hm.. foobar 0.83 (changed in 0.9??) reports decoding errors in its console.. but doesn't skip (lossless) transcoding when they occur..
Synthetic Soul
QUOTE(disintegrated @ Jun 15 2006, 18:00) *
Why do you think that the new set of .flac files will be error free?
Hm.. foobar 0.83 (changed in 0.9??) reports decoding errors in its console.. but doesn't skip (lossless) transcoding when they occur..
QUOTE(disintegrated @ Jun 15 2006, 15:14) *
My guess is a faulty .ape decoder and not a problem on flac's side.
I had a similar problem some months ago.
My .ape files occasionally produced unrepeatable CRC-errors while transcoding (foobar warned about this but continued)
producing pops, clicks or even noise until the end of the track.
Transcoding again helped around this (as you figured out yourself too).
Well, it worked for you. smile.gif

Obviously I would expect the OP to use another tool, like foobar.



Beleaguered
As an alternative, there's shntool http://shnutils.freeshell.org/shntool/. It has "conv" (convert) and "cmp" (compare) options. You could make a simple batch file to convert and compare files and redirect the output to a text file. I use it all the time for shn>flac conversion and verifying, but it should work for ape>flac too.
Alex B
QUOTE(disintegrated @ Jun 15 2006, 17:14) *
My guess is a faulty .ape decoder and not a problem on flac's side.


I don't think J. River Media Center has any problems with Monkey's Audio decoding. I have used it for years and I have never experienced a problem. Mr. Monkey himself (Matt Ashland) is responsible of the Monkey's Audio code. The JRMC FLAC encoding and decoding plugins are relatively new, but I think the current versions are very reliable. These third-party plugins are made by Scot Thompson and they are available here: http://mcplugins.sourceforge.net/.

The OP mentioned something about an unreliable external HD connection at J. River's support forum, so possibly the reason for this problem is HW oriented.

Since MC uses several custom tags that have different headers in APE v2 tags and Vorbis/FLAC comments I would recommend sticking with MC for transcoding (after the possible HW problem is fixed). Though, it is possible to apply new tags from the database afterwards if the filename paths & extensions are first mass replaced with MC's Find and Replace tool.
pepoluan
Hmmm... if you want you can still use foobar2000 and AutoHotkey. Use AutoHotkey's detection of open windows and output scraping.

You'll have to write up a script for AutoHotkey, though. I currently have neither fb2k nor AutoHotkey, so I can't help you with that currently. Wait until Monday and I think I can give you such a script.

NB: I would appreciate it if you PM me or contact me via email ( pepoluan [at] gmx[dot]net) or IM (Y!M: pepoluan, MSN: pepoluan [at] hotmail [dot] com ) so I know whether to spend the time hacking up such a script smile.gif
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.