Dynamic Ad Insertion (DAI) supports mid-roll ad insertion for video on demand (VOD) content.
To correctly display mid-rolls for DAI, you must complete the following:
- Create a content source and activate mid-rolls.
- Either create a mid-roll CDN configuration (supported for HLS only) or ensure your content is conditioned to handle desired ad break timing.
- Configure your Ad Manager ad rules to return a list of ads at the appropriate times.
Ensure your content is conditioned to handle ad break timing
Mid-roll ad breaks for DAI may not fall on the typical video segment boundaries for your stream.
The process of dividing a content video segment to activate 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.
All DASH VOD content must be preconditioned.
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.
Preconditioned content
Content is considered "preconditioned" if the video stream is segmented precisely to align with the cue points where ads will be inserted. Preconditioning is required to activate mid-rolls for DASH VOD content and as alternative to having DAI conditioning for HLS VOD content.
Criteria to ingest preconditioned content
For both HLS and DASH VOD content, you must define the preconditioned
attribute as true
for the ingestURL element in the MRSS feed. Also, your MRSS feed must specify cue points in order for mid-roll ads to show up properly.
HLS
- Build HLS manifest to split content
- Define the preconditioned attribute as
true
for the ingestURL element in the MRSS feed - Place markers in the HLS stream file to indicate ad placement opportunities. Available markers are:
#EXT-X-PLACEMENT-OPPORTUNITY
- The number of
#EXT-X-PLACEMENT-OPPORTUNITY
markers must equal the number of cue points
- The number of
#EXT-X-CUE-OUT
and#EXT-X-CUE-IN
(Beta)- Any content that exists between the
#EXT-X-CUE-OUT
and#EXT-X-CUE-IN
markers will be cut out and replaced by DAI stitched ads - Any
#EXT-X-CUE-OUT
and#EXT-X-CUE-IN
markers at the beginning or end of the playlist are ignored as these markers are only for mid-roll ad insertion - The number of
#EXT-X-CUE-OUT
and#EXT-X-CUE-IN
marker pairs must equal the number of cue points
- Any content that exists between the
DASH VOD
- Media presentation must be broken into multiple periods with each mid-roll cue point falling on a period boundary
- Content segments at the beginning and end of each period must be prepared so that every frame in the segment is included in the period
- Cue points must be followed by a period starting with a keyframe/IDR frame
Learn more about the requirements for the preconditioned attribute of the ingestURL feed element.
Unconditioned content
If your HLS content is not preconditioned, Ad Manager can condition it for you when the following criteria is met.
Criteria for Ad Manager to be able to condition your content
- The MRSS feed must contain the
<dfpvideo:cuepoints>
parameter to specify the timing of ad breaks - A mid-roll CDN location must be provided where Ad Manager can save your conditioned content
<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">
<vmap:AdBreak timeOffset="start" breakType="linear" breakId="preroll">
<vmap:AdSource id="preroll‑ad‑1" allowMultipleAds="false" followRedirects="true">
<vmap:AdTagURI templateType="vast3">
<![CDATA[
https://securepubads.g.doubleclick.net/gampad/ads?
slotname=/124319096/external/ad_rule_samples&sz=640x480&ciu_szs=300x250&unviewed_position_start=1&output=xml_vast3&impl=s&env=vp&gdfp_req=1&ad_rule=0&vad_type=linear&vpos=preroll&pod=1&ppos=1&lip=true&min_ad_duration=0&max_ad_duration=30000&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&url=&video_doc_id=short_onecue&cmsid=496&kfa=0&tfcd=0
]]>
</vmap:AdTagURI>
</vmap:AdSource>
</vmap:AdBreak>
<vmap:AdBreak timeOffset="00:00:15.000" breakType="linear" breakId="midroll‑1">
<vmap:AdSource id="midroll‑1‑ad‑1" allowMultipleAds="false" followRedirects="true">
<vmap:AdTagURI templateType="vast3">
<![CDATA[
https://securepubads.g.doubleclick.net/gampad/ads?
slotname=/124319096/external/ad_rule_samples&sz=640x480&ciu_szs=300x250&unviewed_position_start=1&output=xml_vast3&impl=s&env=vp&gdfp_req=1&ad_rule=0&vad_type=linear&vpos=midroll&pod=2&mridx=1&ppos=1&lip=true&min_ad_duration=0&max_ad_duration=30000&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&url=&video_doc_id=short_onecue&cmsid=496&kfa=0&tfcd=0
]]>
</vmap:AdTagURI>
</vmap:AdSource>
</vmap:AdBreak>
<vmap:AdBreak timeOffset="end" breakType="linear" breakId="postroll">
<vmap:AdSource id="postroll‑ad‑1" allowMultipleAds="false" followRedirects="true">
<vmap:AdTagURI templateType="vast3">
<![CDATA[
https://securepubads.g.doubleclick.net/gampad/ads?
slotname=/124319096/external/ad_rule_samples&sz=640x480&ciu_szs=300x250&unviewed_position_start=1&output=xml_vast3&impl=s&env=vp&gdfp_req=1&ad_rule=0&vad_type=linear&vpos=postroll&pod=3&ppos=1&lip=true&min_ad_duration=0&max_ad_duration=30000&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&url=&video_doc_id=short_onecue&cmsid=496&kfa=0&tfcd=0
]]>
</vmap:AdTagURI>
</vmap:AdSource>
</vmap:AdBreak>
</vmap:VMAP>