Modern Monetization: Server-Guided Ad Insertion with Wowza Streaming Engine 

Introduction to Server-Guided Ad Insertion (SGAI) 

 

As video streaming has evolved, advertising has become an essential part of the video pipeline. Traditionally, ad insertion methods have been: 

  • Client-Side Ad Insertion (CSAI): Ads are requested and played by the client’s video player. 
  • Server-Side Ad Insertion (SSAI): Ads are stitched into the video stream before reaching the client. 

More recently, Server-Guided Ad Insertion (SGAI) has gained popularity. This hybrid approach leverages real-time decision-making at the server level to guide ad insertions dynamically. 

Understanding VAST and SGAI Integration 

The VAST to SGAI project aimed to convert any VAST (Video Ad Serving Template) response from an ad server into HLS asset lists for interstitial ads. 

What is VAST? 

VAST is a standardized format that facilitates communication between video players and ad servers, providing: 

  • Ad Video File Location 
  • Ad Duration 
  • Tracking Pixels for playback reporting 

This ensures proper ad insertion and measurement. 

How SGAI Works 

SGAI operates as follows: 

  1. Client Requests Content: A streaming client (mobile app, smart TV, or browser) requests video content. 
  2. Server Evaluates Ad Opportunities: The server analyzes the content timeline, user profile, and ad parameters. 
  3. Ad Decisioning: Instead of stitching ads directly into the stream (as in SSAI), the server instructs the client when and which ads to play
  4. Client Fetches and Plays Ads: The client follows the server’s guidance, maintaining smooth transitions while supporting interactivity and analytics. 

Benefits of SGAI Over SSAI & CSAI 

  • More Personalized Ads based on real-time user data. 
  • Improved Ad Measurement through client-side analytics. 
  • Bypasses Ad Blockers since ads are requested dynamically. 
  • Better Viewer Experience by reducing buffering issues. 
  • Cross-Device Compatibility across mobile, smart TV, and web-based streaming. 

Challenges and Solutions for Live Streaming Ad Insertion 

The project had several working VOD implementations for VAST to SGAI but lacked a live streaming solution

To address this, I developed a REST API for Wowza Streaming Engine (WSE) that enables dynamic HLS interstitial ad breaks in live streams using VAST to SGAI services

Technical Implementation: HLS Interstitials with Wowza Streaming Engine 

The WSE module provides a REST API that allows the insertion of the EXT-X-DATERANGE tag with all its options. When an API request is received, the tag is inserted at the top of the HLS segment list. 

The API payload consists of a JSON object defining: 

  • Ad Offset Timing 
  • Ad Restrictions 
  • VAST Asset List Source 

This ensures real-time ad insertion without pre-stitching ads into the stream

Code Example: Before, During, and After an Ad Break 

Before Ad Insertion: 

Screenshot API VASTID Before Ad Insertion
#EXTM3U 
#EXT-X-VERSION:3 
#EXT-X-TARGETDURATION:4 
#EXT-X-MEDIA-SEQUENCE:60897 
#EXT-X-DISCONTINUITY-SEQUENCE:0 
#EXT-X-PROGRAM-DATE-TIME:2025-02-13T17:03:19.368Z 
#EXTINF:4.0, 
media_60897.ts
 

In Ad:

Screenshot API VASTID In Ad
#EXT-X-DATERANGE:ID="rtmp-ad-39",CLASS="com.apple.hls.interstitial",START-DATE="2025-02-13T17:03:29.794Z",DURATION=30.000,X-ASSET-LIST="https://vast2sgai.qualabs.com/api/asset-list?vasturl=http://vast2sgai.qualabs.com/samples/sample-api-vastid-live/vast-sample.xml"
 

After Ad Insertion: 

Screenshot API VASTID After Ad Insertion
Screenshot API VASTID After Ad Insertion multiple screens
#EXTINF:4.0, 
media_60897.ts 
#EXTINF:4.0, 
media_60898.ts

Leveraging the Wowza Streaming Engine API 

With Wowza Streaming Engine’s modular architecture, I created a REST API endpoint that dynamically inserts HLS interstitials (EXT-X-DATERANGE tags) into live streams

This allows: 

  • Real-time ad insertion 
  • Integration with the VAST to SGAI service 
  • Seamless ad playback with no buffering issues 

For more information, refer to the Use Wowza Streaming Engine Java modules page. 

Demo Showcase at Mile High Video 2025 

This SGAI integration with WSE will be showcased at Mile High Video 2025 in the Qualabs booth

Come find me for a live demo and more insights! 

Conclusion 

By leveraging Wowza Streaming Engine’s API, I was able to quickly build an SGAI solution that enables real-time ad insertion in live streaming workflows

  • SGAI bridges the gap between SSAI and CSAI, offering real-time, personalized ads. 
  • Wowza Streaming Engine’s modular architecture allows easy extension via APIs. 
  • HLS interstitials make dynamic ad breaks seamless in live streaming. 

For those looking to implement complex ad insertion workflows, Wowza Streaming Engine’s REST API is a powerful tool. 

Stay tuned for the code and module release on GitHub soon! 🚀 

Search Wowza Resources

Categories

Subscribe

Follow Us

Categories

About Ian Zenoni

Ian Zenoni has been in the video industry for over 20 years and at Wowza for over 10. While at Wowza Ian has architected, built, and deployed solutions and services for live video streaming, both in the cloud and on premises. As Chief Architect Ian researches the latest technology in video streaming to integrate into Wowza’s products and services. He is also a co-organizer of the local Denver Video meetup group that meets quarterly in the Denver metro area.