Something caused to damage some of my flac files, and to find out which ones I need to rerip, I would like to get a list containing only the damaged files.
How I do it now: Open a terminal in a directory, and enter: $ flac -t *.flac
The output of good files is something like:
Song1.flac: ok Song2.flac: ok
On some of my old rips I get warnings, but the song seems to be okay:
Song3.flac: WARNING, cannot check MD5 signature since it was unset in the STREAMINFO Song3.flac: ok
But when an error occurs, the messages are something like:
Song4.flac: testing, 73% complete Song4.flac: ERROR while decoding data state = FLAC__STREAM_DECODER_END_OF_STREAM Song5.flac: ERROR while decoding data state = FLAC__STREAM_DECODER_READ_FRAME Song6.flac: ERROR, MD5 signature mismatch Song7.flac: *** Got error code 3:FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM Song7.flac: *** Got error code 0:FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC Song7.flac: ERROR while decoding data state = FLAC__STREAM_DECODER_READ_FRAME The FLAC stream may have been created by a more advanced encoder. Try metaflac --show-vendor-tag Song7.flac If the version number is greater than 1.2.1, this decoder is probably not able to decode the file. If the version number is not, the file may be corrupted, or you may have found a bug. In this case please submit a bug report to http://sourceforge.net/bugs/?func=addbug&group_id=13478 Make sure to use the "Monitor" feature to monitor the bug status.
My question is:
- How can I filter the output to only show files with warnings (output contains WARNING) or errors (output contains ERROR)?
I think it might be doable with grep, but I don't know how to give the output of the flac -t command to grep. With flac -c
- And if that works, how can I check all subdirs at once?
My music collection is sorted into many subdirs and going to every dir and run the command would be laborious.
Bonus points if it could output the path of the corrupt file, not only the name :)