Notification

Only available in Google Ad Manager 360.

HTTP Live Streaming (HLS)

HLS integration

HTTP Live Streaming (HLS) is an adaptive bitrate live streaming video protocol that enables high quality streaming of video content. DAI for Ad Manager supports HLS version 3. This integration guide details the requirements and recommendations for using HLS.

See which features are supported for live and video on demand
Any features not part of HLS version 3 must be discussed with your Ad Manager account team.
Feature Live linear Video on demand (VOD)
EXTINF Supported  Supported
EXT-X-DATERANGE > SCTE35-IN Supported
EXT-X-DATERANGE > SCTE35-OUT Supported
EXT-X-DISCONTINUITY Supported Supported
EXT-X-DISCONTINUITY-SEQUENCE Supported
EXT-X-ENDLIST * Supported
EXT-X-I-FRAME-STREAM-INF Supported Supported
EXT-X-I-FRAMES-ONLY Supported Supported
EXT-X-INDEPENDENT-SEGMENTS Supported Not supported
EXT-X-KEY Supported Supported
EXT-X-MEDIA (Rendition Groups) Supported Supported
EXT-X-MEDIA-SEQUENCE Supported
EXT-X-PLAYLIST-TYPE Supported Supported
EXT-X-PROGRAM-DATE-TIME Supported Supported
EXT-X-STREAM-INF > AUDIO Supported Supported
EXT-X-STREAM-INF > AVERAGE-BANDWIDTH Supported Supported
EXT-X-STREAM-INF > BANDWIDTH Supported Supported
EXT-X-STREAM-INF > CLOSED CAPTIONS Supported Supported
EXT-X-STREAM-INF > CODECS Supported Supported
EXT-X-STREAM-INF > FRAMERATE Supported Supported
EXT-X-STREAM-INF > RESOLUTION Supported Supported
EXT-X-STREAM-INF > SUBTITLES Supported Supported
EXT-X-STREAM-INF > VIDEO Supported Supported
EXT-X-TARGETDURATION Supported Supported
EXT-X-VERSION Supported Supported

* Supported in live streams for EVENT type playlists only.

 

Jump to a specific section

See specific details about encoding for live linear streams or for video on demand.

Playlists and rendition groups

Deliver playlists using GZIP content-encoding (recommended). Variants in master playlists and segments can use either absolute URLs or relative URLs.

All ad assets are transcoded to include I-FRAME playlists, including slates. Ad Manager DAI does not generate I-FRAME playlists from the content or generate new Rendition Groups based on combinations of video/audio.

  • For live linear: If required, I-FRAME playlists must be generated and conditioned by the encoder/packager. Rendition Groups are delivered as they're generated from the Live encoder.
  • For video on demand (VOD): If required, I-FRAME playlists must be supplied in the master manifest at ingest. Ad Manager will only raise an error if the provided I-FRAME playlist file cannot be accessed or parsed. Rendition Groups are delivered as they are provided in the master manifest.

Codecs and resolution

HLS master playlists for live streams and video on demand (VOD) assets must include the optional CODECS and RESOLUTION attributes. These attributes are used to find suitable ads that match these encoding settings. If these values are not provided, ads are matched based on bandwidth alone and may result in a mismatch of resolution and codecs between ad and content. This can lead to poor user experience and playback issues across different devices.

The CODECS attribute must contain both the audio and the video codecs. Your encoder may add or remove variants to your master playlist URL at any time.

Audio codecs

DAI supports the AAC audio codec. DAI also supports the AC-3 and E-AC-3 (Beta)  codecs, currently in beta.

Keep variant stream URLs consistent for each CODECS and RESOLUTION combination.
You should ensure that your encoder is configured to maintain consistent URLs for each variant URL to prevent playback problems for your users.

Example

A master playlist with CODECS and RESOLUTION

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=694272,CODECS="avc1.77.41,mp4a.40.2",RESOLUTION=768x432
chunklist_b694272.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=202752,CODECS="avc1.66.31,mp4a.40.2",RESOLUTION=480x270
Chunklist_b202752.m3u8

Segment duration

HLS media playlists must have media segment durations declared as decimal-floating-point numbers. The duration should have floating point accuracy to help determine the precise time when an ad break will start and end. The less accurate the duration values, the less accurately the system is able to determine when ad breaks occur in the resulting stream.

Example

A media playlist with #EXTINF

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:26
#EXTINF:9.901,
http://media.example.com/wifi/segment26.ts
#EXTINF:9.901,
http://media.example.com/wifi/segment27.ts
#EXTINF:9.501,
http://media.example.com/wifi/segment28.ts

Timestamp alignment

The Presentation Timestamp (PTS) across segments in variant media playlists must align. P-frame and B-frame refers other frames to decode a frame. The H.264 codec also references frames that are not adjacent for better compression. Since these frames depend on other frames for decoding and presentation, Decode Timestamp (DTS) gives sequence by which frames are decoded and PTS gives sequence by which frames are presented. Aligning PTS is important when you adapt to different bitrate while playback of an asset. Ad insertion uses PTS to find the ad insertion position.

Discontinuity

Any EXT-X-DISCONTINUITY in the media playlist must have EXT-X-DISCONTINUITY-SEQUENCE. The EXT‑X‑DISCONTINUITY‑SEQUENCE tag allows synchronization between different renditions of the same variant stream or different variant streams.

Media encryption

If you want to encrypt the media content, its must be encrypted with AES-128 (encrypts the entire segment), SAMPLE-AES (encrypts individual media, like audio or video), or SAMPLE-AES-CTR. Apple FairPlay stream uses SAMPLE‑AES.

Ad Manager DAI supports DRM technology for HLS streams using FairPlay and other DRMs with CMAF/fragmented MP4.

Example

A media playlist with #EXT-X-KEY

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:26
#EXT-X-KEY:METHOD=AES-128,URI="https://media.example.com/asset/key1.php?id=<signature>",IV=<initialization vector>
#EXTINF:9.901,
http://media.example.com/wifi/segment26.ts
#EXTINF:9.901,
http://media.example.com/wifi/segment27.ts
#EXT-X-KEY:METHOD=AES-128,URI="https://media.example.com/asset/key2.php?id=<signature>"
#EXTINF:9.501,
http://media.example.com/wifi/segment28.ts

For any issues related to DAI troubleshooting or outages, contact publisher support.

Was this helpful?

How can we improve it?
true
Get started with Dynamic Ad Insertion

Our guide to delivering a seamless ad experience across live, linear, and on-demand video content.
See the guide

Search
Clear search
Close search
Main menu
8071573445830535146
true
Search Help Center
true
true
true
true
true
148
false
false