INTERACT FORUM

More => Old Versions => Media Center 13 (Development Ended) => Topic started by: benn600 on March 25, 2009, 01:15:08 pm

Title: Integrity Checkup of FLAC
Post by: benn600 on March 25, 2009, 01:15:08 pm
Is there a way to scan my entire library and look for any FLAC files that may have gotten corrupted somehow some way?  Just something I thought about...don't really have any specific reason for doing so.  Perhaps preventative maintenance.
Title: Re: Integrity Checkup of FLAC
Post by: Listener on March 25, 2009, 11:47:39 pm
You could use the Flac.exe command line program driver by a batch file or a Perl/Python program.

The -t option should work.

http://flac.sourceforge.net/documentation_tools_flac.html

Bill
Title: Re: Integrity Checkup of FLAC
Post by: MrC on March 26, 2009, 01:08:11 am
If you have Cygwin installed:

Code: [Select]
find /path/to/musicfolder -name '*.flac' \( -exec /path/to/flac.exe -t -s  {} \; -o  -ls \)

This will print out a list of files that fail the flac -t test.
Title: Re: Integrity Checkup of FLAC
Post by: hit_ny on March 26, 2009, 02:25:58 am
I'd find a way to work xargs into that statement.

Or you load up memory per file with a call to flac.exe whilst it only takes one call to flac.exe with xargs  :D

iow

with -exec, call flac each time per file

with xargs, call flac once and feed it a list of files.
Title: Re: Integrity Checkup of FLAC
Post by: MrC on March 26, 2009, 06:51:25 pm
The exec call is orders of magnitude less than, and inconsequential relative to, the time required to complete the flac test.

Using xargs would be nice, but you have to get the status of each file, and then conditionally perform some output.  Have any way to do it without invoking (eg. exec'ing) a shell to perform the "flac OR print filename"?
Title: Re: Integrity Checkup of FLAC
Post by: hit_ny on March 27, 2009, 09:03:33 am
Using xargs would be nice, but you have to get the status of each file, and then conditionally perform some output.  Have any way to do it without invoking (eg. exec'ing) a shell to perform the "flac OR print filename"?

Yes and that's required because you have used the -s option

What if you did not, and just piped the output to a txt file and then just grepped for a failure string. This way you also have a record of all files tested.

I had used something similar with mp3s, tho it was just limited to reading tags rather than integrity testing and wherever there was a failure the tool itself would inidcate which file had a problem. When i replaced with xargs i noticed a speedup anywhere from 1-5 times.

What matters in the end is whether it provides any speedup, i have a feeling that in this particular case, as you mentioned with testing times, maybe not :(
Title: Re: Integrity Checkup of FLAC
Post by: Alex B on March 27, 2009, 09:56:49 am
The following should work from inside MC.

1) Disable: Tools > Options > General > Update tags when file info changes (untick)
2) Disable: Tools > Plug-in manager > Input > Flac plugin> Configure > Decode through errors (untick)
3) Select the files to be checked
4) Disable: Tools > Library Tools > Analyze audio > Skip analyzed files (untick)
...and run the analyzer. It will stop if it encounters a decoding error.

The "number one" disables file tagging and thus preserves the last modified timestamps. You may want to keep tagging enabled if the files are not already analyzed.

I tested the procedure by changing a couple of characters inside a flac file with a hex editor. The analyzer stopped in the middle of this file.

This should be able to find any serious errors. It does not find all possible errors if the errors do not affect playback (like minor errors in the FLAC header structure).
Title: Re: Integrity Checkup of FLAC
Post by: MrC on March 27, 2009, 10:13:07 am
The following should work from inside MC.

1) Disable: Tools > Options > General > Update tags when file info changes (untick)
2) Disable: Tools > Plug-in manager > Input > Flac plugin> Configure > Decode through errors (untick)
3) Select the files to be checked
4) Disable: Tools > Library Tools > Analyze audio > Skip analyzed files (untick)
...and run the analyzer. It will stop if it encounters a decoding error.


Ugh.