[vorbis] a few questions

Michael Smith msmith at labyrinth.net.au
Fri Sep 14 20:18:04 PDT 2001



At 07:20 PM 9/14/01 +0300, you wrote:
>i want to embed only the raw packets, because mp4 file has its own sync
>mechanism.
>
>below is list of things which need to be provided to mp4 mux.
>
>1. reader should provide sync info, which include: duration of current frame
>(it could be duration of 'page' in bitstream'). term 'frame' means that's
>some atomic type for decode which can be decoded (for example, something
>like video frame, ADTS packet, etc).

You can get this pretty easily using libogg and libvorbis. 
vorbis_packet_blocksize() is the function you want, I think (you also need
to do some extra manipulations to ensure you treat BOS and EOS correctly).
That bit is pretty well documented, so I won't go into details. Read the ogg
docs.

>2. is it key frame or no. this info is used for seeking. 'key frame' means
>that this frame is independed from any previous frames and can be decoded
>without decoding any previous frames.

All vorbis packets can be considered key frames.

>3. size in bytes of current frame.
>4. DecodeSpecificInfo. it's array of bytes, length is variable. can be 0 if
>decoder does not require this info. in DecoderSpecificInfo is saved
>everything what's need by decoder in order to decode streams. for example,
>smaling rate of decoded stream, channel configuration, etc. a few instances
>of DecodeSpecificInfo can be present if some parameters of stream are
>variable during playing.

3 & 4 are obviously easy - this is just the vorbis packet itself, and the 
length of the packet. Simple.

>5. MaxBitrate of stream.

Can't be done. Vorbis does not attempt to limit bitrates to any maximum.
You could put a 'practical maximum' value here, but there's no guarantee
it'll be correct (unless you look through the entire stream, see what the
bitrate peaks at, and then fill this in for that particular stream. Prevents
live encoding, then).

>6. AvgBitrate if stream was not encoded in vbr mode.

vorbis is always vbr, but you can give an average bitrate anyway if it's 
useful.

>7. ObjectTypeIndication. it's byte, which specifies what type of stream is
>muxed. Mpeg4 spec says that values 0xC0-0xFE should be used for private
>streams.

Whatever is suitable...

This seems like a fairly useless thing to do, since ogg performs all the
same tasks at least as well, but the info is there if you want to make
use of it.

Michael

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis mailing list