Minimum Ad server


Here is a Minimum Ad server that serves pre-roll ad to Roku player.

This server is just a web server which hosts three items:
1. the VMAP: http://riowing.net/p/vmap.xml
2. the VAST: http://riowing.net/p/vast.xml
3. the ad .mp4 file: http://riowing.net/p/DfpAdPreroll.mp4

The video content, some gym training, is hosted here: http://riowing.net/p/Gym8s.mp4
Here is the screen recording that this ad plays on Roku Ultra.


The demo channel source code that plays this ad can be found at http://riowing.net/p/DemoRAF4RSG.zip,
which is based on Nas’s RAF demo.

Advertisements

Sequence of video ad


Here is a sample sequence, using preroll as an example.
get VMAP, Video Multiple Ad Playlist, form DFP, e.g. vmap.xml, which has preroll midroll ad.
vmap.xml look like this, with URLs for preroll:
<vmap:VMAP
<vmap:AdBreak
<vmap:AdTagURI
https://pubads.g.doubleclick.net/gampad/ads?url=https://developers.google.com/&#8230;

The AdTagURI above returns a preroll ad, which is a VAST, e.g. vast.xml, and looks like the following:
<!–?xml

<?xml
<VAST
<Ad id=”7096…..”>
<InLine>
<Impression> https://securepubads.g.doubleclick.net/pcs/view?xai=AKA
<Creatives>
<Creative id=”578610…..
<Linear>
<Duration>00:00:10
<TrackingEvents>
<Tracking event=”start”> https://pubads.g.doubleclick.net/pagead/ai=BZK9Sr&#8230;
<VideoClicks>
<ClickThrough id=”GDFP”> https://pubads.g.doubleclick.net/pcs/click?xai=AK&#8230;
<MediaFiles>
<MediaFile id=”GDFP” https://redirector.gvt1.com/video../id/5bad…/file.mp4

Some of the key fields are:
Impression: call this URL to tell that this ad has been viewed.
Tracking: call this URL to tell that the video ad has started playing
ClickThrough: the URL to go to when the ad is clicked.
MediaFiles: the .mp4 if the video ad

For JW Player, vast.xml is passed into Setup() as:
advertising.schedule.adbreak1.tag, with adbreak1.offset=pre

SSAI


Here is one way of doing SSAI, Server Side Ad Insertion
Encoder outputs with SCTE35 metadata track gets translated to HLS.
Live video input in HSL origin.m3u8, with markers like this:
#EXT-X-VERSION:3
#EXT-X-CUE-OUT:9 ad time start here, for 9 seconds
#EXT-X-CUE-OUT-CONT:ElapsedTime=4,Duration=9 ad time 4 seconds passed
…more EXT-X-CUE-OUT-CONT
#EXT-X-CUE-IN ad time ends
Ad insertion service replace the things like EXT-X-CUE* with ad segments ad.ts
Ad insertion service output regular playlist dai.m3u8
Player requests dai.m3u8, which includes things like movie234.ts and ad23.ts
Player requests movie234.ts from CDN, and ad23.ts from Ad insertion service

Pros:
More reachable players: Player doesn’t have to do the stitching since server does it
Harder to block the ads:
Hard to detect ads: No calls are made to DFP asking what ad to play
There is no ready-to-use movie stream

Cons:
More likely fraud: no need to fake many players; just fake the server.
since the server sends ad impression tracking on the player’s behalf, even with X-Forwarded-For

CSAI


Client side ad insertion flows like this:
Video comes in with SCTE35 to indicate ad breaks.
Client send VAST request to DFP for ad video URL.
Insert the ads video into main video.
Video experience is not as good due to delay and different resolution and FPS.
These ads can be blocked too by detecting ad video from known ad server.