Persistent delay (latency) in live streaming on localhost
I have been trying to stream live video from my laptop's webcam through Wowza Media Server on localhost. However, trying to view the stream through the LiveVideoStreaming example or VLC always causes a few seconds' delay in the video playback. I have tried the following instructions: -
I have tried both RTMP direct and MPEG-TS streaming. I have tried using both ffmpeg and Telestream Wirecast encoder. I have tried buffer size, bitrate, frame rate, muxdelay, muxpreload and vsync parameters on ffmpeg (both increasing and decreasing), but nothing works. Wowza Media Server seems to remain unaffected by any change whatsoever. I have tried this on both Linux and Windows. I am using the H.264 codec (libx264 in ffmpeg). I will be very grateful if someone can help me achieve a zero or near-zero latency.
Last edited by sauravsengupta; 04-24-2012 at 12:51 PM.
That first link is what we know about this. A few seconds indicates low FPS h.264 video in Flash RTMP client with NetStream.bufferLength > 0. You can increase FPS. You should test locally to eliminate network latency, which you cannot control really.
I have increased the FPS, but to no avail. I don't have access to ActionScript to change NetStream.bufferLength, but the issue occurs with VLC as well, with caching set to zero. I have also tried passing bufferlength=0 in flashvars, as shown here. I am testing on localhost, so network latency is not present.
Last edited by sauravsengupta; 04-24-2012 at 10:50 PM.
I see you have performed some good troubleshooting steps, trying different encoders, etc.
"I will be very grateful if someone can help me achieve a zero or near-zero latency."
A good test for you would be to install the videochat example using the install script:
Then run \examples\VideoChat\client\videochat.html
Publish and connect to the same stream. You should see only ~200ms latency.
Last edited by randall; 04-25-2012 at 09:08 AM.
Tags for this Thread