|
List Info
Thread: vorbis global 3 to 1 header mess
|
|
| vorbis global 3 to 1 header mess |

|
2006-07-18 21:10:10 |
Hi
ive looked at the vorbis spec and it seems like its trivial
to split the
3 header packets if they are simply blindly concatenated
the first packet has fixed length
the comment header looks like:
1) [vendor_length] = read an unsigned integer of 32 bits
2) [vendor_string] = read a UTF-8 vector as
[vendor_length] octets
3) [user_comment_list_length] = read an unsigned integer
of 32 bits
4) iterate [user_comment_list_length] times {
5) [length] = read an unsigned integer of 32 bits
6) this iteration's user comment = read a UTF-8
vector as [length] octets
}
7) [framing_bit] = read a single bit as boolean
8) if ( [framing_bit] unset or end-of-packet ) then ERROR
an they all have a "vorbis" in front of them ...
--
Michael GnuPG fingerprint:
9FF2128B147EF6730BADF133611EC787040B0FAB
In the past you could go to a library and read, borrow or
copy any book
Today you'd get arrested for mere telling someone where the
library is
_______________________________________________
NUT-devel mailing list
NUT-devel mplayerhq.hu
http://lists.mplayerhq.hu/mailman/listinfo/nut-devel
|
|
| vorbis global 3 to 1 header mess |

|
2006-07-18 21:19:13 |
Michael Niedermayer wrote:
>
> the comment header looks like:
>
> 1) [vendor_length] = read an unsigned integer of 32
bits
> 2) [vendor_string] = read a UTF-8 vector as
[vendor_length] octets
> 3) [user_comment_list_length] = read an unsigned
integer of 32 bits
> 4) iterate [user_comment_list_length] times {
> 5) [length] = read an unsigned integer of 32
bits
> 6) this iteration's user comment = read a UTF-8
vector as [length] octets
> }
> 7) [framing_bit] = read a single bit as boolean
> 8) if ( [framing_bit] unset or end-of-packet ) then
ERROR
>
> an they all have a "vorbis" in front of
them ...
>
to spare you another read theora is almost the same (but the
initial
byte are different and you have theora instead of vorbis as
string)
lu
--
Luca Barbato
Gentoo/linux Gentoo/PPC
http://dev.gentoo.org/
~lu_zero
_______________________________________________
NUT-devel mailing list
NUT-devel mplayerhq.hu
http://lists.mplayerhq.hu/mailman/listinfo/nut-devel
|
|
| vorbis global 3 to 1 header mess |

|
2006-07-19 04:05:15 |
On Tue, Jul 18, 2006 at 11:10:10PM +0200, Michael
Niedermayer wrote:
> Hi
>
> ive looked at the vorbis spec and it seems like its
trivial to split the
> 3 header packets if they are simply blindly
concatenated
> the first packet has fixed length
>
> the comment header looks like:
>
> 1) [vendor_length] = read an unsigned integer of 32
bits
> 2) [vendor_string] = read a UTF-8 vector as
[vendor_length] octets
> 3) [user_comment_list_length] = read an unsigned
integer of 32 bits
> 4) iterate [user_comment_list_length] times {
> 5) [length] = read an unsigned integer of 32
bits
> 6) this iteration's user comment = read a UTF-8
vector as [length] octets
> }
> 7) [framing_bit] = read a single bit as boolean
> 8) if ( [framing_bit] unset or end-of-packet ) then
ERROR
>
> an they all have a "vorbis" in front of
them ...
excellent, thank you for doing the research to find this.
rich
_______________________________________________
NUT-devel mailing list
NUT-devel mplayerhq.hu
http://lists.mplayerhq.hu/mailman/listinfo/nut-devel
|
|
| vorbis global 3 to 1 header mess |

|
2006-07-19 08:07:28 |
Hi
On Tue, Jul 18, 2006 at 11:10:10PM +0200, Michael
Niedermayer wrote:
> Hi
>
> ive looked at the vorbis spec and it seems like its
trivial to split the
> 3 header packets if they are simply blindly
concatenated
> the first packet has fixed length
>
> the comment header looks like:
>
> 1) [vendor_length] = read an unsigned integer of 32
bits
> 2) [vendor_string] = read a UTF-8 vector as
[vendor_length] octets
> 3) [user_comment_list_length] = read an unsigned
integer of 32 bits
> 4) iterate [user_comment_list_length] times {
> 5) [length] = read an unsigned integer of 32
bits
> 6) this iteration's user comment = read a UTF-8
vector as [length] octets
> }
> 7) [framing_bit] = read a single bit as boolean
> 8) if ( [framing_bit] unset or end-of-packet ) then
ERROR
>
> an they all have a "vorbis" in front of
them ...
how to parse all the vorbis header variants:
1) search for the 1st occurance of
01,'v','o','r','b','i','s'
the found match and the following 23 bytes are the 1st
header packet
2) search for the 1st occurance of
03,'v','o','r','b','i','s' after here
3) read an unsigned integer of 32 bits and skip that many
bytes
4) [user_comment_list_length] = read an unsigned integer
of 32 bits
5) iterate [user_comment_list_length] times {
6) read an unsigned integer of 32 bits and skip that
many bytes
}
7) skip 1 byte
8) the match in 2) and what follows until here is the 2nd
header packet
9) search for the 1st occurance of
05,'v','o','r','b','i','s' after here
the matching part and what follows is the 3rd header
packet
if there are no objections then ill propose this on
vorbis-dev
spelling fixes and other suggestions welcome
[...]
--
Michael GnuPG fingerprint:
9FF2128B147EF6730BADF133611EC787040B0FAB
In the past you could go to a library and read, borrow or
copy any book
Today you'd get arrested for mere telling someone where the
library is
_______________________________________________
NUT-devel mailing list
NUT-devel mplayerhq.hu
http://lists.mplayerhq.hu/mailman/listinfo/nut-devel
|
|
| vorbis global 3 to 1 header mess |

|
2006-07-19 10:36:27 |
Michael Niedermayer wrote:
>
> how to parse all the vorbis header variants:
>
> 1) search for the 1st occurance of
01,'v','o','r','b','i','s'
> the found match and the following 23 bytes are the
1st header packet
> 2) search for the 1st occurance of
03,'v','o','r','b','i','s' after here
> 3) read an unsigned integer of 32 bits and skip that
many bytes
> 4) [user_comment_list_length] = read an unsigned
integer of 32 bits
> 5) iterate [user_comment_list_length] times {
> 6) read an unsigned integer of 32 bits and skip
that many bytes
> }
> 7) skip 1 byte
> 8) the match in 2) and what follows until here is the
2nd header packet
> 9) search for the 1st occurance of
05,'v','o','r','b','i','s' after here
> the matching part and what follows is the 3rd header
packet
>
> if there are no objections then ill propose this on
vorbis-dev
> spelling fixes and other suggestions welcome
>
> [...]
Looks ok.
lu
--
Luca Barbato
Gentoo/linux Gentoo/PPC
http://dev.gentoo.org/
~lu_zero
_______________________________________________
NUT-devel mailing list
NUT-devel mplayerhq.hu
http://lists.mplayerhq.hu/mailman/listinfo/nut-devel
|
|
| vorbis global 3 to 1 header mess |

|
2006-07-19 15:26:47 |
On Wed, Jul 19, 2006 at 12:36:27PM +0200, Luca Barbato
wrote:
> Michael Niedermayer wrote:
> >
> > how to parse all the vorbis header variants:
> >
> > 1) search for the 1st occurance of
01,'v','o','r','b','i','s'
> > the found match and the following 23 bytes are
the 1st header packet
> > 2) search for the 1st occurance of
03,'v','o','r','b','i','s' after here
> > 3) read an unsigned integer of 32 bits and skip
that many bytes
> > 4) [user_comment_list_length] = read an unsigned
integer of 32 bits
> > 5) iterate [user_comment_list_length] times {
> > 6) read an unsigned integer of 32 bits and
skip that many bytes
> > }
> > 7) skip 1 byte
> > 8) the match in 2) and what follows until here is
the 2nd header packet
> > 9) search for the 1st occurance of
05,'v','o','r','b','i','s' after here
> > the matching part and what follows is the 3rd
header packet
> >
> > if there are no objections then ill propose this
on vorbis-dev
> > spelling fixes and other suggestions welcome
> >
> > [...]
>
> Looks ok.
Needs to specify endianness for the 'unsigned integer of 32
bits'
unless that's already clear from something else.. Otherwise
looks
good!
Rich
_______________________________________________
NUT-devel mailing list
NUT-devel mplayerhq.hu
http://lists.mplayerhq.hu/mailman/listinfo/nut-devel
|
|
| vorbis global 3 to 1 header mess |

|
2006-07-19 18:57:05 |
On Wed, Jul 19, 2006 at 11:26:47AM -0400, Rich Felker wrote:
> On Wed, Jul 19, 2006 at 12:36:27PM +0200, Luca Barbato
wrote:
> > Michael Niedermayer wrote:
> > >
> > > how to parse all the vorbis header variants:
> > >
> > > 1) search for the 1st occurance of
01,'v','o','r','b','i','s'
> > > the found match and the following 23 bytes
are the 1st header packet
> > > 2) search for the 1st occurance of
03,'v','o','r','b','i','s' after here
> > > 3) read an unsigned integer of 32 bits and
skip that many bytes
> > > 4) [user_comment_list_length] = read an
unsigned integer of 32 bits
> > > 5) iterate [user_comment_list_length] times
{
> > > 6) read an unsigned integer of 32 bits
and skip that many bytes
> > > }
> > > 7) skip 1 byte
> > > 8) the match in 2) and what follows until
here is the 2nd header packet
> > > 9) search for the 1st occurance of
05,'v','o','r','b','i','s' after here
> > > the matching part and what follows is the
3rd header packet
> > >
> > > if there are no objections then ill propose
this on vorbis-dev
> > > spelling fixes and other suggestions welcome
> > >
> > > [...]
> >
> > Looks ok.
>
> Needs to specify endianness for the 'unsigned integer
of 32 bits'
> unless that's already clear from something else..
Otherwise looks
> good!
entire vorbis spec is spefied like this, all numbers are
read in... bah, i
don't remember, some endianess..
- ods15
_______________________________________________
NUT-devel mailing list
NUT-devel mplayerhq.hu
http://lists.mplayerhq.hu/mailman/listinfo/nut-devel
|
|
[1-7]
|
|