Only available in Google Ad Manager 360.

HTTP Live Streaming (HLS) encoder integration

Ad Manager DAI supports HLS version 3. Any features not part of HLS version 3 must be discussed with your Ad Manager account team.

See which features are supported

Feature Live linear Video on demand (VOD)
EXTINF Supported  Supported
EXT-X-DATERANGE  Supported
SCTE35-IN Not supported
SCTE35-OUT Not 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 Supported Supported
AUDIO Supported Supported
AVERAGE-BANDWIDTH Supported Supported
BANDWIDTH Supported Supported
CLOSED CAPTIONS Supported Supported
CODECS Supported Supported
FRAMERATE Supported Supported
RESOLUTION Supported Supported
SUBTITLES Supported Supported
VIDEO Supported Supported
EXT-X-TARGETDURATION Supported Supported
EXT-X-VERSION Supported Supported

* Supported in live streams for EVENT type playlists only.

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: 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 or SAMPLE-AES. AES-128 encrypts or scrambles the TS while SAMPLE‑AES scrambles individual media (audio or video). Apple FairPlay stream uses SAMPLE‑AES.

Ad Manager DAI supports FairPlay DRM technology for HLS streams.

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

Video on demand encoding

Conditioning for mid-rolls

If you need to serve mid-roll ads in your content, the video segments must either be pre-conditioned or conditioned.

Mid-roll ad breaks for DAI may not fall on the typical video segment boundaries for your stream. For example, your content may normally be divided into 10-second segments, but you may require an ad break at 0:36 (36 seconds). In this case, you need to divide a 10-second video into 2 separate segments that are 6 seconds and 4 seconds, respectively, allowing for an ad to be inserted at the correct time. The process of dividing a video segment to allow an ad break is called "content conditioning".

In order to support the insertion of ads at the desired ad break locations, you must either provide content that is preconditioned or content that is able to be conditioned by Ad Manager.

GOP size

Media must be encoded with a keyframe every 2 seconds or GOP (group of pictures) size of 2 seconds. Content is prepared for mid-roll ad break insertion at the closest keyframe. If there is no keyframe within one second of cue point, insertion of ads beyond a second from cue point will lead to a poor user experience during playback. To prevent this, if a keyframe cannot be found within one second of the indicated cue point, an ad break will not be inserted.

It is recommended that you provide 1-2 seconds of creative blacks around the cue points for seamless transition between content and ads. This gives a fade-to-black TV experience around the ad breaks.

Closed captions

The following closed caption formats are supported:

  • Input formats: TTML (sidecar), WebVTT (sidecar), CEA 608/708
  • Output formats: TTML (sidecar), WebVTT (sidecar), WebVTT - HLS

Ad Manager converts the input format to output format.

Live linear encoding

Create CUE-OUT and CUE-IN points in the playlist representing the ad insertion splice points for a linear broadcast or live feed:

#EXT-X-CUE-OUT:DURATION=<time>
#EXT-X-CUE-IN

The EXT-X-CUE-OUT tag represents the splice start point and EXT-X-CUE-IN represents the splice end point. EXT-X-CUE-OUT should be terminated by EXT-X-CUE-IN, indicating the end of the ad break. The ad server replaces the entire section between EXT-X-CUE-OUT and EXT-X-CUE-IN with video ad content.

The DURATION=<time> is required, and is the approximate duration in seconds or floating point of the ad break (in other words, the difference in the time between the EXT-X-CUE-IN and EXT-X-CUE-OUT). Alternately, EXT-X-CUE-OUT:<time> can be substituted for #EXT-X-CUE-OUT:DURATION=<time>.

The duration can be an integer or a floating-point value and should have a value expressed in seconds.

See examples

Example 1

Splice start point and end point

#EXTINF:10,
http://media.example.com/fileSequence7796.ts
#EXTINF:6,
http://media.example.com/fileSequence7797.ts
#EXT-X-CUE-OUT:DURATION=30
#EXTINF:4,
http://media.example.com/fileSequence7798.ts
#EXTINF:10,
http://media.example.com/fileSequence7799.ts
#EXTINF:10,
http://media.example.com/fileSequence7800.ts
#EXTINF:6,
http://media.example.com/fileSequence7801.ts
#EXT-X-CUE-IN
#EXTINF:4,
http://media.example.com/fileSequence7802.ts
#EXTINF:10,
http://media.example.com/fileSequence7803.ts
#EXTINF:3,
http://media.example.com/fileSequence7804.ts

Example 2

Content between OUT and IN is replaced by the DAI ad server with 30 seconds of ad video content

#EXTINF:10,
http://media.example.com/fileSequence7796.ts
#EXTINF:6,
http://media.example.com/fileSequence7797.ts
#EXT-X-CUE-OUT:DURATION=30
#EXTINF:10,
http://ads.example.com/fileSequence0001.ts
#EXTINF:10,
http://ads.example.com/fileSequence0002.ts
#EXTINF:10,
http://ads.example.com/fileSequence0003.ts
#EXT-X-CUE-IN

#EXTINF:4,
http://media.example.com/fileSequence7802.ts
#EXTINF:10,
http://media.example.com/fileSequence7803.ts
#EXTINF:3,
http://media.example.com/fileSequence7804.ts

Supported ad markers

CUE-OUT/CUE-IN

These markup types are generated by several encoding solutions, including AWS Elemental.

The format is as follows:

CUE-OUT

#EXT-X-CUE-OUT:DURATION=10.50,K=V

#EXT-X-CUE-OUT:10.50,K=V

Ad Manager currently only supports passing BREAKID as a key-value in the CUE-OUT.

CUE-IN

#EXT-X-CUE-IN

CUE (Adobe Prime Time)

CUE-OUT

#EXT-X-CUE:ID=31264,TYPE="SpliceOut",DURATION=30.00,TIME=77892728.264567

CUE-IN

These markups do not have an explicit CUE-IN indicator. Instead, they mark every segment after the CUE-OUT with the following:

#EXT-X-CUE:ID=31264,TYPE="SpliceOut",DURATION=30.00,TIME=77892728.264567,ELAPSED=5.00

This indicates the placement of a segment inside of an ad break. A CUE-IN marker is calculated using the value of the ELAPSED attribute along with the duration of segment to indicate the last segment of the break.

DATERANGE

SCTE targeting data is not supported for this format.

CUE-OUT

#EXT-X-DATERANGE:ID="splice-80f",PLANNED-DURATION=90.5,START-DATE="2017-03-24T13:46:04Z",SCTE35-OUT=0xFC301B00000000000000FFF00A05000001027FDF000000

The value of the PLANNED-DURATION attribute is used as the expected ad break duration.

CUE-IN

#EXT-X-DATERANGE:ID="splice-7ef",START-DATE="2017-03-24T13:38:04Z",SCTE35-IN=0xFC301B00000000000000FFF00A05000000FF7F5F0000000000007B7BA160

SCTE35 Binary Splice Insert

SCTE35 Splice In and Out indicators can be specified via time signals in HLS tags. The SCTE information is available in binary format and needs to be decoded in order to determine the type of signal being sent.

CUE-OUT

#EXT-OATCLS-SCTE35:/DAlAAAAAAAAAP/wFAUAAA+if+/+INAJ0P4AKTLgAAAAAAAA9UTkTA==

CUE-IN

#EXT-OATCLS-SCTE35:/DAgAAAAAAAAAP/wDwUAAAPvf0//ahTGjwAAAAAAALda4HI=

SCTE35 Binary Time Signal: Provider Ad Start/End

SCTE-35 binary (base64 encoded) data has to be decoded and parsed in order to determine if it contains valid CUE-OUT/CUE-IN, along with any break targeting information.

For example, the following binary data contains a valid CUE-OUT signal:

#EXT-OATCLS-SCTE35:/DBcAAAAAAAAAP/wBQb//ciI8QBGAh1DVUVJXQk9EX+fAQ5FUDAxODAzODQwMDY2NiEEZAIZQ1VFSV0JPRF/3wABLit7AQVDMTQ2NDABAQEKQ1VFSQCAMTUwKnPhdcU=

Once decoded, the message contains the following fields:

  • splice_command_type set to a value of 6 indicates this is a time signal
  • segmentation_type_id indicates the type of time signal

The following segmentation_type_id value is recognized as a valid CUE-OUT time signal:

48 : Provider Advertisement Start

If the break duration is provided in both EXT-X-CUE-OUT:DURATION and SCTE segment_duration fields, DAI will use the value from EXT-X-CUE-OUT.

The following segmentation_type_id value (when splice_command_type = 6) is recognized as a valid CUE-IN time signal:

49 : Provider Advertisement End

SCTE35 Binary Time Signal: Provider Placement Opportunity

SCTE-35 binary (base64 encoded) data has to be decoded and parsed in order to determine if it contains valid CUE-OUT/CUE-IN, along with any break targeting information.

For example, the following binary data contains a valid CUE-OUT signal:

#EXT-OATCLS-SCTE35:/DA0AAAAAAAA///wBQb+cr0AUAAeAhxDVUVJSAAAjn/PAAGlmbAICAAAAAAsoKGKNAIAmsnRfg==

Once decoded, the message contains the following fields:

  • splice_command_type set to a value of 6 indicates this is a time signal
  • segmentation_type_id indicates the type of time signal

The following segmentation_type_id value is recognized as a valid CUE-OUT time signal:

52 : Provider Placement Opportunity Start

If the break duration is provided in both EXT-X-CUE-OUT:DURATION and SCTE segment_duration fields, DAI will use the value from EXT-X-CUE-OUT.

The following segmentation_type_id value (when splice_command_type = 6) is recognized as a valid CUE-IN time signal:

53 : Provider Placement Opportunity End

Macros for SCTE-35 markup

If your feed includes EXT-OATCLS-SCTE35 markup, the metadata is automatically extracted and made available through custom key-values. You need to set up the custom key-values, and insert them as macros when you generate ad tags.

When you set up the new custom key-values for the SCTE-35 fields, use a custom key (for example, "scte35") and set the value to the macro(s) that correspond to which type of field is available in your feed:

  • %%SPLICE_INSERT_EVENT_ID%%
  • %%SPLICE_INSERT_UPID%%
  • %%TIME_SIGNAL_EVENT_ID%%
  • %%TIME_SIGNAL_UPID%%
  • %%TIME_SIGNAL_UPID_RAW%%
  • %%AFMM_CBC%%
  • %%SPLICE_INSERT_EVENT_ID%%, %%SPLICE_INSERT_UPID%%, and %%TIME_SIGNAL_EVENT_ID%%, which are unsigned integers in the SCTE35 message, are converted to strings as decimal numbers.
  • %%TIME_SIGNAL_UPID%% is rendered as lowercase hexadecimal, with no 0x prefix.
  • %%TIME_SIGNAL_UPID_RAW%% inserts raw bytes from the SCTE message without hexadecimal conversion (the initial string must be a valid UTF-8 encoded string).
  • %%AFMM_CBC%% extracts the commercial break code from the splice info (this is a requirement for the French AF2M specification).

Frequently asked questions

  • How do I end an ad break early?
    The encoder should send in a "CUE-IN" in the stream to indicate that the DAI streams should immediately end the ad break and begin showing the raw content again.
  • How do I make an ad break longer?
    There is no way to make an ad break longer while the ad break is playing to users, but an encoder may send an additional a "CUE-OUT" in the stream immediately after the previous ad break’s "CUE-IN", which would create an additional ad break with freshly decisioned ads.
  • What happens if there are no ads to show?
    The user will either see slate content or the underlying content, depending on the setting that was chosen when the live stream was configured in Ad Manager DAI.
 

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

Was this helpful?
How can we improve it?

Need more help?

Sign in for additional support options to quickly solve your issue

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
Google apps
Main menu
Search Help Center
true
148
false