I'm having trouble to reduce the latency while trying to broadcast my webcam. I'm streaming the webcam feed to Wowza server through ffmpeg, both the ffmpeg and Wowza server resides on the same machine.
With the webcam, I'm obtaining the compressed mjpeg feed at ~30 fps @ 1280x720 as in the input. As the encoder, I'm using x264 with zerolatency tune and preset of ultrafast. With Wowza application, I've enabled the low latency option. An example cmd line for ffmpeg is the following.
The current latency is about 3 seconds, viewed from Test Player on Wowza Engine Manager. I've tried online suggestions
here but the latency doesn't vary at all. I've played with crf and other settings and the only difference I noticed was image quality. With zerolatency, there is already 0 bframe with rc_lookahead and slice_lookahead disabled. The latency in transcoding should be of minimal.
I'm really stuck in finding out what is causing the latency. Please advice if anyone has any suggestions. Thank you very much.
That's great, thanks for the update. Further to that, as we understand it, the RTMP player will wait for 60 frames before displaying h.264 video, unless you set bufferLength to "0". This setting can cause playback problems if the bitrate is close to the client's bandwidth. This is
discussed in this guide.