[Vorbis] Vorbis granule position

Stefan Bender oraqhf at gmx.net
Thu Oct 25 00:59:04 PDT 2007


Hi,

Ralph Giles wrote on Tue, Oct 23 2007 14:34:46:
> On Tue, Oct 23, 2007 at 02:44:44PM -0500, James M. Rotenberry wrote:
> 
> > When a ogg vorbis stream is ripped using wget, fetch, or
> > streamripper under Linux or FreeBSD, the resulting file has
> > problems both with granule position and with a missing EOS.
> 
> A missing EOS isn't really a problem, it just indicates the stream is 
> incomplete. There are a couple of scripts to set the EOS flag. Mine is 
> in http://downloads.xiph.org/releases/rogg/rogg-0.1.tar.gz
> 
> It is possible to retimestamp a stream, but I'm not aware of any tools 
> which do so. Running it through gstreamer's muxer or liboggz after 
> setting the packet timestamps to "-1" might help.

A while ago I wrote a small program that recalculates the
granule values of streams to begin with 0. It is mainly just
done by combining the code from decoder_example.c and
encoder_example.c to read the sample numbers from the packets
and then to calculate the new granule values.

You can find it at

    http://www.bender-suhl.de/stefan/comp/sources/ogg_repack.c

Be aware that it is mostly a proof of concept with no guarantee
that it works in all cases (read: it's not tested with chained
streams).

Cheers, Stefan.


More information about the Vorbis mailing list