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

Conrad Parker conrad at metadecks.org
Thu Jun 18 07:12:30 PDT 2009


2009/6/18 Adam Rosi-Kessel <adam at rosi-kessel.org>:
> Ivo Emanuel Gonçalves wrote, on 6/18/2009 6:14 AM:
>>
>> On 6/18/09, Conrad Parker<conrad at metadecks.org>  wrote:
>>>
>>> This sounds like it needs a new tool specifically for fixing broken
>>> Ogg files.
>>
>> I see two solutions:
>>
>> 1) the new vcut which I reckon will fix the problem since it has to
>> split and rebuild the audio in a new Ogg
>
> vcut built today from svn doesn't work here:
>
> Processing: Cutting at 0.000000 seconds
> Page error, continuing
> Header packet corrupt
> Processing failed
>
>> 2) an Hex editor, even if just to check what's wrong in the metadata
>> section
>
> What should I look at with a Hex editor? The oggz dump for an example header
> shows the following -- packetno 1, where the metadata would be, is just
> skipped:
>
> 00:00:00.000: serialno 1225743615, granulepos 0, packetno 0 *** bos: 30
> bytes
>      0000: 0176 6f72 6269 7300 0000 0002 44ac 0000  .vorbis.....D...
>      0010: 0000 0000 006b 0300 0000 0000 b801       .....k........
>
> 00:00:00.416: serialno 1225743615, calc. gpos 18368, packetno 2: 1 byte
>      0000: 00                                       .
>
> 00:00:00.419: serialno 1225743615, calc. gpos 18496, packetno 3: 1 byte
>      0000: 0a
>
> [etc, same through packetno 16]
>
> 00:00:00.460: serialno 1225743615, calc. gpos 20288, packetno 17: 448 bytes
>
> [real data here]

yow, that's pretty badly corrupted, the vorbis codebooks (usually the
third packet) is completely gone. It looks like you'd need to throw
away the first 16 packets, start with fresh headers, and copy in the
rest of the data (packet by packet, or page by page?)

K.


More information about the ogg-dev mailing list