[Flac] Fixing corrupt flac files

Knut Krause knut.krause at lagom.de
Thu Jan 10 14:01:03 PST 2013


Here you are:

soa2ii at thor /mnt/files/music/Slime/Alle gegen Alle $ metaflac --list 02\ 
Störtebecker.flac 
METADATA block #0
  type: 0 (STREAMINFO)
  is last: false
  length: 34
  minimum blocksize: 4608 samples
  maximum blocksize: 4608 samples
  minimum framesize: 14 bytes
  maximum framesize: 15637 bytes
  sample_rate: 44100 Hz
  channels: 2
  bits-per-sample: 16
  total samples: 5857656
  MD5 signature: eed0112053a62bbe0734502ef9a4b0b0
METADATA block #1
  type: 3 (SEEKTABLE)
  is last: false
  length: 234
  seek points: 13
    point 0: sample_number=0, stream_offset=0, frame_samples=4608
    point 1: sample_number=446976, stream_offset=1314129, frame_samples=4608
    point 2: sample_number=898560, stream_offset=2663921, frame_samples=4608
    point 3: sample_number=1350144, stream_offset=4059085, frame_samples=4608
    point 4: sample_number=1801728, stream_offset=5431315, frame_samples=4608
    point 5: sample_number=2248704, stream_offset=6720588, frame_samples=4608
    point 6: sample_number=2700288, stream_offset=8088365, frame_samples=4608
    point 7: sample_number=3151872, stream_offset=9456245, frame_samples=4608
    point 8: sample_number=3603456, stream_offset=10823115, frame_samples=4608
    point 9: sample_number=4055040, stream_offset=12179598, frame_samples=4608
    point 10: sample_number=4502016, stream_offset=13497513, frame_samples=4608
    point 11: sample_number=4953600, stream_offset=14827454, frame_samples=4608
    point 12: sample_number=5405184, stream_offset=16137500, frame_samples=4608
METADATA block #2
  type: 4 (VORBIS_COMMENT)
  is last: false
  length: 701
  vendor string: reference libFLAC 1.1.2 20050205
  comments: 25
    comment[0]: title=Störtebecker
    comment[1]: releasecountry=DE
    comment[2]: totaldiscs=1
    comment[3]: label=Aggressive Rockproduktionen
    comment[4]: totaltracks=15
    comment[5]: musicbrainz_albumartistid=a0fe06e3-deb7-4ea2-a7de-cc93740fd163
    comment[6]: date=1983
    comment[7]: discnumber=1
    comment[8]: tracktotal=15
    comment[9]: asin=B00000AQ1Q
    comment[10]: albumartistsort=Slime
    comment[11]: originaldate=1983
    comment[12]: artist=Slime
    comment[13]: musicbrainz_albumid=66babc5d-cd05-41ec-b96f-9f48ce56a81f
    comment[14]: releasestatus=official
    comment[15]: albumartist=Slime
    comment[16]: album=Alle gegen Alle
    comment[17]: musicbrainz_artistid=a0fe06e3-deb7-4ea2-a7de-cc93740fd163
    comment[18]: media=CD
    comment[19]: releasetype=album
    comment[20]: disctotal=1
    comment[21]: script=Latn
    comment[22]: musicbrainz_trackid=123617d2-5c5f-4926-91ba-59b9ebcc90fe
    comment[23]: artistsort=Slime
    comment[24]: tracknumber=2
METADATA block #3
  type: 1 (PADDING)
  is last: true
  length: 3559


I'll provide flac -t of the whole album. It looks to me as if there are a lot 
of error types present ;-)

soa2ii at thor /mnt/files/music/Slime/Alle gegen Alle $ flac -t *.flac

flac 1.2.1, Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007  Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

01 Linke Spießer.flac: testing, 94% complete

01 Linke Spießer.flac: ERROR while decoding data
                        state = FLAC__STREAM_DECODER_END_OF_STREAM
02 Störtebecker.flac: testing, 96% complete

02 Störtebecker.flac: ERROR while decoding data
                       state = FLAC__STREAM_DECODER_END_OF_STREAM
03 Untergang.flac: testing, 97% complete

03 Untergang.flac: ERROR while decoding data
                   state = FLAC__STREAM_DECODER_END_OF_STREAM
04 Zu kalt.flac: testing, 98% complete

04 Zu kalt.flac: ERROR while decoding data
                 state = FLAC__STREAM_DECODER_END_OF_STREAM
05 Ihr seid schön.flac: ERROR, MD5 signature mismatch
06 Religion.flac: testing, 99% complete

06 Religion.flac: ERROR while decoding data
                  state = FLAC__STREAM_DECODER_END_OF_STREAM
07 Nazis raus.flac: testing, 96% complete07 Nazis raus.flac: *** Got error code 
1:FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER
07 Nazis raus.flac: *** Got error code 
0:FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC


07 Nazis raus.flac: ERROR while decoding data
                    state = FLAC__STREAM_DECODER_READ_FRAME
08 Sand im Getriebe.flac: testing, 98% complete

08 Sand im Getriebe.flac: ERROR while decoding data
                          state = FLAC__STREAM_DECODER_END_OF_STREAM
09 Alle gegen Alle.flac: testing, 96% complete09 Alle gegen Alle.flac: *** Got 
error code 0:FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC
09 Alle gegen Alle.flac: *** Got error code 
0:FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC


09 Alle gegen Alle.flac: ERROR while decoding data
                         state = FLAC__STREAM_DECODER_READ_FRAME
10 Die Letzten.flac: testing, 98% complete10 Die Letzten.flac: *** Got error 
code 2:FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH


10 Die Letzten.flac: ERROR while decoding data
                     state = FLAC__STREAM_DECODER_READ_FRAME
11 Etikette tötet.flac: testing, 97% complete11 Etikette tötet.flac: *** Got 
error code 0:FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC
11 Etikette tötet.flac: *** Got error code 
0:FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC


11 Etikette tötet.flac: ERROR while decoding data
                         state = FLAC__STREAM_DECODER_READ_FRAME
12 Ich will nicht werden.flac: testing, 99% complete

12 Ich will nicht werden.flac: ERROR while decoding data
                               state = FLAC__STREAM_DECODER_END_OF_STREAM
13 Tod.flac: testing, 96% complete

13 Tod.flac: ERROR while decoding data
             state = FLAC__STREAM_DECODER_END_OF_STREAM
14 Junge Junge.flac: testing, 92% complete

14 Junge Junge.flac: ERROR while decoding data
                     state = FLAC__STREAM_DECODER_END_OF_STREAM
15 Guter Rat ist teuer.flac: testing, 97% complete

15 Guter Rat ist teuer.flac: ERROR while decoding data
                             state = FLAC__STREAM_DECODER_END_OF_STREAM


I wrote a little script checking my whole collection for corrupt files using 

flac -wst "$1" 2>/dev/null || printf '%3d %s\n' "$?" "$1"

in a little find/bash script. I can run batch checks and provide output as 
needed :-)

regards


Knut


Am Donnerstag, 10. Januar 2013, 22:44:14 schrieb Martijn van Beurden:
> On 10-01-13 20:50, Knut Krause wrote:
> > 02 Störtebecker.flac: ERROR while decoding data
> > 
> >                         state = FLAC__STREAM_DECODER_END_OF_STREAM
> > 
> > 02 Störtebecker.flac: ERROR, MD5 signature mismatch
> 
> Ah, you didn't mention that last one, MD5 mismatch, in your first mail.
> 
> > The tail of the corrupted file: http://lagom.de/tmp/tail.flac
> 
> I haven't been able to pinpoint the cause of this error, (I'm able to
> reproduce it) but it certainly is no tagging issue, which I thought at
> first, so a corruption seems the cause.  However, corruption happening
> with a lot of files, all in the last few percent, that cannot be
> coincidence. I'm definitely going to look into this, probably tomorrow
> or somewhere this weekend, as trying to decode the file "by hand" to
> find the error takes a lot of time.
> 
> Could you please send me the output of metaflac --list as well, in
> particular the vendor string from the VORBIS_COMMENT block, I'm curious
> which encoder produced this.
> _______________________________________________
> Flac mailing list
> Flac at xiph.org
> http://lists.xiph.org/mailman/listinfo/flac


More information about the Flac mailing list