Streaming buffer / sync issues in Flash client
I'm trying to stream some live audio using Flash/RTMP. The live aspect of this is very important.
I have a really annoying issue. When I set a bufferSize when streaming to something over a second, the audio buffers and therefore sounds OK. However over time it drifts, and instead of the delay being the intended 1 second, it drifts to about 10 seconds which is not acceptable for the type of project I'm doing. I guess this is due to small differences in clock signal / timekeeping.
If I set the buffer to less than a second, I have no buffer, which is bad as the audio stutters, because of the nature of packets arriving at slightly different times (each packet should hold 20ms of audio but because packets don't arrive exactly 20ms apart, a skewing/jitter/stutter effect is noticeable).
Obviously I need a small buffer of about 300ms-1000ms to prevent jittering. Is there any way I can ensure the buffer says at a fixed 1000ms (or shorter ideally) without it drifting?
I'm using FlowPlayer as my client, but I assume it doesn't matter as all Flash streaming uses the NetConnection/NetStream API. I've currently using AMD64 Ubuntu.
Tags for this Thread