How to reduce HLS latency in Wowza Video using OBS or an RTMP encoder

Q: Why is my latency still high if I selected "Prioritize latency to create an HLS stream with the lowest latency possible"? 

A: There are some additional settings you can check in both the encoder and Wowza Video

Step 1: Wowza Video Settings

A. When you create a new stream, make sure you have selected:

     Prioritize latency to create an HLS stream with the lowest latency possible

This will reduce the buffer size to zero and the chunk duration to 2 seconds. The lower latency configuration will now send 2-second chunks and the playlist will consist of no less than 3 chunks, equalling a total of 6 seconds. (HLS requires 3 chunks for playback to begin.)

 

B. If you forgot to select Prioritize latency to create an HLS stream with the lowest latency possible when you created a stream, you can go in and edit the settings.

1. Click on Transcoders from the left nav bar.

2. From the list of streams, select the stream where it did not prioritize latency. This will open a new page for that particular stream.

Click Transcoder Setup at the top. Then click Edit.

3. Scroll down to the Buffer section, click on the dropdown and you can change the buffer size with a range from 0 to 8 seconds. You can select 0 seconds for the lowest latency option.

Note!  Although delivering shorter audio and video file segments can reduce latency, shorter file segments and a buffer of 0 can also create additional network overhead for the client. If the client doesn't have enough bandwidth, playback may stall, which results in a poor viewing experience. The  buffer setting of 0 can always be edited to a higher number should there be playback issues.

 

4. Make sure you go back to the top and click the green Save button for the changes to take effect.

5. The next step is to edit the segment size. In the left nav, click Stream Targets.

   

6. Click on the same stream name that you edited when you changed the Buffer setting. 

7. Click Properties at the top and click Edit.

Here, you will check the box for HLS Segment Duration, click the dropdown arrow for the value where you can select a segment duration between 2 and 10 seconds. Go ahead and select 2 seconds.

8. Be sure to click Save.

 

Step 2: OBS Settings (or RTMP encoder)

A. You can edit the OBS settings for your live stream by clicking on Settings in the lower right corner of the screen.

 

1. In the left nav bar, click Output. Here, we will check some settings.

NOTE! The last two settings are very important for low latency (Tune and X264 settings- see below)

  Output Mode: Advanced

  Rate Control: Constant Bitrate (CBR)

  Bitrate: For high motion video: 6000. For less motion video: 4000.

  Keyframe Interval: 2 seconds

  CPU Usage: Very fast

  Profile: High

  Tune: Zero latency

  x264 options: bframes=0 scenecut=0

 

B-frames can cause issues transcoding and scenecut will affect playback if there are many quick scene changes in succession.

 

Summary:

Changing these settings in Wowza Video and in an encoder such as OBS can possibly reduce your HLS latency to about 9 to 12 seconds. 

When you include the first-mile transit, the processing and muxing of the first 6 seconds, and then the last mile transit, the stream has picked up latency along the way.  5 seconds or less is not currently an option within the traditional HLS "lower latency" workflow and Wowza Video does not currently support LL-HLS; although it is an option within Wowza Streaming Engine.

 

For a complete video tutorial on Configuring OBS and Wowza Video to Reduce HLS Latency:

Click HERE.

____________________________________________________________________________

Resources

Full library of Wowza Video documentation

Deliver a Reduced Latency HLS Stream in Wowza Video