[Vorbis] Delay

Ralph Giles giles at xiph.org
Fri Jul 1 01:50:52 PDT 2005


On Fri, Jul 01, 2005 at 10:14:01AM +0200, Thomas Bosch wrote:

> So, does anyone know the coding delay of ogg-vorbis?

There are two parts to this. First, the reference encoder buffers 
some from which to make coding decisions. IIRC it's on the order
of 3 packets or so. It's possible to write an encoder with only
one packet's latency, but the quality/bitrate would be much, much
worse than the reference encoder, so there's not much that can
be done about this.

On top of the encoder latency, the Ogg encapsulation adds a further
delay as enought packets to fill a (by default) 4k page are accumulated
before the data is sent. Depending on the bitrate, this can be quite
some time. Of course you can avoid this by using a lower latency
container like RTP or (less efficiently) flushing an ogg page after
every packet submit.

IIRC the end-to-end latency of an Ogg Vorbis http stream I did in
a lan test a couple of years ago was around 3 seconds, so if you're
doing this in an interactive application you really have to get
rid of the Ogg delay, and then see if you can live with the Vorbis
encoder latency.

Hope that helps,
 -r

P.S. I suspect FLAC can more easily trade compression efficiency
for latency. You might look at that as well if bandwidth isn't
an issue.


More information about the Vorbis mailing list