Dynamic Ad Insertion (DAI) supports mid-rolls for both video on demand (VOD) and live linear video content.
For VOD, mid-rolls are only supported when the IMA SDK is used, not with server-side beaconing (SSB).
To correctly display mid-rolls for DAI, you must complete the following:
- Create a content source and enable 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 desired 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 video segment to enable 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 enable mid-rolls for DASH VOD content and as alternative to having DAI conditioning for HLS VOD content.
Define the preconditioned
attribute as true
for the ingestURL element in the MRSS feed. Your MRSS feed must also specify cue points in order for mid-roll ads to show up properly. These requirements apply to both HLS and DASH VOD content.
HLS
- Build HLS manifest to split content
- Place
#EXT-X-PLACEMENT-OPPORTUNITY
marker in the HLS stream file - Define the preconditioned attribute as
true
for the ingestURL element in the MRSS feed. - There should be the same number of cue-points as there are
#EXT-X-PLACEMENT-OPPORTUNITY
markers in the HLS stream.
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 align with a keyframe/IDR frame and it must be at the beginning of the period.
Learn more about the requirements for the preconditioned attribute of the ingestURL feed element.
Conditioned content
If your content is not preconditioned, Ad Manager can condition it for you when the following criteria is met.
- 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>
For any issues related to DAI troubleshooting or outages, contact publisher support.