3
votes

I'm trying to listen to a live audio stream on a webpage with a latency of less than 3 seconds. So far with ogg vorbis streams generated using ices & icecast, I've been unable to get latencies less than 7 seconds. All players I've used so far (html5 audio tag in Firefox, Opera, Safari; VLC as well) seem to introduce similar delays. It's unclear at this point how much latency is introduced in ices/icecast vs. the client-side player. I've tweaked ices and icecast settings, to no avail.

Has anyone achieved better latencies than this in a similar ices/icecast setup? I wouldn't expect an ogg vorbis decoder (be it html 5 in a browser, VLC, or whatever) to delay an audio stream for multiple seconds. Am I incorrect? I can't find any info on controlling buffer sizes or the decoding in browsers.

With a different architecture (html 5, firefox, WSGI server serving wav format audio), I was able to achieve latencies around 1-2 seconds. By default, the firefox began playing the wav file 5+ seconds behind, but I could advance playback by setting audio.currentTime ahead, and only be 1-2 seconds back (somewhat fragile). However, I'd much prefer to use icecast, and streaming wavs obviously doesn't scale.

Thanks in advance for any ideas.

2
Have you considered using a server dedicated to static delivery such as nginx?meder omuraliev
At this point I don't think server performance is the limiting factor, if that's what you are getting at. Just did another experiment, WSGI serving ogg vorbis encoding using oggenc (raw input), still had similarly bad latency. I think this shows that ices & icecast are not the culprit. It looks to be either ogg vorbis encoding or decoding and playback that are adding latency.cursemyziti

2 Answers

1
votes

The Icecast and Shoutcast servers themselves have internal buffers. I know the shoutcast one can be configured (look in the advanced directives in the docs).

0
votes

There are some archived discussions threads about Ogg / Vorbis related delay:

The answer seems to be that you have to tweek the Ogg container format, and then the remaining delay of Vorbis should not be too high.

However, I also often read that the new Opus codec is better suited for low delay/latency. See e.g. here or here.