HTTP Live Streaming (HLS) is here to stay. It works everywhere, with high quality and stability, but latency or delays between the stream and the end-user can be 60-90 seconds if you are streaming live events. That can be a very big issue. Imagine sports betting?
But with the Wowza Streaming Engine, it is possible to reduce the latency to 3 to 5 seconds.
It is not good enough, but for now, there is no other solution.
Below we have some adjustments that using the Wowza Streaming Engine Manage, which is the main software we use for the RTMP Server, we can easily improve, although, of course, there are some negative components.
These risks inherent in the configuration adjustments are due to smaller chunk sizes and may result in playback errors if you fail to increase the number of seconds built into the playlist. If a stream is interrupted, and the player requests the next playlist, the stream may be interrupted when the requested playlist doesn’t arrive.
Additionally, by increasing the number of segments that are needed to create and deliver low-latency streams, you also increase the server cache requirements. To alleviate this concern, ensure that your server has a large enough cache, or built-in elasticity. You will also need to account for greater CPU and GPU utilization resulting from the increased number of keyframes. This requires careful planning for load balancing, with the understanding that increased computing and caching overhead incurs a higher cost of operation.
Lastly, as chunk sizes are smaller, the overall quality of the video playback can be impacted. This may result in either not being able to deliver a full 4K video to the player, or small playback glitches with an increased risk of packet loss. Essentially, as you increase the number of bits (markers on the chunks), you require more processing power to provide smooth playback; without it, you get packet loss and interruptions.
A- In Wowza Streaming Engine Manager, click the Applications tab and then click live in the contents panel.
On the details page Properties tab, click Cupertino Streaming Packetizer in the Quick Links bar.
In the Cupertino Streaming Packetizer area, click Edit, and change the values for the following properties:
1- cupertinoChunkDurationTarget- Set the duration of each chunk in milliseconds. The default value is 10000, but the chunkDurationTarget must be smaller to reduce the latency of Apple HLS streams. For a one-second chunk size, set the value to 1000.
2- cupertinoMaxChunkCount- Sets the maximum number of chunks Wowza Streaming Engine stores in the available chunk list. The default value is 10, but for reduced latency streaming we recommend storing 50 seconds worth of chunks. For one-second chunks, set the cupertinoMaxChunkCount to 50; if you’re using half-second chunks, the value should be doubled (100).
3-cupertinoPlaylistChunkCount-Sets the number of items returned to the player in the playlist. The default value is 3, but for reduced latency streaming, we recommend returning 12 seconds of data to the player. This prevents the loss of chunks between chunklist requests. For one-second chunks, set the cupertinoPlaylistChunkCount to 12; if you’re using half-second chunks, the value should be doubled (24).
B- On the Properties tab, click Custom in the Quick Links bar.
In the Custom area, click Edit.
Click Add Custom Property, specify the following custom property settings in the Add Custom Property dialog box, and then click Add:
1- In Path, select /Root/Application/LiveStreamPacketizer.
2- In Name, enter cupertinoMinPlaylistChunkCount.
3- In Type, select Integer.
4- In Value, specify the minimum number of chunks required before the Wowza Streaming Engine provides a playlist to the player. The default value is 1, but for reduced latency streaming, we recommend requiring a minimum of 6 seconds’ worth of chunks. For one-second chunks, set the cupertinoMinPlaylistChunkCount to 6; if you’re using half-second chunks, the value should be doubled (12).
Click Save and restart the application to apply the changes.
Done. Try now. Our RTMP server should now stream live with lower latency.