Live Streaming: RTMP and HLS
KeyCDN supports HTTP Live Streaming (HLS) based on a normal Pull Zone. This article describes shortly each protocol and elaborates the high level concept implemented by KeyCDN how live streaming can be done.
Real Time Messaging Protocol (RTMP)
RTMP is used to stream audio, video or data and is originally a proprietary protocol introduced by Macromedia (owned by Adobe). The protocol is TCP-based and offers therefore persistent connections. In short, RTMP encapsulates MP3/AAC audio and MP4/FLV video multimedia streams.
If you do live streaming with KeyCDN, RTMP will not be used for video delivery to end users. If the streaming software is based on RTMP, you can use this protocol to initially stream your content to your server or a third party service that transforms the RTMP stream to HLS. A wide range of RTMP encoders can be used to create the live stream (e.g. FMLE, OBS, or WireCast).
HTTP Live Streaming (HLS)
HTTP Live Streaming is known as HLS. As the name implies, it is the media streaming communications protocol based on HTTP; developed by Apple as part of their QuickTime, Safari, macOS, and iOS products.
How does it work? It breaks the overall stream into a sequence of small HTTP-based transport stream (
.ts) files. These transport stream files are indexed in the UTF-8 M3U playlist (
.m3u8) file. It is required to first download the M3U8 playlist to play a live stream.
Why HLS for live steaming?
iOS devices do not support RTMP and most web-based players such as JW player or Flowplayer require the Flash based version to play RTMP streams, but iOS devices can not handle the Flash players. The only proper solution is HLS.
How does live streaming work with KeyCDN?
If you do live streaming with KeyCDN, video delivery to end users is based on HLS (not RTMP). The basic sequence looks like this:
RTMP encoder > Encoding (from RTMP) to HLS > Pull Zone
The HLS feature for Pull Zones (called Optimize for HLS) manages the different HLS files accordingly. The index file (
.m3u8) will not be cached. The actual video files (
.ts) will be cached for 5 minutes. The following Zone settings are automatically updated:
- Expire to
- Max Expire to
5(relevant for the
- Ignore Cache Control to
The HLS stream will then be pulled from your Origin URL (either your own server or a third party service that offers HLS). It's also possible to use different ports to pull the content from your HLS source (e.g.
Here is an example of how to integrate HTTP Live Streaming (HLS) with JW Player: