Changing Default Segment Size to Decrease Streaming LatencyJuly 10, 2019
With HTTP-based streaming, there’s an inherent latency because the video data is packaged into file segments (also called chunks or packets) rather than being delivered as a continuous flow of information. This makes for a stable viewing experience and enables adaptive bitrate streaming, but delays playback until the individual segments are downloaded.
One way to speed things up is reducing the size of the segments. This can be applied to all HTTP streaming protocols and the process is simple.
Lowering the Latency of Apple HLS Live Streams From Wowza Streaming Engine
Let’s look at the Apple HTTP Live Streaming (HLS) protocol to discuss how this works.
Up until 2016, Apple recommended using ten-second segments for HLS. The specification also required three segments to be loaded before playback could begin. By sticking with the ten-second recommendation, broadcasters would start out with 30 seconds of latency based on segment size alone. Apple has since decreased the default segment size to six seconds, but that still means that the ‘live’ stream lags almost 20 seconds behind.
It’s easy to manually tune your streaming software by reducing the duration of each segment or packet. Shorter chunks enable faster download times, thereby improving overall latency.
In this video, Justin shows how to lower the latency of Apple HLS streams when delivering video with Wowza Streaming Engine.
This easy adjustment requires no change in pricing or commitment level, and can still support adaptive bitrate streaming. What’s more, your infrastructure stays exactly as is.
Considerations When Changing Default Segment Size
- Increased bitrate: Keep in mind, the smaller segments size will lead to a higher overall bitrate while delivering the same video quality. This is because when a stream is encoded, only some frames show the complete picture. The initial keyframe includes a complete image, while subsequent delta frames only depict changes from that image. Since each segment must start with a data-heavy keyframe, the bitrate climbs when more segments are created.
- Quality of experience (QoE): Similarly, the reduced segment size can cause buffering or jitter for any viewers with subpar network conditions. This occurs because the smaller the segment, the less time the player has to download each segment.
- Ideal segment size: While the optimal segment size will depend on your specific broadcast, trying out some different options is a good place to start. We wouldn’t recommend setting the segment size anywhere lower than two seconds, and four seconds would be your best bet if concerned about network problems.
Changing the Default Segment Size for HTTP-Based Protocols
While the Wowza Streaming Engine™ software allows users to manipulate the segment size for HLS, MPEG-DASH, HDS, and Microsoft Smooth, the Wowza Streaming Cloud™ service can only be tuned for reduced-latency HLS streams. Check out our docs for more information about configuring low-latency properties for HTTP-based protocols.
Wowza Streaming Engine™ Software
- Configure Apple HLS Packetization in Wowza Streaming Engine
- Configure MPEG-DASH Packetization in Wowza Streaming Engine
- Configure Microsoft Smooth Packetization in Wowza Streaming Engine
- Configure Adobe HDS Packetization in Wowza Streaming Engine
Wowza Streaming Cloud™ Service