Interactive CTV Architecture Guide

SSAI & Connected TV (CTV) Ad Stitching

Understand how Server-Side Ad Insertion (SSAI) stitches video ads directly into streaming feeds, manipulates HLS and DASH manifests, and synchronizes measurement beacons across Smart TV apps.

Connected TV & Streaming Track

Master server-side video ad stitching, HLS manifests, and ad podding

SSAI (Server-Side Ad Insertion) powers the smooth, TV-like commercial breaks on Hulu, Pluto TV, Roku, and Smart TVs. Learn how ad stitchers rewrite video manifests, manage multi-ad pods, and track delivery beacons.

What you'll learn

  • SSAI vs CSAI architectural trade-offs: latency, buffering, and fraud risks
  • HLS manifest tags: SCTE-35 cues, EXT-X-DISCONTINUITY, and DATERANGE markers
  • VMAP ad podding structures (pre-roll, mid-roll, post-roll durations)

What is inside

  • Annotated HLS (.m3u8) video manifest showing seamless ad segment insertion
  • Server-side vs client-side beacon firing comparison with discrepancy root causes
  • Top 5 CTV troubleshooting scenarios (aspect ratio distortion, pod overflow)

How to use this guide

  • Download and inspect an HLS master manifest using curl or Charles Proxy
  • Map SCTE-35 cue markers to ad break start and end boundaries
  • Review CTV measurement signals (IFA, IP passthrough) for AdOps audits
In Plain English

What is SSAI in simple terms?

In traditional web video (CSAI), when an ad is due, the player pauses the movie, opens a new video player for the ad, plays the commercial, and then resumes the movie. On Smart TVs and streaming boxes, this causes lag, buffering, and crashes. With SSAI (Server-Side Ad Insertion), the cloud server splices the ad video segments directly into the movie's streaming playlist before sending it to your TV. Your TV simply plays one continuous video stream without ever knowing it is playing an ad.

SSAI (Server-Side) vs CSAI (Client-Side) Comparison

How ad insertion strategies differ in performance, measurement, and device compatibility:

Feature SSAI (Server-Side Ad Insertion) CSAI (Client-Side Ad Insertion)
User Experience Broadcast Quality: Zero buffering between show and ad break; seamless video transitions. Noticeable pause/spinner when switching from content stream to ad player.
Device Compatibility Works on all Connected TV devices (Roku, Tizen OS, LG webOS, Apple TV, FireTV). Requires heavy JavaScript SDKs; high failure rate on low-memory TV hardware.
Ad Blocker Resistance Immune to ad blockers: Video and ads share the same video stream domain and manifest segments. Easily intercepted and blocked by browser extensions and DNS blockers.
Beacon Tracking Accuracy Server fires beacons, which can cause IP/User-Agent clustering unless client-side tracking (DAI SDK) is used. Client fires beacons directly from user's IP; easy verification and interactive tracking.

SSAI 6-Step Video Stitching Architecture

The step-by-step pipeline from live broadcast cue to ad segment playback:

  • 1
    SCTE-35 Cue Marker Detection
    The live video encoder injects an SCTE-35 digital cue into the broadcast stream signaling an upcoming commercial break window.
  • 2
    Manifest Interception by SSAI Engine
    The SSAI server (e.g. AWS Elemental MediaTailor, Google DAI, SpringServe) intercepts the viewer's HLS/DASH manifest request.
  • 3
    Ad Decisioning (VAST / OpenRTB Call)
    The SSAI engine calls Google Ad Manager or SSPs, passing the viewer's device IFA (Identifier for Advertising), IP, and user-agent. The ad server returns a VMAP or VAST response with selected creatives.
  • 4
    Dynamic Transcoding & Normalization
    The ad video is dynamically transcoded into matching HLS video chunks (.ts or .m4s) with the exact same bitrate ladder, audio loudness, and framerate as the main movie.
  • 5
    Manifest Stitching (EXT-X-DISCONTINUITY)
    The SSAI engine replaces the commercial break window in the user's .m3u8 playlist with the newly generated ad segments wrapped in discontinuity tags.
  • 6
    Beacon Tracking & Client Sync
    As the viewer's Smart TV plays the ad chunks, either the SSAI server fires tracking beacons automatically (Server-to-Server) or the TV app's lightweight SDK reports playhead progress.

📊 Technical Architecture: Client-Side vs. Server-to-Server (S2S) Beacon Firing

How tracking beacons are executed is one of the most critical architectural decisions in Connected TV, directly impacting measurement accuracy and billing discrepancies:

Client-Side Beacon Firing (Hybrid / Smart TV SDK):

The Smart TV app player observes actual video buffer playhead progress and fires beacons directly from the viewer's device IP. Pros: High verification accuracy, native fraud/bot signals, and zero IP proxy discrepancy. Cons: Requires lightweight client SDK; vulnerable to device crash or low-end CPU lag.

Server-to-Server (S2S) Beacon Firing:

The SSAI server calculates when the ad was streamed and fires tracking beacons from the cloud. Pros: 100% device compatibility (works on legacy Roku/STBs without client SDKs). Cons: Cannot verify if user turned off the TV or experienced buffer stall; requires X-Forwarded-For and device User-Agent header emulation to avoid IVT/fraud filters.

Annotated HLS Stitched Manifest (.m3u8)

How an HLS video playlist looks when content segments transition into stitched ad segments:

HLS / M3U8 Stitched Live HLS Playlist with Ad Break
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:1420

# --- Content Segments (Live TV Show) ---
#EXTINF:6.000,
https://cdn.adtechpilot.fun/live/show_seg1420.ts
#EXTINF:6.000,
https://cdn.adtechpilot.fun/live/show_seg1421.ts

# --- SCTE-35 / DATERANGE Ad Break Marker (30 Second Break) ---
#EXT-X-DATERANGE:ID="ad-break-01",START-DATE="2026-08-29T12:00:00Z",PLANNED-DURATION=30.0,SCTE35-OUT=0xFC3020000...

# Discontinuity signals player of codec / timestamp reset for ad
#EXT-X-DISCONTINUITY

# --- Ad 1: Brand Spot (15 seconds = 3 chunks x 5s) ---
#EXTINF:5.000,
https://ssai.adtechpilot.fun/ads/transcoded/ad1_seg01.ts
#EXTINF:5.000,
https://ssai.adtechpilot.fun/ads/transcoded/ad1_seg02.ts
#EXTINF:5.000,
https://ssai.adtechpilot.fun/ads/transcoded/ad1_seg03.ts

# --- Ad 2: Direct Retailer Spot (15 seconds) ---
#EXT-X-DISCONTINUITY
#EXTINF:5.000,
https://ssai.adtechpilot.fun/ads/transcoded/ad2_seg01.ts
#EXTINF:5.000,
https://ssai.adtechpilot.fun/ads/transcoded/ad2_seg02.ts
#EXTINF:5.000,
https://ssai.adtechpilot.fun/ads/transcoded/ad2_seg03.ts

# --- Resume Content ---
#EXT-X-DISCONTINUITY
#EXTINF:6.000,
https://cdn.adtechpilot.fun/live/show_seg1422.ts
#EXTINF:6.000,
https://cdn.adtechpilot.fun/live/show_seg1423.ts

Top 5 Connected TV & SSAI Delivery Failures

Common SSAI issues encountered in production and how to resolve them:

🔊 1. Audio Loudness Jump (EBU R128 / CALM Act)

Symptom: Viewer experiences a jarring volume spike when an ad starts playing during a movie.

Root Cause: Raw ad creative was uploaded at -14 LKFS while the TV content is normalized to -24 LKFS.

Fix: Configure the SSAI ingestion transcoder to enforce strict CALM Act audio normalization (-24 LKFS ±1 LKFS).

📉 2. Ad Pod Overflow / Underfill (Slate Padding)

Symptom: Commercial break ends with 8 seconds of spinning wheel or "We'll be right back" slate screen.

Root Cause: SCTE-35 break is 60s, but ad server only returned 52s of ads (e.g. one 30s and one 15s ad + 7s unfilled gap).

Fix: Enable dynamic ad podding rules in GAM to backfill with 5s/10s house promos or dynamic bumper creatives.

🖼️ 3. Aspect Ratio Distortion (Stretched Video)

Symptom: 4:3 square video creative is stretched horizontally across a 16:9 widescreen TV.

Root Cause: SSAI transcoder forcibly stretched pixel dimensions instead of applying pillarboxing (black bars on left/right).

Fix: Update transcoding profile to preserve source aspect ratio with automatic pillarbox/letterbox padding.

🆔 4. Missing IFA (Device ID) in SSAI Ad Calls

Symptom: DSPs bid with extremely low CPMs ($2.00 instead of $20.00) because they cannot frequency cap or target CTV households.

Root Cause: The Smart TV app failed to pass ifa_type and ifa (RIDA, Tizen ID) in the manifest session query string.

Fix: Ensure the native TV app appends ?ifa=...&ifa_type=rida to the stream initialization request.

⏳ 5. SSAI Beacon Firing Latency & Discrepancies

Symptom: SSAI server reports 10,000 ad completes, but the user closed the app 5 seconds into the commercial break.

Root Cause: Pure Server-to-Server (S2S) beaconing assumes the viewer watched the ad just because segments were sent down the wire.

Fix: Implement client-side tracking (e.g. Google IMA DAI SDK or MUX plugin) so beacons only fire based on actual client playhead time.

Connected TV & SSAI Interview Q&A Cheat Sheet

Key technical concepts for Solutions Architects and AdOps professionals:

Q: What is the difference between SCTE-35 and SCTE-104?

SCTE-104: Injected during production/linear broadcast at the SDI video baseband layer before compression. SCTE-35: The downstream compressed digital representation of the ad cue marker inside the HLS/MPEG-TS video stream that the SSAI engine detects to trigger ad insertion.

Keywords: SCTE-104 baseband linear, SCTE-35 digital compressed cue, ad break timing.

Q: What is VMAP and how does it relate to VAST?

VMAP (Video Multiple Ad Playlist): An XML structure that outlines the entire video timeline structure (e.g. Pre-roll at 00:00, Mid-roll 1 at 12:30, Mid-roll 2 at 28:00, Post-roll). Inside each ad break, VMAP references standard VAST tags to populate the individual commercials.

Keywords: VMAP timeline structure, ad break pods, VAST creative payloads.

Q: Why is transcoding required in SSAI?

In SSAI, the ad segments must be stitched directly next to content segments in the same playlist. If the ad creative has a different bitrate, audio codec, or resolution than the show, the TV player hardware decoder will crash or desync. The SSAI system transcodes incoming VAST media files to match the exact content profile.

Keywords: Bitrate ladder matching, codec normalization, hardware decoder stability.

Q: What is Competitive Separation in ad podding?

Competitive separation prevents ads from competing advertisers (e.g. Ford and Chevrolet) or multiple ads from the same brand from appearing in the same ad pod. The SSAI ad server inspects IAB categories and UniversalAdId values across the pod to enforce strict separation rules.

Keywords: Competitive separation, IAB category blocking, UniversalAdId deduplication.

AdTech Toolkit

Enter any two values
to calculate the third

More tools coming soon