In today’s streaming landscape, delivering personalized, seamless ad experiences is key, and Server-Guided Ad Insertion (SGAI) is leading the charge. Unlike traditional Client-Side Ad Insertion (CSAI), where the user’s device manages ads, SGAI centralizes control at the server level. It decides the timing, format, and content of ads based on user data, ensuring ad relevance without relying on the client’s system. By connecting to ad decision servers (ADS), SGAI generates tailored ad breaks in real-time, keeping viewers engaged with ads that suit their preferences and demographics.
How SGAI Works
Servers can schedule interstitials by placing EXT-X-DATERANGE tags in Media Playlists, allowing flexibility in ad placements. These interstitials, which must be VOD assets, can be inserted at any point in a primary asset, whether VOD or live, including Low-Latency HLS streams.
#EXTM3U
#EXT-X-TARGETDURATION:4
#EXT-X-MEDIA-SEQUENCE:11
#EXT-X-PROGRAM-DATE-TIME:2024-10-30T12:52:27.853+0100
#EXTINF:4,
fileSequence11.ts
#EXT-X-PROGRAM-DATE-TIME:2024-10-30T12:52:31.853+0100
#EXTINF:4,
fileSequence12.ts
#EXT-X-PROGRAM-DATE-TIME:2024-10-30T12:52:35.853+0100
#EXTINF:4,
fileSequence13.ts
#EXT-X-PROGRAM-DATE-TIME:2024-10-30T12:52:39.853+0100
#EXTINF:4,
fileSequence14.ts
#EXT-X-PROGRAM-DATE-TIME:2024-10-30T12:52:43.853+0100
#EXTINF:4,
fileSequence15.ts
#EXT-X-DATERANGE:ID="ad_slot0",CLASS="com.apple.has.interstitial",START-DATE="2024-10-30T12:52:47.207+01:00",DURATION=10,X-ASSET-LIST="http://localhost:3333/interstitials.m3u8?_HLS_interstitial_id=ad_slot0",X-RESTRICT="SKIP,JUMP",X-RESUME-OFFSET=10,X-SNAP="IN,OUT"
#EXT-X-PROGRAM-DATE-TIME:2024-10-30T12:52:47.853+0100
#EXTINF:4,
fileSequence16.ts
#EXT-X-PROGRAM-DATE-TIME:2024-10-30T12:52:51.853+0100
#EXTINF:4,
fileSequence17.ts
#EXT-X-PROGRAM-DATE-TIME:2024-10-30T12:52:55.853+0100
#EXTINF:4,
fileSequence18.ts
In this playlist, an EXT-X-DATERANGE tag schedules a 10-second ad break to play at the specified time point. The player loads the resource specified by the URL after buffering the primary asset to the scheduled interstitial playback time, and then resumes playback of the primary asset at the live edge. Seeking and scanning forward will be disabled during interstitial playback. It is also possible to include custom attributes to be processed by the client.
{
"ASSETS":[
{
"URI": "http://localhost:3333/interstitials.m3u8?_HLS_interstitial_id=ad_slot0&_HLS_primary_id=40FE1829-438E-49B0-8B3A-A285DD4A8154&_HLS_start_offset=0&_HLS_follow_id=361434bf-05e7-4e17-83ca-690452e1cb33",
"DURATION":5
},
{
"URI": "http://localhost:3333/interstitials.m3u8?_HLS_interstitial_id=ad_slot0&_HLS_primary_id=40FE1829-438E-49B0-8B3A-A285DD4A8154&_HLS_start_offset=5&_HLS_follow_id=eb805a34-1d61-4217-9632-deab8790c30d",
"DURATION":5
}
]
}
In this example, the returned JSON object from the X-ASSET-LIST URL includes two 5-second ads. Their URI includes query parameters to identify ad slots, individual ads, and user sessions, making late binding to ad inventory possible and ad personalization easier.
Compared to SSAI and CSAI
SGAI vs. SSAI: Both SGAI and SSAI stitch ads server-side, but SGAI offers finer control over targeting and adapts dynamically to real-time user data. While SSAI lacks some targeting precision, SGAI’s server-level adjustments allow for improved ad personalization.
SGAI vs. CSAI: CSAI places ads on the client side, allowing for tracking data but also making ads prone to blockers and playback glitches. SGAI, on the other hand, provides a seamless experience and improved protection from ad blockers, enhancing both viewer engagement and revenue.
Our SGAI Proxy Tool
As a Proof of Concept, Eyevinn's SGAI Ad Proxy serves as a practical tool that facilitates the integration of ads into HLS content. This lightweight HTTP proxy server intercepts the video stream and inserts ads at defined time points.
Steps to Use the Ad Proxy Tool
-
Set Up the Environment:
- Create an HLS Stream: Use
ffmpeg
to set up a basic HLS streaming server. - Ad Server: Ensure access to a compatible ad server serving VAST-compliant ads.
- Create an HLS Stream: Use
-
Choose Ad Insertion Mode:
- Select either static mode (fixed intervals) or dynamic mode (on-demand insertion).
Run the Proxy Server.
-
To Insert Ads Dynamically:
- Send a GET request to the proxy.
-
Access the new Stream:
- Use a compatible video player (e.g., AVPlayer) with the proxy URL.
As the streaming landscape evolves, tools like the SGAI Ad Proxy are pivotal in enhancing the viewer experience and driving ad revenue. For more information and setup details, visit the tool’s GitHub repository.
Top comments (0)