Deliver live streams with low latency
Out of the box, an Adaptive Media Delivery environment is tuned for reliable segment delivery, not for minimum glass-to-glass latency. Edge servers buffer a segment before they start sending it, and players wait for whole segments to arrive. Low latency streaming removes that buffering step so the edge forwards media as it's produced, and the player can start decoding a segment before the segment is complete.
This use case changes the settings your environment already has ā it doesn't add a new feature ā plus one or two extra behaviors depending on your format.
Pick the path that matches your import formatDASH is supported with Media Services Live (MSL) as your origin. HLS (LL-HLS) requires a third-party origin. HDS and Smooth aren't supported.
When to use this
- You run linear or event live streams where a few seconds of latency changes the product ā betting, auctions, live sport, interactive shows.
- Your encoder already produces chunked-encoded output and your packager signals partial segment availability.
- Your player is built for low latency. Low latency is an end-to-end property: if the encoder, packager, origin, edge, or player isn't ready, enabling it at the edge alone won't reduce latency.
Before you begin
- Confirm your encoder pushes with HTTP/1.1 chunked transfer encoding. The chain only stays low-latency if every hop forwards chunks rather than whole segments.
- Decide whether this applies to all traffic or some of it. The settings below sit in the default rule set and apply to every request. If the same environment also serves regular live or on-demand media, don't change the defaults ā build a custom rule set instead. See Serve live and on-demand traffic from one environment.
- For HLS, serve content over HTTPS. The LL-HLS specification requires HTTP/2, which in turn requires a secure connection.
Set up low latency DASH with a Media Services Live origin
With DASH input in MSL, Akamai applies an aggregating response that breaks each segment into smaller chunks. Each chunk is preceded by its size in bytes and transmission ends on a zero-length chunk, so the player doesn't wait for a complete segment.
-
Create your MSL stream. Set the input format to DASH, or to CMAF (HLS & DASH) if you package DASH media in CMAF containers. Adaptive Media Delivery recognizes the CMAF container and identifies the DASH media inside it. See Create your Media Services Live streams.
-
Configure an origin for the stream and note the Primary Hostname. See Set up a Media Services Live origin.
-
Point your environment at that origin and switch on ultra low latency. Configure these behaviors:
| Behavior | Setting |
|---|---|
| Origin Server | Set Origin Type to Media Services Live and enter the MSL Primary Hostname from step 2. |
| Segmented Media Delivery Mode | Set Enable ULL Streaming to On. |
| Content Characteristics | Set Enable DASH to Yes. Set Enable HLS, Enable HDS, and Enable Smooth to No. |
-
Add the
live-ullpath element to your playback URLs. The optimizations are applied automatically when the request path contains the right media-format element:/dash/live-ull/*/cmaf/live-ull/*ā only when your DASH media is inside a CMAF container.
-
Publish your DASH stream in Media Services Live.
Best practices for DASH
- Access the low latency stream using
/live-ullonly. Mixing it with/liveon the same stream gives you the end-to-end latency of the slower path. - If both a low latency player (
/live-ull) and a regular player (/live) access the same stream, make sure the regular player never requests a partial segment. - With DASH, regular players fetch the newest segment conservatively, so the newest segment is always fully available to them.
What CMAF needs to actually reduce latency
Stable latency reduction with CMAF only happens when every link in the chain cooperates:
- Content in the CMAF segment is chunked-encoded.
- The encoder adjusts manifest or playlist production to signal chunked encoding and early data availability.
- The encoder pushes to the origin using HTTP/1.1 chunked transfer encoding.
- Every step in the distribution chain propagates the content using chunked transfer encoding.
- The player times its segment request as close as possible to ā but not before ā the moment the origin starts receiving that segment.
- The player decodes the bitstream as it arrives instead of waiting for end-of-segment. Browser-based HTML5 players must use the Fetch API rather than XHR, because only Fetch can read a response body while it's still downloading.
- The player estimates throughput directly, because standard segment-timing techniques fail at this granularity.
- The player's buffer and adaptation logic copes with very low buffers, and it has a catch-up mode for when throughput fluctuates and it falls behind the live edge.
Set up low latency HLS with a third-party origin
Apple's LL-HLS extension lets the segments at the live edge be described as partial segments ("parts"), so a player can fetch a part instead of waiting for the whole segment.
This specification is still movingLL-HLS implementation details continue to evolve. Treat the settings below as current recommendations rather than a fixed contract.
Select Your Origin and configure it as you would any custom origin. You can't use NetStorage here, because this applies to live streams only.
- Set Mode to Live.
- Set Enable ULL Streaming to On.
- Enable HLS: Yes
- Enable HDS: No
- Enable DASH: No
- Enable Smooth: No
Serving other formats from the same environmentDon't put these settings in the default rule set if the environment also delivers other formats. Create one custom rule set with its own match criteria carrying the LL-HLS settings above, and a second one with its own criteria and Enable ULL Streaming set to Off for everything else. The default rule set can't do this, because it applies to all requests.
An LL-HLS player requests manifests using special _HLS query parameters, so those parameters have to be part of the cache key. The simplest way to catch them all:
- Add _HLS to the Parameters list.
- Set Exact Match to No, so any parameter containing
_HLSmatches.
Some packagers need more than this. The Apple reference stream, for example, uses query parameters on segment requests too; add those to the parameter list as well.
LL-HLS requires HTTP/2. Add the HTTP/2 behavior, and make sure the environment serves content over HTTPS.
Quick Retry ā depends on your addressing mode
A manifest can describe parts in one of two ways, and each wants a different Quick Retry setting.
| Mode | What it does | Quick Retry |
|---|---|---|
| DISCRETE | Each part has its own URL. The most common mode; every player supports it. Self-serviceable. | Add Quick Retry and set it to On, so a struggling transfer can find an alternative path. |
| BYTERANGE | Segment files are requested at a byte-range offset, and you receive data as the packager produces it without requesting each part individually. Can cut client-to-edge requests by about 40%. | Remove Quick Retry, or leave it in place and disable it. Also enable support for RFC 8673. |
Quick Retry is on by defaultA new Adaptive Media Delivery environment includes Quick Retry set to On. If you're relying on the default settings for this traffic, make sure the value matches the mode you've chosen.
Other settings worth tuning
With Enable ULL Streaming set to On, the default read timeout is 2 seconds at the edge and 1 second at the parent. The origin holds back requests for the duration of an individual part, which narrows the timeout window and can cause false triggers. With 1-second parts, hold-back times of 950ā980 ms are common and sit uncomfortably close to a 1-second parent timeout.
Adding margin at the parent avoids this:
<network:http.read>2s</network:http.read>
<match:request.type value="PARENT PEER_REQ">
<network:http.read>1500ms</network:http.read>
</match:request.type>This needs advanced metadata. Work with your account representative to get it applied.
The Timing-Allow-Origin header
A web player that can read the Resource Timing API can separate hold-back time (TTFB) from actual download time, which makes its bandwidth estimates far more accurate. Add a rule that sets the header when it's missing:
- Add a rule from the Blank Rule Template.
- Add a match: Response Header / Timing-Allow-Origin / does not exist.
- Add the Modify Outgoing Response Header behavior.
- Set Action to Modify, set Select Header Name to Otherā¦, and enter Timing-Allow-Origin as the custom header name.
- Set New Header Value to
*.
How rule order affects this
Origin Server, Content Characteristics, and Segmented Media Delivery Mode are required and always present in the default rule set, which applies to every request.
- If you put these behaviors in a custom rule set and a request matches it, that rule set's values are used.
- If you create a custom rule set and leave these behaviors out, matching requests fall back to the values in the default rule set.
Keep that fallback in mind: a rule set that matches low latency traffic but omits Segmented Media Delivery Mode silently inherits whatever ULL setting the defaults carry.
Related
- Tune Quick Retry for congested forward paths
- Serve live and on-demand traffic from one environment
- Override the cache-optimized response headers
- Enabling Low-Latency HLS ā Apple developer documentation
- Using LL-HLS with byte-range addressing ā Akamai blog
Updated about 1 hour ago
