For a new project I need an audio live stream with very low latency (< 500 ms) from microphone to an online audience (web browsers).
So far I have tried a Wowza (trial licence) AMI on AWS (application with low-letency, otherwise standard settings), using Flash Media Live Encoder on the broadcaster side and the JWPlayer on the audience side. However, latency is very bad (20-30 seconds). Is there anything I can do to improve latency? I have searched this forum, but there is not much about audio only streaming. I can't imagine that a latency that high is normal for low latency live streams. Especially if it's sound only. Is there an encoder that is better suited than Flash Media Live Encoder?
On the player side, it's important that the NetStream.setBufferTime() method is set to zero (in Actionscript 3 use "NetStream.bufferTime = 0;"). This will give you the lowest possible latency on the playback side.
Although zero will give you the best possible latency, it might not give you the smoothest playback. So you may need to increase the buffer time to a value slightly greater then zero (such as .1 or .25). When using H.264-encoded video, we've found that any buffer setting greater then zero introduces a latency of at least 2-3 seconds with 30 fps video (and even higher at lower frame rates). This seems to be a player issue.
Latency is also introduced into the process on the encoding side. We've found that you can achieve very low latency encoding using the Flash player's built-in encoding (Microphone and Camera). The built-in encoding system in the Flash player uses Sorenson Spark (a variant of H.263) for video and NellyMoser ASAO or Speex for audio. To achieve low latency, it's important that you configure your encoding to produce a reasonable quality at the lowest possible bitrate. The VideoChat example that ships with Wowza Media Server is a good example of how to use the built-in Flash encoder to produce a low latency stream.
Increasing the frame rate and/or decreasing the key frame interval can improve playback time in some cases.