All Products
Search
Document Center

Intelligent Media Services:Supported protocol

Last Updated:Mar 06, 2025

Ad insertion supports the HTTP Live Streaming (HLS) protocol. This topic introduces this protocol and related requirements.

HLS

HLS is a streaming protocol designed for delivering audio and video content over HTTP or HTTPS. It divides the content into small segments and creates playlist files in M3U8 format. To retrieve and play the segments, the client requests the M3U8 playlist files.

There are two types of M3U8 playlist files: 

  • Media playlist: contains URLs to the segments. 

  • Master playlist: contains URLs to multiple media playlists, each representing a different variant of the stream. These variants can differ in bitrate, codec and resolution.

Sample master playlist

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=100000,CODECS="mp4a.40.2,avc1.64001e",RESOLUTION=640x302
video/player-ld.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=200000,CODECS="mp4a.40.2,avc1.64001f",RESOLUTION=848x402
video/player-sd.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=300000,CODECS="mp4a.40.2,avc1.640020",RESOLUTION=1280x606
video/player-hd.m3u8

Sample media playlist

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-TARGETDURATION:17
#EXTINF:15.500,
1723518810_120.ts
#EXT-X-DISCONTINUITY
#EXTINF:16.666,
1723518884_121.ts
#EXTINF:2.533,
1723518886_122.ts
#EXT-X-ENDLIST

To use ad insertion, HLS playlists must satisfy the following requirements:

  • The playlists must be accessible on the Internet.

  • The source must be live or video-on-demand (VOD).

  • The playlists must have an EXT-X-VERSION of 3 or higher.

  • The source must have both master and media playlists. The following container formats are supported for segments: Transport Stream (TS) and Common Media Application Format (CMAF).

  • The #EXT-X-STREAM-INF tag in the master playlist must have the RESOLUTION, BANDWIDTH, and CODEC attributes.

  • For live content, media playlists must contain ad markers to delineate ad avails. This is optional for VOD content, which can use VMAP timeoffsets instead.

Ad markers

Sample media playlist with ad markers:

#EXTM3U
#EXT-X-VERSION:6
#EXT-X-PLAYLIST-TYPE:EVENT
#EXT-X-TARGETDURATION:14
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-DISCONTINUITY
#EXT-OATCLS-SCTE35:{BASE64} (optional)
#EXT-X-CUE-OUT:60.00
...
#EXT-X-CUE-OUT-CONT:ElapsedTime=5.0,Duration=10.0,SCTE35={BASE64} (optional)
...
#EXT-X-CUE-IN
#EXTINF:16.666,
1723518884_121.ts
#EXTINF:2.533,
1723518886_122.ts
#EXT-X-ENDLIST

In this example, #EXT-OATCLS-SCTE35, #EXT-X-CUE-OUT, #EXT-X-CUE-IN, and #EXT-X-CUE-OUT-CONT are ad markers.

Segments between #EXT-X-CUE-OUT and #EXT-X-CUE-IN represent ad content.

ADS requirements

To integrate your ad decision server (ADS) with MediaWeaver, the ADS must conform to VAST and VMAP specifications, and other industry standards set by the Interactive Advertising Bureau (IAB).

  • MediaWeaver supports VAST responses from ADS. Only VAST MP4 linear ads are allowed. A VAST response can contain a set of ad creatives. For each creative, MediaWeaver prioritizes MediaUrl with highest resolution.

  • MediaWeaver supports VMAP responses from ADS. The URL in AdTagURI must reference a VAST response.

References

For IAB standards, see IAB Tech Lab.

For information about VAST, see Digital Video Ad Serving Template (VAST).

For information about VMAP, see Video Multiple Ad Playlist (VMAP).