Optimizing HTTP Live Streaming (HLS) for Best User Experience 1

Joon Won Lee
3 min readJul 1, 2018

--

Intro

Every year Apple has changed and extended their frameworks. For better understanding and the ability to leverage the framework capabilities, here’s the rendition and comments to optimize HTTP Live Streaming (HLS).

HTTP Live Streaming (HLS) is used to stream live and on-demand content to global audiences. You can discover how to adjust and tune stream authoring and delivery elements to improve user experience through session 502.

Session Link

On the session, they talked about followings:

  • Establish a common language for streaming QoS
  • Objectively measure the streaming QoS
  • Identify and solve problems that impair QoS

For basic understand for HLS playback session, see a following image.

Anatomy of HLS session

Quantifying the UX

First of all, you need to find a problem before solve it. To find problem, you need to measure some metrics you defined.

What could be KPIs for HLS User Experience? Here’s some KPIs addressed in the session.

5 KPIs for HLS Performance

  • Startup Time : Statup time per session
  • Stall count: Stall rate(normalized to duration watched — count/hour)
  • Stall duration: Stall duration to duration watched ratio
  • Indicated bitrate: Time-weighted indicated bitrate
  • Error: Playback failure percentage

Startup Time

Here’s, every stages to startup media playback.

Stall count, Stall duration, Indicated bitrate

You can use AVPlayerItemAccessLog to measure KPIs

Playback Failure Percentage

Improving HLS Performance

Next step after defining KPIs, improve performance!

  • Reduce startup time
  • Investigate stalls
  • Investigate errors
the process of start playback

Reduce startup time with AVAsset

you can reduce startup time by

  • Create and inspect AVAsset before user decides to play
  • Prefetch decryption keys(adopt AVContentKeySession)

Reduce startup time — AVPlayer and AVPlayerItem

you can reduce startup time by

  • set up AVPlayItem before buffering
  • set AVPlayer rate before setting player item

Reduce startup Time — AVPlayerItem Transition

you can reduce startup time by

  • use AVQueuePlayer to play multiple items
  • enqueue second AVPlayerItem in advance

Conclusion

In this article, I covered part of session(502) “Measuring and optimizing HLS performance ”

Here’s the summary of this article

  • Set KPIs for better UX of HLS
  • Find ways of measuring the metric of KPI
  • Reduce startup time (through changing configuration of avasset, avplayer — avplayeritem, avplayeritem transision)

On next article, we will take a look at how to investigate stalls and errors in HLS playback

--

--