Streaming & media

Server-Side vs Client-Side Ad Insertion with SCTE-35 in Live HLS

How SCTE-35 cues travel through a live HLS chain, what changes when the server or the player inserts the ad, and how to choose between the two.

1. Where SCTE-35 cues come from

SCTE-35 is the standard message a broadcaster uses to mark an upcoming ad break, programme boundary or other event in a live feed. The playout or scheduling system inserts it into the MPEG transport stream as a splice_insert or time_signal command, often with segmentation descriptors that describe the break type and duration.

The encoder and packager must keep that cue through transcoding and convert it into something an HLS player or ad-insertion service can read. They should also place an IDR frame at the splice point and start a new segment there, so an ad can replace content without a partial frame at either edge. If the cue is lost or mistimed at this stage, neither insertion method can recover it.

IETF: RFC 8216, HTTP Live Streaming

2. How the cue appears in an HLS playlist

RFC 8216 defines EXT-X-DATERANGE with SCTE35-OUT, SCTE35-IN and SCTE35-CMD attributes that carry the original binary message as hexadecimal. A playlist that uses EXT-X-DATERANGE must also carry EXT-X-PROGRAM-DATE-TIME, which ties the break to wall-clock time. Many workflows also emit the older EXT-X-CUE-OUT and EXT-X-CUE-IN tags. They are widely supported, but they are vendor conventions and not part of the RFC.

In this example the break starts on a segment boundary and is planned for 60 seconds. The SCTE35-OUT value is shortened for readability.

#EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:48210
#EXT-X-PROGRAM-DATE-TIME:2026-09-29T20:59:54.000Z
#EXTINF:6.000,
live-48210.ts
#EXT-X-DATERANGE:ID="break-1042",START-DATE="2026-09-29T21:00:00.000Z",PLANNED-DURATION=60.0,SCTE35-OUT=0xFC302F...
#EXTINF:6.000,
live-48211.ts
#EXTINF:6.000,
live-48212.ts

Check which form your ad server, SSAI service and players expect before choosing packager settings. Sending both forms is common during a migration; make sure they describe the same break.

3. Server-side insertion: the ad becomes part of the stream

With server-side ad insertion (SSAI, also sold as dynamic ad insertion or DAI), a manifest manipulator reads the cue, requests an ad decision from the ad server, usually as VAST, and rewrites the playlist so ad segments replace the content segments for the break. The player sees one continuous stream and needs no ad logic of its own.

Ad creatives are transcoded to match the content’s bitrate ladder, codecs and audio layout before they are stitched in. EXT-X-DISCONTINUITY tags mark where timestamps and encoding parameters change. When the ad pod is shorter than the break, the service fills the gap with slate or returns to content early, depending on its configuration.

#EXT-X-PROGRAM-DATE-TIME:2026-09-29T20:59:54.000Z
#EXTINF:6.000,
live-48210.ts
#EXT-X-DISCONTINUITY
#EXTINF:6.000,
https://ads.example.net/creative-381/720p/0001.ts
#EXTINF:6.000,
https://ads.example.net/creative-381/720p/0002.ts
...
#EXT-X-DISCONTINUITY
#EXT-X-PROGRAM-DATE-TIME:2026-09-29T21:01:00.000Z
#EXTINF:6.000,
live-48221.ts

Because each viewer can receive different ads, the service generates a playlist per session. Media segments remain cacheable on the CDN, but every playlist request reaches the stitcher, which has to scale with concurrent viewers on the busiest night of the year.

Google Ad Manager: Dynamic Ad Insertion

4. Client-side insertion: the player runs the break

With client-side ad insertion (CSAI), every viewer receives the same playlist. The player reads the cue from EXT-X-DATERANGE or from ID3 timed metadata in the segments, calls the ad server through an SDK such as Google IMA, and plays the ad from its own URL in place of, or on top of, the live content.

The shared playlist caches normally on the CDN, and the origin does nothing special during breaks. The work moves to the player: every platform needs a working ad SDK integration, and switching between content and ad sources can cause black frames, buffering or a jump in audio level.

After a live ad the player has to decide how to return. It can jump to the live edge and skip content that aired during the break, or resume where it paused and fall further behind live after each break.

Google: Interactive Media Ads SDK

Avenga: client-side and server-side ad insertion

5. Compare the trade-offs

Neither method is better in every case. The table summarises the usual differences; exact behaviour depends on the SSAI vendor, ad SDK and devices.

SSAI and CSAI compared
AspectSSAICSAI
Transition qualityOne continuous stream on the content’s ladder, close to broadcast TVDepends on the player and SDK; switching can cause gaps or buffering
Ad blockersHard to block, because ads arrive from the same host as contentAd calls and creatives are easy to block by domain
Device reachAny player that plays HLS, including smart TVs and set-top boxesNeeds an ad SDK integration on each platform
CDN and originPer-session playlists; the stitcher scales with concurrent viewersShared playlists cache normally
MeasurementServer beacons need viewer IP and user-agent forwarding, or client-side trackingViewability and click measurement from the SDK on the device
Interactive formatsLimited; clickable and companion ads need extra player workFull support for clickable and interactive formats
Live offsetViewer stays at the same distance from liveViewer may skip content or drift behind live after each break

Bitmovin: CSAI vs SSAI

6. Get ad measurement right

Advertisers pay for impressions they can verify. When an SSAI service fires tracking beacons from its own servers, impressions appear to come from a small set of data-centre addresses, which verification vendors may flag as invalid traffic. IAB Tech Lab’s SSAI guidance describes forwarding the viewer’s IP address and user agent with ad requests and beacons. Confirm that both your ad server and SSAI vendor support it.

Server-side tracking also counts an impression when the player requests the ad segments, which does not prove the ad was shown: segments can sit in the buffer while the viewer leaves. With client-side tracking, the SSAI service passes ad metadata to the player, which fires the beacons itself as each quartile plays. You keep SSAI’s playback quality and measure on the device, at the cost of some player integration.

IAB Tech Lab: SSAI guidelines

IAB Tech Lab: VAST

broadpeak.io: server-side and client-side ad tracking

7. Hybrid approaches: HLS Interstitials and server-guided insertion

HLS Interstitials use an EXT-X-DATERANGE with CLASS="com.apple.hls.interstitial" to tell the player to fetch and play a separate asset at a given point. The server decides where the break goes and can personalise the asset list, while the player plays it natively, so the main playlist stays shared and cacheable. Apple’s AVFoundation supports it; support in other players is growing.

Several SSAI vendors offer server-guided ad insertion (SGAI) built on a similar split. Before adopting a hybrid method, check support on every platform you need, including older smart TVs.

Apple: HTTP Live Streaming resources

8. Choose and test

Many broadcasters use SSAI on connected TVs and set-top boxes, where ad SDKs are limited and a clean transition matters most, and CSAI on web and mobile, where interactive formats can earn more. Whichever you choose, test with real cues from the playout system, not only with manually inserted markers.

  • Cues survive the whole chain: playout, contribution, transcoder, packager and CDN.
  • Every break starts and ends on an IDR frame and segment boundary, at the planned time.
  • Short, long, empty and back-to-back ad pods behave as expected, including slate fill.
  • Impressions in the ad server match the player’s own counts within the tolerance agreed with advertisers.
  • The stitcher or ad server handles the concurrent viewers of your largest live event.