What’s the deal with Apple’s Low Latency HLS (ALHLS)?
Zac Shenker
Director of Engineering, Video Delivery, Optimization & Experience
zac.shenker@cbsinteractive.com
Current Latency @ CBSi
• 6 Second Segments (2 Second GOPs)
– Some BUs testing 2 Second Segments
• Players Start 3 Segments Behind Live Edge
• Minimum Latency - 18 seconds
• Real-World Latency - 25 to 30+ seconds
• Proven at Scale to Millions of Concurrent Viewers
Other Sources of Latency
• Playlist Fetches
– Generally runs at half segment duration (3 seconds)
• Broadcast Distribution
– Satellite Latency
– Multiple Generations of Encode/Decode
Latency Tradeoffs
• Maximum Player Buffer Length
• Rendition / Quality Level
• Risk of Rebuffering
• Stream Startup Time
• Non-Simulcast or Interactive Content
HLS Low Latency before Apple
• Custom Tags in HLS Manifests
– Designed to be backwards compatible
• HTTP/1.1 Chunked Transfer Coding for Segments
• Bandwidth Estimation Modifications Needed
• Implementations from Periscope & Twitch
• HLS.JS RFC - https://github.com/video-dev/hlsjs-rfcs/pull/1
• Approaches for DASH CMAF too (not covering this today)
Disclaimer
• This is New to Everyone
• We are Learning and Experiment across the Industry
• Scaling Live is Hard
– In General (even without Low Latency)
– At Scale
– While Maintaining Great QoE
– Across an Increasing Number of Devices / Platforms
References for ALHLS
• WWDC Video
https://developer.apple.com/videos/play/wwdc2019/502/
• Preliminary Spec
https://developer.apple.com/documentation/http_live_streaming/protocol_extension_for_low-
latency_hls_preliminary_specification
• Blog Post - Phil Harrison (AWS)
https://www.linkedin.com/pulse/apples-implementation-low-latency-hls-explained-phil-harrison/
• Blog Post - Phil Cluff (Mux)
https://mux.com/blog/the-community-gave-us-low-latency-live-streaming-then-apple-took-it-away/
Considerations for ALHLS
• HTTP is Standard for Online Video Delivery
– Segments must become smaller (250ms)
• CDNs are essential for scale
– CDNs are good at caching, we need to use that
• Runway to react is shorter
– Switch renditions in 600ms instead of 10s
Origin API
• #EXT-X-SERVER-CONTROL to Advertise Server Support
− CAN-BLOCK-RELOAD=YES is Mandatory
• _HLS* Query Parameters Reserved
− Query Params should be Sorted
• Client Requests Different Responses/Behaviors from Origin
• CDN must Cache based on Query Params
5 Components of ALHLS
• Partial Segments
• Reducing Latency of Segments
• Blocking Playlist Requests
• Playlist Delta Updates
• Faster Rendition Switches
1 - Partial Segments
• Today
– 6 Second Segment Only Advertised when Fully Available
• Partial Segment every 250ms
– Full Segment Must be Available before Advertised
• New #EXT-X-PART tag
– #EXT-X-PART:DURATION=0.33334,URI="filePart271.4.ts",INDEPENDENT=YES
1 - Partial Segments (Challenges)
• Parts Advertised when Fully Available
• Parts in Manifest for 3 Target Durations
• I-Frame Required to Start Playback
• Full Segment Required after All Parts
• New Packagers Required
• Can we Share CDN Cache (between Parts & Segments)
− HTTP/1.1 Chunked Transfer from Origin to Edge
− Query Params for Byte Ranges on Edge
(i.e. filePart271.ts?start=0&end=123)
1 - Partial Segments (Challenges)
• Can we Share CDN Cache (between Parts & Segments)
− HTTP/1.1 Chunked Transfer from Origin to Edge
− Query Params for Byte Ranges on Edge
(i.e. filePart271.ts?start=0&end=123)
#EXT-X-PART:DURATION=0.33334,URI="filePart271.ts?start=0&end=123"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.ts?start=124&end=456"
...
#EXTINF:4.00008,
filePart271.ts
2 - Reducing Latency of Segments
• Mobile Networks can have high Round Trip Times
• HTTP/2 Server Push for Parts
− Triggered alongside Manifest
− _HLS_push to Indicate Client expects part to be pushed
• Link Response Header
− Link: </filePart.456.1.ts>; rel=preload; as=video; type=video/mp2t
• Challenges
− CDN Support Varies
− Manifests & Segments on Different Domains/Origins
3- Blocking Playlist Requests
• Today
− Client Polls Manifest for New Segments
• Blocking Request for Next Playlist
− _HLS_msn for Media Sequence Number
− _HLS_part for Part Number
• CDN should Batch Requests for Same Playlist
4 - Playlist Delta Updates
• Today
− Playlists Keep Getting Larger
• More Frequent Manifest Requests with Low Latency
• First Playlist Request as Normal
• New #EXT-X-SKIP tag
− Indicates number of Skipped Segments
• _HLS_skip=YES used on Origin API
#EXTM3U
# Following the example above, this playlist is a response to: GET
https://example.com/2M/waitForMSN.php?_HLS_msn=273&_HLS_part=3&_HLS_report=../1M/waitForMSN.php&_HLS_report=../4M/waitForMSN.php&_HLS_skip=YES
#EXT-X-TARGETDURATION:4
#EXT-X-VERSION:9
#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,PART-HOLD-BACK=1.0,CAN-SKIP-UNTIL=12.0
#EXT-X-PART-INF:PART-TARGET=0.33334
#EXT-X-MEDIA-SEQUENCE:266
#EXT-X-SKIP:SKIPPED-SEGMENTS=3
#EXTINF:4.00008,
fileSequence269.ts
#EXTINF:4.00008,
fileSequence270.ts
#EXT-X-PART:DURATION=0.33334,URI="filePart271.0.ts",INDEPENDENT=YES
#EXT-X-PART:DURATION=0.33334,URI="filePart271.1.ts"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.2.ts"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.3.ts"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.4.ts",INDEPENDENT=YES
#EXTINF:4.00008,
fileSequence271.ts
#EXT-X-PROGRAM-DATE-TIME:2019-02-14T02:13:60.106Z
#EXT-X-PART:DURATION=0.33334,URI="filePart272.a.ts"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.b.ts"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.c.ts"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.d.ts"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.e.ts"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.f.ts",INDEPENDENT=YES
#EXT-X-RENDITION-REPORT:URI="../1M/waitForMSN.php",LAST-MSN=272,LAST-PART=11
#EXT-X-RENDITION-REPORT:URI="../4M/waitForMSN.php",LAST-MSN=272,LAST-PART=11
5 - Faster Rendition Switches
• Less Time to React with Low Latency
• Include URI to Next Segments of Different Renditions
• Adds #EXT-X-RENDITION-REPORT Tag
• #EXT-X-RENDITION-REPORT:URI="../1M/waitForMSN.php",LAST-MSN=273,LAST-PART=2
• #EXT-X-RENDITION-REPORT:URI="../4M/waitForMSN.php",LAST-MSN=273,LAST-PART=1
• Spec Mentions LAST-I-MSN and LAST-I-PART Unused
• How do we determine which Part we can Switch on?
− Is it safe to use INDEPENDENT from Current Renditions
Parts?
Conclusion
• A LOT of Moving Pieces
• Origin API adds Complexity
− For Client, CDN & Origin
• Origins Must Become More Dynamic
• Lots of Unknowns for SSAI Integration/Support
• HTTP/2 & Server Push has Varying Levels of Support
• Bypasses Bandwidth Estimation Issues of Other Approaches
Conclusion
• In Beta in iOS 13 Beta behind Entitlement
− No Safari Support Yet
• Sample Script / Tools Provided by Apple
• Will this be New Standard for LHLS?
THANK
YOU

What's the deal with Apple's Low Latency HLS (ALHLS)?

  • 1.
    What’s the dealwith Apple’s Low Latency HLS (ALHLS)? Zac Shenker Director of Engineering, Video Delivery, Optimization & Experience zac.shenker@cbsinteractive.com
  • 2.
    Current Latency @CBSi • 6 Second Segments (2 Second GOPs) – Some BUs testing 2 Second Segments • Players Start 3 Segments Behind Live Edge • Minimum Latency - 18 seconds • Real-World Latency - 25 to 30+ seconds • Proven at Scale to Millions of Concurrent Viewers
  • 3.
    Other Sources ofLatency • Playlist Fetches – Generally runs at half segment duration (3 seconds) • Broadcast Distribution – Satellite Latency – Multiple Generations of Encode/Decode
  • 4.
    Latency Tradeoffs • MaximumPlayer Buffer Length • Rendition / Quality Level • Risk of Rebuffering • Stream Startup Time • Non-Simulcast or Interactive Content
  • 5.
    HLS Low Latencybefore Apple • Custom Tags in HLS Manifests – Designed to be backwards compatible • HTTP/1.1 Chunked Transfer Coding for Segments • Bandwidth Estimation Modifications Needed • Implementations from Periscope & Twitch • HLS.JS RFC - https://github.com/video-dev/hlsjs-rfcs/pull/1 • Approaches for DASH CMAF too (not covering this today)
  • 6.
    Disclaimer • This isNew to Everyone • We are Learning and Experiment across the Industry • Scaling Live is Hard – In General (even without Low Latency) – At Scale – While Maintaining Great QoE – Across an Increasing Number of Devices / Platforms
  • 7.
    References for ALHLS •WWDC Video https://developer.apple.com/videos/play/wwdc2019/502/ • Preliminary Spec https://developer.apple.com/documentation/http_live_streaming/protocol_extension_for_low- latency_hls_preliminary_specification • Blog Post - Phil Harrison (AWS) https://www.linkedin.com/pulse/apples-implementation-low-latency-hls-explained-phil-harrison/ • Blog Post - Phil Cluff (Mux) https://mux.com/blog/the-community-gave-us-low-latency-live-streaming-then-apple-took-it-away/
  • 8.
    Considerations for ALHLS •HTTP is Standard for Online Video Delivery – Segments must become smaller (250ms) • CDNs are essential for scale – CDNs are good at caching, we need to use that • Runway to react is shorter – Switch renditions in 600ms instead of 10s
  • 9.
    Origin API • #EXT-X-SERVER-CONTROLto Advertise Server Support − CAN-BLOCK-RELOAD=YES is Mandatory • _HLS* Query Parameters Reserved − Query Params should be Sorted • Client Requests Different Responses/Behaviors from Origin • CDN must Cache based on Query Params
  • 10.
    5 Components ofALHLS • Partial Segments • Reducing Latency of Segments • Blocking Playlist Requests • Playlist Delta Updates • Faster Rendition Switches
  • 11.
    1 - PartialSegments • Today – 6 Second Segment Only Advertised when Fully Available • Partial Segment every 250ms – Full Segment Must be Available before Advertised • New #EXT-X-PART tag – #EXT-X-PART:DURATION=0.33334,URI="filePart271.4.ts",INDEPENDENT=YES
  • 12.
    1 - PartialSegments (Challenges) • Parts Advertised when Fully Available • Parts in Manifest for 3 Target Durations • I-Frame Required to Start Playback • Full Segment Required after All Parts • New Packagers Required • Can we Share CDN Cache (between Parts & Segments) − HTTP/1.1 Chunked Transfer from Origin to Edge − Query Params for Byte Ranges on Edge (i.e. filePart271.ts?start=0&end=123)
  • 13.
    1 - PartialSegments (Challenges) • Can we Share CDN Cache (between Parts & Segments) − HTTP/1.1 Chunked Transfer from Origin to Edge − Query Params for Byte Ranges on Edge (i.e. filePart271.ts?start=0&end=123) #EXT-X-PART:DURATION=0.33334,URI="filePart271.ts?start=0&end=123" #EXT-X-PART:DURATION=0.33334,URI="filePart271.ts?start=124&end=456" ... #EXTINF:4.00008, filePart271.ts
  • 14.
    2 - ReducingLatency of Segments • Mobile Networks can have high Round Trip Times • HTTP/2 Server Push for Parts − Triggered alongside Manifest − _HLS_push to Indicate Client expects part to be pushed • Link Response Header − Link: </filePart.456.1.ts>; rel=preload; as=video; type=video/mp2t • Challenges − CDN Support Varies − Manifests & Segments on Different Domains/Origins
  • 15.
    3- Blocking PlaylistRequests • Today − Client Polls Manifest for New Segments • Blocking Request for Next Playlist − _HLS_msn for Media Sequence Number − _HLS_part for Part Number • CDN should Batch Requests for Same Playlist
  • 16.
    4 - PlaylistDelta Updates • Today − Playlists Keep Getting Larger • More Frequent Manifest Requests with Low Latency • First Playlist Request as Normal • New #EXT-X-SKIP tag − Indicates number of Skipped Segments • _HLS_skip=YES used on Origin API
  • 17.
    #EXTM3U # Following theexample above, this playlist is a response to: GET https://example.com/2M/waitForMSN.php?_HLS_msn=273&_HLS_part=3&_HLS_report=../1M/waitForMSN.php&_HLS_report=../4M/waitForMSN.php&_HLS_skip=YES #EXT-X-TARGETDURATION:4 #EXT-X-VERSION:9 #EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,PART-HOLD-BACK=1.0,CAN-SKIP-UNTIL=12.0 #EXT-X-PART-INF:PART-TARGET=0.33334 #EXT-X-MEDIA-SEQUENCE:266 #EXT-X-SKIP:SKIPPED-SEGMENTS=3 #EXTINF:4.00008, fileSequence269.ts #EXTINF:4.00008, fileSequence270.ts #EXT-X-PART:DURATION=0.33334,URI="filePart271.0.ts",INDEPENDENT=YES #EXT-X-PART:DURATION=0.33334,URI="filePart271.1.ts" #EXT-X-PART:DURATION=0.33334,URI="filePart271.2.ts" #EXT-X-PART:DURATION=0.33334,URI="filePart271.3.ts" #EXT-X-PART:DURATION=0.33334,URI="filePart271.4.ts",INDEPENDENT=YES #EXTINF:4.00008, fileSequence271.ts #EXT-X-PROGRAM-DATE-TIME:2019-02-14T02:13:60.106Z #EXT-X-PART:DURATION=0.33334,URI="filePart272.a.ts" #EXT-X-PART:DURATION=0.33334,URI="filePart272.b.ts" #EXT-X-PART:DURATION=0.33334,URI="filePart272.c.ts" #EXT-X-PART:DURATION=0.33334,URI="filePart272.d.ts" #EXT-X-PART:DURATION=0.33334,URI="filePart272.e.ts" #EXT-X-PART:DURATION=0.33334,URI="filePart272.f.ts",INDEPENDENT=YES #EXT-X-RENDITION-REPORT:URI="../1M/waitForMSN.php",LAST-MSN=272,LAST-PART=11 #EXT-X-RENDITION-REPORT:URI="../4M/waitForMSN.php",LAST-MSN=272,LAST-PART=11
  • 18.
    5 - FasterRendition Switches • Less Time to React with Low Latency • Include URI to Next Segments of Different Renditions • Adds #EXT-X-RENDITION-REPORT Tag • #EXT-X-RENDITION-REPORT:URI="../1M/waitForMSN.php",LAST-MSN=273,LAST-PART=2 • #EXT-X-RENDITION-REPORT:URI="../4M/waitForMSN.php",LAST-MSN=273,LAST-PART=1 • Spec Mentions LAST-I-MSN and LAST-I-PART Unused • How do we determine which Part we can Switch on? − Is it safe to use INDEPENDENT from Current Renditions Parts?
  • 19.
    Conclusion • A LOTof Moving Pieces • Origin API adds Complexity − For Client, CDN & Origin • Origins Must Become More Dynamic • Lots of Unknowns for SSAI Integration/Support • HTTP/2 & Server Push has Varying Levels of Support • Bypasses Bandwidth Estimation Issues of Other Approaches
  • 20.
    Conclusion • In Betain iOS 13 Beta behind Entitlement − No Safari Support Yet • Sample Script / Tools Provided by Apple • Will this be New Standard for LHLS?
  • 21.