keepcalculator

06 Numbers and Powers

Dynamic Ad Insertion for Live Streams: How It Works

Card No. 06·4664 · Updated · Standard formula, shown below

Extra bandwidth per viewer 0.00 MB
Total data per viewer
37.50 MB
Result
Ad break duration
30 seconds
You entered
Stream bitrate
5 Mbps
You entered
You enter
Ad break duration, Stream bitrate, Ad bitrate
You get
Extra bandwidth per viewer, Total data per viewer
Rounding
2 dp

Dynamic ad insertion (DAI) for live streams lets broadcasters serve different ads to different viewers at the same moment in the stream, replacing a single broadcast ad with targeted slots that match each viewer’s profile. You enter a stream URL and a set of ad decision parameters, and the system stitches the chosen ads into the live video in real time. The result is a seamless viewing experience where each person sees ads relevant to them, while the broadcaster gains higher ad revenue and better analytics.

Formula

The calculator works out the extra bandwidth and total data transferred per viewer during an ad break when the ad stream bitrate differs from the main stream bitrate. The key formula is:

Extra bandwidth (MB) = (Stream bitrate – Ad bitrate) × Ad break duration / 8

Where:

  • Stream bitrate (Mbps) – the bitrate of the main live stream
  • Ad bitrate (Mbps) – the bitrate of the ad content
  • Ad break duration (seconds) – length of the ad break
  • 8 – converts megabits to megabytes (8 bits = 1 byte)

If the ad bitrate is lower than the stream bitrate, the extra bandwidth is negative, meaning you save bandwidth during ads.

Worked Example

Using the default values from the calculator (stream bitrate = 5 Mbps, ad bitrate = 5 Mbps, ad break = 30 seconds):

  • Extra bandwidth = (5 – 5) × 30 / 8 = 0 MB
  • Total data per viewer = (5 × 30 / 8) + (5 × 30 / 8) = 18.75 + 18.75 = 37.5 MB

So with equal bitrates, there is no extra bandwidth cost, and each viewer downloads 37.5 MB during the 30-second break.

Background: From Broadcast to Personalized Ads

Traditional live TV shows the same ads to everyone. DAI changes that by inserting ads at the server side, just before the stream reaches the viewer. This is different from client-side ad insertion, where the player swaps in ads, because DAI works with any player and avoids ad-blockers that block requests to known ad domains.

DAI relies on a few key components:

  • Ad decision server (ADS) – chooses which ad to show based on viewer data
  • Manifest manipulator – modifies the stream’s playlist to include ad segments
  • Segmenter – splits the ad into small chunks that match the stream’s segment format
  • SCTE-35 markers – cues in the stream that signal where ad breaks start and end

The process works with both HLS and MPEG-DASH, the two main streaming protocols. For live streams, the manifest is updated continuously, and the DAI system inserts ad segments at the exact cue points.

How Dynamic Ad Insertion Works Step-by-Step

  1. Stream ingestion – the live stream is ingested and transcoded into multiple bitrates (ladder).
  2. Cue detection – the system reads SCTE-35 markers in the stream to find ad break start and end times.
  3. Ad request – when a viewer requests the stream, the manifest manipulator sends a request to the ad decision server with viewer context (e.g., geo, device, history).
  4. Ad selection – the ADS returns a list of ad URLs or a VAST/VMAP response.
  5. Ad stitching – the ad content is fetched, transcoded to match the stream’s bitrate, and segmented into the same segment duration as the main stream.
  6. Manifest rewriting – the system creates a custom manifest for each viewer, replacing the ad break with the chosen ad segments.
  7. Playback – the player follows the manifest and plays the ad seamlessly, then returns to the live feed.

Key Technologies and Protocols

DAI uses several standards to work across different systems:

  • SCTE-35 – the standard for signaling ad breaks in MPEG transport streams. It carries splice points that tell the DAI system when to insert ads.
  • VAST/VMAP – ad response formats from the IAB. VAST defines the ad media, VMAP defines ad break schedules.
  • HLS and DASH – both support DAI. In HLS, the manifest is a playlist of .ts or .fmp4 segments; in DASH, it’s an MPD file.
  • Server-side ad insertion (SSAI) – the technical term for DAI, because the ad is inserted on the server, not the client.

Choosing a DAI Solution

When selecting a DAI provider, consider these factors:

  • Latency – how quickly the ad decision is made. Low latency is critical for live sports.
  • Ad stitching quality – does the ad match the stream’s bitrate and resolution? Poor stitching causes buffering or quality drops.
  • Analytics – can you track impressions, completions, and viewer behavior?
  • Compatibility – does it work with your CDN, player, and ad server?
  • Scalability – can it handle millions of concurrent viewers?

Common Problems and How to Avoid Them

DAI is not without challenges:

  • Ad blocking – some ad-blockers can detect and block SSAI domains. Using a CDN that serves ads from the same domain as the stream helps.
  • Manifest errors – if the manifest is malformed, players may fail to play. Always test with multiple players.
  • Latency spikes – if the ad decision server is slow, viewers see a spinner. Use a fast ADS with caching.
  • Bitrate mismatch – if the ad bitrate is much higher than the stream, buffering occurs. Encode ads to match the stream ladder.
  • Cue timing issues – if SCTE-35 markers are inaccurate, ads may cut off early or run into the live content. Validate cues before going live.

Costs and Bandwidth Considerations

DAI adds bandwidth costs because each viewer may receive a different ad stream, so the CDN cannot cache a single version. The extra bandwidth depends on the bitrate difference and ad length, as shown in the calculator. For example, a 30-second ad at 5 Mbps costs about 18.75 MB per viewer. For 100,000 viewers, that’s 1.875 TB of data. Many DAI providers charge per request or per thousand ad impressions, in addition to CDN egress fees. To reduce costs, some providers use ad caching and dynamic bitrate adaptation.

Privacy and Safety Considerations

DAI relies on viewer data to target ads. This raises privacy concerns. Regulations like GDPR and CCPA require consent for data collection. Broadcasters should:

  • Obtain explicit consent for data use
  • Anonymize data where possible
  • Provide opt-out options
  • Ensure ad servers are secure against fraud

Ad fraud is also a risk. Some fraudsters simulate views to earn ad revenue. Use fraud detection tools and verify ad impressions.

Alternatives to DAI

If DAI is too complex, consider these alternatives:

  • Client-side ad insertion (CSAI) – the player requests ads separately. Simpler but ad-blockers can block it.
  • Pre-roll ads – show the same ad to everyone before the stream starts. Easy but not targeted.
  • Sponsorship – a single sponsor for the whole stream. No ad tech needed.
  • Hybrid approach – use DAI for live, CSAI for VoD.

Frequently Asked Questions

Does DAI work with all streaming platforms?

DAI works with any platform that supports HLS or DASH and can parse SCTE-35 cues. Most major streaming services use DAI, but some platforms have their own ad insertion methods. Check your platform’s documentation.

Can DAI be used for video on demand (VoD)?

Yes, DAI is also used for VoD, where ads are inserted at predefined positions. The process is similar, but the manifest is static, making it easier to cache.

Does DAI increase latency?

DAI can add a few seconds of latency because the ad decision and stitching take time. However, modern systems are optimized to keep latency under 5 seconds, which is acceptable for most live streams.

How does DAI handle ad blocking?

Since ads are served from the same domain as the stream, ad-blockers cannot easily distinguish them from content. This makes DAI more resistant to ad-blocking than client-side insertion.

What is the difference between DAI and SSAI?

DAI and SSAI are often used interchangeably. SSAI is the technical term for server-side ad insertion, while DAI is the marketing term. They refer to the same process.

Can I use DAI with a free ad server?

Yes, you can use free ad servers like Google Ad Manager, but you still need a DAI provider to handle the stitching. Some providers offer free tiers with limited features.

Related

Formula used
in t | Ad break duration | seconds | 30 | 5 | 600
in s | Stream bitrate | Mbps | 5 | 0.5 | 50
in a | Ad bitrate | Mbps | 5 | 0.5 | 50
out extra | Extra bandwidth per viewer | MB | (s - a) * t / 8 | 2
out total | Total data per viewer | MB | (s * t / 8) + (a * (t / 8)) | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →