[ogg-dev] Decoding setup header

Adam Rosi-Kessel adam at rosi-kessel.org
Fri Jul 17 20:03:34 PDT 2009


On Sat, Jul 18, 2009 at 10:23:21AM +0900, Conrad Parker wrote:
> 2009/7/18 Adam Rosi-Kessel <adam at rosi-kessel.org>:
> > On Fri, Jul 17, 2009 at 12:48:27PM -0700, Ralph Giles wrote:
> >> > In my ongoing quest to restore corrupted ogg files, I'm trying to find
> >> > an easy way to identify the setup header without having to actually
> >> > decode it. I understand that it starts with [packet_type] = 5 and then
> >> > the string 'vorbis', but is there some way to figure out where it
> >> > terminates without actually decoding the bits?
> >> No. The first header is fixed length the second two are variable. It
> >> should be immediately followed by a new page header though; if there's
> >> no corruption you could try that.
> >
> > In other words, everything in between ^Evorbis and OggS is the setup
> > header?
> no, you can't just rip the bytes out because the setup header may be
> split across two pages.

Great! I think this was the key missing piece of my attempted fix. It is
a complete and terrible hack, but I think it will actually generalize
fairly well as a tool to recover an ogg vorbis file with header packet
corruption so long as the setup header is intact.

Adam


More information about the ogg-dev mailing list