Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt (Read 6573 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Hello. I recently updated to foobar v2.0 beta 12, and now it is telling me that all of the FLACs I encoded around a certain time in 2007 are corrupt. Older versions didn't say this, and it is literally all of the files from this time and not just one, so I don't believe my files have suddenly become corrupt. All of the music plays correctly and the error only pops up at the very end of playback.

Here an example message:
Code: [Select]
File verification error: Corrupted FLAC stream
"F:\music\Anime\Tenchi Muyo!\Tenchi Muyo! English Soundtrack\10 - Tenchi Muyo! Ryo-Ohki's Theme.flac"

The file tag Tool says this:
Code: [Select]
reference libFLAC 1.2.0 20070715

All files were ripped with Exact Audio Copy - likely whichever version was newest in 2007.
If need be I can zip my foobar folder and an example FLAC, though I'd rather not send a FLAC since it's all copyrighted music.

Lastly, if it does turn out that these files have been corrupt this whole time, is there an easy way to re-encode them with a new version of FLAC while keeping them in the same place?

Thank you.
Think millionaire, but with cannons.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #1
Thanks for the bug report.
It would make things a lot simpler for me if you could send a sample of this to me: peter [at] hydrogenaud.io
Microsoft Windows: We can't script here, this is bat country.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #2
New FLAC has become more zealous about errors yes.

Hunch, since you used EAC: ID3 at the end? See the bottom part of this: https://hydrogenaud.io/index.php/topic,123219.0.html
Or if not ... the top part.

If it is ID3 at the end, you cannot extract a part of the audio to check for errors, because the issue would be after the audio. You can open the .flac in a text editor and check the very end of it, if you can make sense out of that. Although I use Notepad++ all the time, EditPad Lite is much faster at bigg files.

Or if you want to just re-encode and see what happens: Try the command-line
flac -F troublesomefile.flac -o newfile.flac
Then dump both files into foobar2000, bitcompare and see that they match, open properties and see that MD5 are the same.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #3
Thanks for the bug report.
It would make things a lot simpler for me if you could send a sample of this to me: peter [at] hydrogenaud.io
I sent a different sample. It's a short but full track I ripped at the same time as all the others. It produces the same error message.
Think millionaire, but with cannons.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #4
Thanks.
Yes, it is ID3 tags. Removal of last 128 bytes makes the error message go away. No actual corruption of FLAC payload.
I'll change foobar2000 behavior to just say what it really is instead of raising a false alarm.
Microsoft Windows: We can't script here, this is bat country.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #5
@Cannonaire and everyone who read my "-F" suggestion, that is not needed and -F incurs an unnecessary risk:
Or if you want to just re-encode and see what happens: Try the command-line
Don't use -F. Not unless you absolutely have to use it, and here there is no need - it turns out that FLAC will not abort on this kind of error. 1.4 (and 1.3) will recompress them and remove the ID3.


I'll change foobar2000 behavior to just say what it really is instead of raising a false alarm.
If you can make foobar2000 identify it, then maybe remove them too - since this probably is going to happen to a lot of EAC rips.
Suggestion: For the "Rewrite file tags" action, possibly with a checkbox under Advanced, or with a popup "these files have ID3, remove that as well?" or whatever.
(Yeah, easy for me to say when it is someone else's workload.)

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #6
I was thinking about removal with 'rewrite file tags', but it's not THAT easy to be 100% sure that 'TAG' at EOF-128 is an ID3 tag not some part of the file. We've had that happen with some other format already.

Would have to figure out where the legitimate EOF of FLAC stream is and look for ID3 tag from there. Maybe for some future fb2k update, not right now.
Microsoft Windows: We can't script here, this is bat country.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #7
After updating to Beta 13 I'm still getting the FLAC messages. Confirmed in 32-bit version with the sample I sent you.
It is perhaps pertinent that I did an in-place update from beta 12 using the portable install (all previous installs were also portable).

Tested with a fresh install, and there was no message. I have no idea what of the myriad possible things could be causing this.
Think millionaire, but with cannons.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #8
I was thinking about removal with 'rewrite file tags', but it's not THAT easy to be 100% sure that 'TAG' at EOF-128 is an ID3 tag not some part of the file. We've had that happen with some other format already.

Would have to figure out where the legitimate EOF of FLAC stream is and look for ID3 tag from there. Maybe for some future fb2k update, not right now.

Good points, unfortunately ... luckily FLAC [usually] has MD5, so at least you got a pretty good indication if (1) "TAG" at appropriate position AND (2) MD5 of all-but-128 matches AND (3) MD5 including the 128 fails.[lobbyist's note]
... I suppose that you have full control over how to avoid passing these data to a re-encoding attempt that by way of --ignore-chunk-sizes could result in those being treated as audio? If no such checks, that would be much worse.


[note] That seems to be another "rewrite stream" akin to what you are doing for MP3s? In which case, lobbying for a pet of mine:
"Optimize file layout + minimize file size" without padding is not a good thing for front-tagged formats - better would be to reclaim padding space with an "Optimize file layout & size" where for front-tagged formats the padding [to be adjusted in Advanced] be rounded up to file size = integer multiple of the standard 4096 file cluster size. Space already wasted.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #9
Please pardon my inexperience, but I don't know anything about how tags work really. Is there something I need to do to make sure my files are correct? And is there any way to do that in an automated way? I have probably over a thousand tracks that will have this error.

Additionally, I'm still getting the error on foobar 2.0 beta 13 with the in-place update. Is there a setting I need to change in order to make the messages stop? If this is unintended behavior, I can zip my install folder if you need it for finding the bug. I am using Portable install.

Thank you!

EDIT
In addition to the previous error message, sometimes I get this instead:
Code: [Select]
File verification warning: Garbage at the end of file (ID3 tag?)
Think millionaire, but with cannons.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #10
What you can do:
* Make sure your backups are up-to-date. Seriously, make sure your backups are up-to-date.
* Recompress using the reference flac encoder/decoder.
* Dump backup and recompressed into foobar2000 and bitcompare.
* Keep the backup in case something weird happens later.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #11
* Recompress using the reference flac encoder/decoder.
Is there an easy way to do this for all of them in-place? It would take me weeks to move/rename everything then move it all back where it belongs after recompression.
Think millionaire, but with cannons.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #12
Yes, flac recompresses in-place using the "-f" switch. And you can traverse directories with a FOR loop.
I suggested a workflow in this topic from this week: https://hydrogenaud.io/index.php/topic,123362 , replies 2 and 6.
If you have already backed up to a different drive, and are willing to run a recompress-in-place-with-overwrite, then you can do something "simpler" than the FOR loop in #6.

Can you handle a command-line?

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #13
I haven't had a chance to try yet. I hurt my neck yesterday.
I've been comfortable with command line in the past, but I don't know how Windows syntax works. I'll look into it after I update my at-home backup. No chance I can update my offsite, unfortunately.
Think millionaire, but with cannons.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #14
The FOR syntax in the good (?) old CMD prompt would like the following:

FOR /r %f IN (*.flac) DO flac -fV -8 "%f"

... under a few assumptions:
* You have to be at the parent folder. Say that is M:\music .
Open a command window, that could lead you to c:\windows\system32 . M: <ret> sends you to M. cd music sends you to music.
(If you don't have any other .flac under M:, you don't have to go to the music directory, you can call it from M:)
* Your default user has to have write access to all the files. If you have them owned by some other user to prevent overwriting ... it will prevent overwriting.
* You need to have the flac executable in your PATH variable. Sounds weird? Instead of messing with the system variable, copy to the same directory (say M: or M:\music) a flac.exe that doesn't need the .dll. Case's compile or Wombat's compile don't need the dll.
* Options used in the flac command: You need the "-f" to overwrite. I used "-8" here assuming you want to encode with -8. If you want heavier compression ... well, options are there. If you are happy with the default, leave out the "-8". The "V" (capital V!") verifies afterwards and is "kinda optional": yeah you want to verify, but flac cannot tell if you have e.g. drive caching, so you should rather bit-compare to your backup afterwards, and if you do that, you don't need the V.
And I assumed that your FLAC files end with .flac and not .fla , but the Windows shell isn't case-sensitive, so .FLAC is OK too.
* None of your filenames are "too long". That is, longer than Windows' usual path character limits. FLAC will omit those which are too long, and you can find them later.

So that command will traverse the subdirectories for files ending with .flac and apply the command. What FLAC then will do to a filename.flac, is to create a temporary filename.flac.tmp,fl-ac+en'c and when done, it will delete filename.flac and rename the temp file. If it fails at renaming the temp file, it will leave it with that ugly name. If your .flac file count (say as reported by foobar2000) is not the same afterwards, that is hopefully the reason. You can search for any such afterwards.

Warnings:
1) don't do this on a hard drive that is so full that it cannot handle a handful of extra files. Have some GB left. (Reason: if the temp files are left, then it will spend the rest, and behaviour at full drive is ... you might get too much to clean up afterwards.)
2) don't have fb2k running and monitoring the folder as you go, because that can prevent flac from deleting the old files and moving the temp files.
3) If you want a .bat file, you have to replace the single percents with %%. The mysterious Gate[way]s.

Geeh I thought I was going to write a nineliner here ...

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #15
Open a command window, that could lead you to c:\windows\system32 . M: <ret> sends you to M. cd music sends you to music.
...or, in Windows Explorer (My Computer), navigate to the parent folder then shift+right_click and select "open command prompt here".
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #16
Yes, but some Windows versions don't offer that. Or they offer only PowerShell.
Actually, PowerShell can be opened, and then give the command
cmd

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #17
Also, it is possible to select all folders and drag-and-drop them into FLAC frontend. All FLAC files from subfolders will also be added into frontend automatically.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #18
When I try to re-encode the files, flac spits out this error:
Code: [Select]
ERROR: input file F:\music\Anime\Nadesico\Martian Successor Nadesico TV OST\10 - I Want To Be Your Number One.flac has an ID3v2 tag
What should I do?
Think millionaire, but with cannons.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #19
What FLAC version? (Command: flac --version )
Care to share the file (or a small one with the same issue)? Filebin or gofile and PM me a link.

 

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #20
I used official FLAC versions for Windows from xiph.org. I tried both the newest version and the oldest version available with a windows executable. I'm guessing I should use an alternate compile? Any recommendations? I might be able to upload something later but I can't at the moment. Also, it seems when I ran the batch file I created it re-encoded every FLAC on my drive (as intended) except the ones that needed it. Big facepalm moment.
Think millionaire, but with cannons.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #21
I used official FLAC versions for Windows from xiph.org.
Apologies if you already knew this, but the latest 1.4.x versions from Xiph require the presence of the libFLAC.dll (included in the download package) in the same directory as flac.exe for things to work.  This is not a requirement for the flac.exe from Case distributed in his Free Encoder Pack.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #22
I used official FLAC versions for Windows from xiph.org.
Apologies if you already knew this, but the latest 1.4.x versions from Xiph require the presence of the libFLAC.dll (included in the download package) in the same directory as flac.exe for things to work.  This is not a requirement for the flac.exe from Case distributed in his Free Encoder Pack.
I was aware of the DLL requirement. I put the FLAC win64 folder in my PATH (I've had to do this previously for other encoders). It ran correctly, but it just gave me an error and wouldn't accept the files with ID3 tags. Thanks! Do you think the encoder from Case might accept the files with ID3 tags?
Think millionaire, but with cannons.

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #23
It seems when I ran the batch file I created it re-encoded every FLAC on my drive (as intended) except the ones that needed it
Didn't you forget -F (not to be confused with -f)?

Re: v2.0 beta 12 says FLAC files encoded in 2007 are corrupt

Reply #24
It seems when I ran the batch file I created it re-encoded every FLAC on my drive (as intended) except the ones that needed it
Didn't you forget -F (not to be confused with -f)?
I don't really know the commands. I just copied the command line from Porcus and made sure to follow their instructions. I thought I wasn't supposed to use -F. What does -F do? I really don't know what I'm doing, which is why I have everything backed up on disconnected drives.
This is the batch file I made:
Code: [Select]
f:
FOR /r %%f IN (*.flac) DO flac -fV -5 "%%f"
pause
It properly re-encoded every FLAC file on the drive except the ones with errors that actually needed to be re-encoded.
Think millionaire, but with cannons.