VAST-2-SGAI Service
VAST-2-SGAI Service
This project was carried out during the MonteVIDEO SummerCamp 2025. David Hassoun's proposal was to create a service that could convert any VAST response from an Ad Server into Asset Lists or ListMPD, with the goal of providing the community with an open-source project that is easy to implement, thus quickly unlocking all the benefits of Server-Guided Ad Insertion.
During the project, not only was this conversion implemented, but plugins were also developed to enable hls.js to track ads and display redirection links to advertisers.
What is VAST?
VAST (Video Ad Serving Template) is an XML-based standard developed by the IAB for delivering video ads across different platforms. It enables ad servers to communicate with video players, ensuring seamless ad playback, tracking, and reporting. Key features include ad linearity, skippability, multiple creative formats, impression tracking, and error handling.
Keep in mind that:
VAST is the most common interface by many Ad servers
Has support for tracking events like impressions and quartile tracking
It is widely used for SSAI and CSAI
VAST response example
What about SGAI?
Server-Guided Ad Insertion (SGAI) is a method where ad insertion is guided by the server through HLS and DASH manifests. In this process, the packager determines when ads should be inserted by using markers such as Interstitial Markers in HLS or AlternativeMPD Events in DASH.
When the player detects these markers in the manifest, it then requests the corresponding ad content from the ad server.
To return multiple Ads in HLS, we can provide an Asset List, which is a JSON containing the URL and duration of each ad. On the other hand, with DASH, we can return a ListMPD, which also informs the player about the ads that should be played at the event specified by the AlternativeMPD event.
To know more about SGAI in MPEG DASH also checkout our Server-Guided Ad Insertion in dash.js demo
HLS Manifest with interstitials example
VAST-2-SGAI
During the MonteVIDEO SummerCamp 2025 we built a proxy between the Ad server and the player that provides everything needed for the player to play ads using SGAI.
This service is decoupled and packager agnostic, run with docker and it's a stateless microservice that scales with user views.
How it Works:
The packager ads the interstitial marker where the Asset List or LIstMPD is a VAST-2-SGAI service endpoint
The player palys the content and ask for the AsstList when the intersttiital is about to start
The VAST-2-SGAI solves the VAST URL, get it's content and creates the AssetList response
The player shows the Ads to the user.
Ads Tracking for SGAI
No tracking, no money 💸 Ad providers need to know which ads were played and how much of them was watched. Was the ad fully viewed? Was it watched halfway? SVTA is currently working in the SVTA2053: Ad Creative Signaling in DASH and HLS for transporting tracking information from the VAST response of the Ad server in HLS and DASH.
In this project, we have developed a plugin for hls.js that listens for interstitial events and processes the tracking payload defined by SVTA, present in the asset list, to enable this tracking.
To view this demo, it is recommended to inspect the Network tab in the developer tools to observe the tracking requests once the interstitial content is playing.
Summer Project Demos
Check out the final demo of the VAST-2-SGAI MonteVIDEO Summer Project 2025 and learn about the challenges we faced, the lessons we learned, and the decisions we made to build this open-source service.
Short technical demo
In this video you will watch a 3 minutes demo of hls.js playing 2 ads extracted from a VAST file using the VAST-2-SGAI project.
Long demo
Learn everything about the Summer Project, the learning we had, what we built and all the details behind the implementation.
Main Project Contributors
David Hassoun
Nicolas Levy
Matthias Van Parijs
Nicolas Bertillod
Javier Aramberi
Ben Rolling
Robet Walch
hls.js is SGAI Ready!
A special thanks to Robert Walch, maintainer of hls.js, for his exceptional work and his help in implementing HLS Interstitials, which is currently available in hls.js 1.6.0-beta.2.
Service API
Depending on whether HLS or DASH is used, VAST-2-SGAI binds two APIs to return either Asset Lists or ListMPD. This endpoint must be added by the Packager in the HLS or DASH manifests so that the player can request interstitial content through this service's APIs.
Endpoints:
HLS Asset List API: /api/asset-list?<method>&<extra_params>
DASH ListMPD API: /api/list-mpd?<method>&<extra_params>
Service Config
Using the following parameters, the microservice can be configured through environment variables (ENV). As shown in the table below, these parameters are designed to authorize specific domains where the player runs (ORIGIN_WHITELIST), allow certain ad servers (VAST_WHITELIST), or map IDs to VAST URLs (VAST_MAPPING_JSON). The latter enables changing ad servers for a set of content without the need to reprocess the manifests.