[ogg-dev] Fixing ogg vorbis corruption caused by bad metadata

Adam Rosi-Kessel adam at rosi-kessel.org
Tue Jul 14 04:55:54 PDT 2009


ogg.k.ogg.k at googlemail.com wrote, on 7/14/2009 7:16 AM:
>> easy to replace. The second packet is the metadata, which we can lose.
>> It's just the third packet that needs to be reconstructed. After that,
>> you could start at any packet division in the rest of the file and it
>> would play fine? So this generic restore tool that I'm positing would
>> just need to try every known codebook set until a valid file was
>> produced? How hard would that be?
> You'd need to renumber and regenerate CRCs. rogg might do all that
> (a set of tools somewhere on svn.xiph.org).
>> What I'm puzzled by, based on the information above, is why my attempted
>> fixes haven't worked: pick a valid ogg vorbis file that I believe was
>> ripped with the same tool around the same time, swap in the first three
>> packets from that file, modify the serial number to match the new file.
>> Thus far this technique hasn't actually fixed any files.
> CRCs ? If they're wrong (and they'd become wrong if you fiddle with the
> serial number without regenerating them), libogg will ignore the page.

Thank you! I'd never heard of rogg. That definitely gets me one step 
closer to a solution. Taking a file where I had substituted the header 
from a good ogg into the "bad" ogg, and then using rogg to fix the crc, 
I now have a playable file. What's odd is it starts out, for about a 
second, as audible and normal, and then the audio is scrambled -- 
perhaps a bitrate issue?

Here's a sample of the result of this process:

http://adam.rosi-kessel.org/bugs/liboggz/484/fixed_with_rogg.ogg

So I think this might just need a little more tweaking to be turned into 
an automated fix script. Any ideas based on that file exactly what is 
wrong and how to correct it?

Adam


More information about the ogg-dev mailing list