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.
Table of contents
- Introduction to Server-Guided Ad Insertion (SGAI)
- Understanding VAST and SGAI Integration
- How SGAI Works
- Challenges and Solutions for Live Streaming Ad Insertion
- Technical Implementation: HLS Interstitials with Wowza Streaming Engine
- Code Example: Before, During, and After an Ad Break
- Leveraging the Wowza Streaming Engine API
- Demo Showcase at Mile High Video 2025
- Conclusion
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:
- Client Requests Content: A streaming client (mobile app, smart TV, or browser) requests video content.
- Server Evaluates Ad Opportunities: The server analyzes the content timeline, user profile, and ad parameters.
- Ad Decisioning: Instead of stitching ads directly into the stream (as in SSAI), the server instructs the client when and which ads to play.
- 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:

#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:

#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:


#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.
- Event Date: February 19-20, 2025
- Location: Qualabs Booth at Mile High Video
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!