Backup or redundant HLS stream

HLS redundant streams are an often forgotten part of HLS's functionality. The videojs framework supports backup or redundant HLS stream by default..

Some of users may not know about it, may not understand how it works or how to setup failover for his HLS stream.

When you're live streaming, everything has to go off perfectly, every time. Sometimes though there are several fundamental risks - BGP leaks, large-scale CDN outages, which present significant problems to even the largest streaming video platforms.

HLS redundant streams feature allows you to define multiple HLS renditions in your manifest that have identical characteristics, but other than primary URL, allowing the player to treat these as a redundant set, for failover purposes.

Redundant (backup) streams are configured within the HLS manifest, and it looks something like this:

Code snippet
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=3689000,CODECS="avc1.100.31,mp4a.40.2",RESOLUTION=1920x1080
https://primary-cdn.com/1080p/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=3689000,CODECS="avc1.100.31,mp4a.40.2",RESOLUTION=1920x1080
https://secondary-cdn.com/720p/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2150000,CODECS="avc1.100.31,mp4a.40.2",RESOLUTION=1080x720
https://primary-cdn.com/720p/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2150000,CODECS="avc1.100.31,mp4a.40.2",RESOLUTION=1080x720
https://secondary-cdn.com/1080p/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=890000,CODECS="avc1.100.31,mp4a.40.2",RESOLUTION=640x360
https://primary-cdn.com/360p/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=890000,CODECS="avc1.100.31,mp4a.40.2",RESOLUTION=640x360
https://secondary-cdn.com/360p/index.m3u8

The redundant renditions in this manifest are identified by the player by checking for an identical EXT-X-STREAM-INF line.

In general, videojs player look for 4XX or 5XX status codes on either segment or manifest downloads, in order to trigger a failover.

Backup or redundant streams are supported by both Videojs HLS engines: HTTP Streaming and alternative HLS.js

Nuevodevel Blog
Nuevodevel Tweeter