# Live Streaming Latency Issue through Wowza

**URL:** <https://community.wowza.com/t/live-streaming-latency-issue-through-wowza/43046>\
**Category:** Wowza Streaming Engine\
**Created:** [May 15, 2014, 3:27pm UTC](https://community.wowza.com/t/live-streaming-latency-issue-through-wowza/43046 "2014-05-15T15:27:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fan\_Jin](https://avatars.discourse-cdn.com/v4/letter/f/ecccb3/32.png) [@Fan\_Jin](https://community.wowza.com/u/Fan_Jin)\
**Post date:** [May 15, 2014, 3:27pm UTC](https://community.wowza.com/t/live-streaming-latency-issue-through-wowza/43046/1 "2014-05-15T15:27:05Z")

</div>

Hi,

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.

```auto
ffmpeg -f v4l2 -s 1280x720 -input_format mjpeg -i /dev/video0 -c:v libx264 -preset ultrafast -tune zerolatency -f flv rtmp://wowzaserverip:port/live/myStream

```

The current latency is about 3 seconds, viewed from Test Player on Wowza Engine Manager. I’ve tried online suggestions [here](http://x264dev.multimedia.cx/archives/) 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.

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 15, 2014, 9:14pm UTC](https://community.wowza.com/t/live-streaming-latency-issue-through-wowza/43046/2 "2014-05-15T21:14:02Z")

</div>

I think the NetStream.bufferLength is set to 3 seconds in the test players, as is the default with JW Player, but it is easier to [modify in JW Player](https://www.wowza.com/docs/how-to-use-jw-player-with-wowza-streaming-engine) as shown in the example in that guide.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 16, 2014, 3:54am UTC](https://community.wowza.com/t/live-streaming-latency-issue-through-wowza/43046/3 "2014-05-16T03:54:10Z")

</div>

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](https://www.wowza.com/docs/how-to-set-up-low-latency-applications-in-wowza-streaming-engine-for-rtmp-streaming).

Richard

---

<div class="post-metadata">

**Author:** ![Fan\_Jin](https://avatars.discourse-cdn.com/v4/letter/f/ecccb3/32.png) [@Fan\_Jin](https://community.wowza.com/u/Fan_Jin)\
**Post date:** [May 15, 2014, 10:43pm UTC](https://community.wowza.com/t/live-streaming-latency-issue-through-wowza/43046/4 "2014-05-15T22:43:13Z")

</div>

> I think the NetStream.bufferLength is set to 3 seconds in the test players, as is the default with JW Player, but it is easier to [modify in JW Player](https://www.wowza.com/docs/how-to-use-jw-player-with-wowza-streaming-engine) as shown in the example in that guide.
> 
> Richard

Thank you for your suggestion. After setting up the JWPlayer on localhost I was able to reduce the latency drastically with the setting

```auto
rtmp: {
		bufferlength: 0.05
	}

```
