Master m3u8

Each origin server should host a different set-level manifest. The individual stream URLs inside the set level manifest remain the same on all origin servers.

The following is the prescribed order of m3u8 URLs for each bitrate:

  1. URL pointing to the same origin server

  2. URL pointing to the other origin server of the same data center

  3. URLs of origin servers in a different data center in any order

If the set-level m3u8 contains four redundant URLs for the same bitrate, the iOS client picks and fails-over for these streams in the order they are listed. If all set-level manifests list the same first URL, the client load is directed to the same origin server. To distribute the load, ensure that each origin server lists the redundant URLs in a different order in set level m3u8.

The stream name in the m3u8 URL is in the format livestreamN. The stream name hosted by each origin server is "livestream". To differentiate between m3u8 requests for origin servers (in the same data center), modify the stream name in the set-level m3u8. The varnish script can create the following mapping with the modified stream name:

livestream1 => origin 1

livestream2 => origin 2

The system uses the integral suffix attached to the stream name to redirect stream level manifest requests to the appropriate origin. Therefore, ensure that the set-level m3u8 name does not use any suffix that is used by the stream-level m3u8. For example, in above case, the set level m3u8 name must not end with 1.3u8 or 2.m3u8.

In the sample setup, the following should be the top-level or master m3u8 for each origin:

Data Center 1 Origin 1

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_1/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_1/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_1/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_1/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_2/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_2/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_2/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_2/livestream2.m3u8

..

..

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_N/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_N/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_N/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_N/livestream2.m3u8

Origin 2

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_1/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_1/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_1/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_1/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_2/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_2/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_2/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_2/livestream2.m3u8

..

..

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_N/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_N/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_N/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_N/livestream2.m3u8

Data Center 2 Origin 1

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_1/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_1/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_1/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_1/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_2/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_2/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_2/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_2/livestream2.m3u8

..

..

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_N/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_N/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_N/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_N/livestream2.m3u8

Origin 2

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_1/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_1/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_1/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_1,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_1/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_2/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_2/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_2/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_2,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_2/livestream2.m3u8

..

..

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_N/livestream2.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip2/eventX/bitrate_N/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_N/livestream1.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=bitrate_N,PROGRAM-ID=1 reverse-proxy-ip1/eventX/bitrate_N/livestream2.m3u8