Live streaming via CDN using the HLS protocol

By default, if your stream is in HLS format, we will just proxy it through CDN-servers to the end-users.

To configure the service:

 

Cache settings for playlists and video segments

You can set cache settings for playlists (.m3u8) and video segments (.ts) either on your origin or in the control panel.

 

Origin setup recommendations

Set the Cache-Control HTTP header to:

  • 1 minute for video segments (.ts) — the time of caching should be a bit longer than the length of a video segment (.ts) 
  • 1-2 seconds for playlists (.m3u8)

By default, CDN servers inherit all HTTP headers from your origin and follow the stated directives. 

 

Control panel setup recommendations:

1. Configure a personal account

Create rules for video segments and playlists from prepared templates:

Video segments (.ts)

  • In the resource settings, go to the Rules tab and click the Create rule button.
  • Select the Playlists template (.m3u8) template.

    __________________.png
  • Click the Create rule button.

Playlists (.m3u8)

  • In the resource settings, go to the Rules tab and click the Create rule button.
  • Select the Playlists template (.m3u8) template.

    ______________________.png
  • Click Add rule button.

 

2. Integrate the stream with the CDN

Change your domain address in URLs to your CDN domain name.  Check CNAME settings beforehand.

For example, a stream URL from origin: http://domain/playlist.m3u8

The stream URL from CDN: http://cdn.domain/playlist.m3u8

You can check your stream in any player that supports online HLS streaming (for example, VLC).

 

3. Configure file caching through RAM

Important! If you plan to stream VOD, please,  skip this step.

In order to configure file caching through RAM instead of through hard drives, go to the CDN resources, click the three dots next to the resource for Live streaming and choose Turn on LIVE STREAMING preset

____________________.png

To turn off the preset, go to the CDN resources, click the three dots next to the resource for Live streaming and choose Turn off LIVE STREAMING preset

_____________________.png

 

4. Share your stream

Publish the updated stream URL on your website.

If you expect more than 100 viewers from different locations, we strongly recommend you activate origin shielding to reduce the load on your origin.

 

Was this article helpful?
Recently viewed articles