# How SSAI.TV works

> Source: https://support.adaptek.tv/docs/ssai/how-it-works?lang=en · Language: English · Product: SSAI.TV · Access: public
>
> Architecture, request flow and the roles of the channel, OTT, ad server and SSAI.

SSAI.TV sits in the content delivery chain right after the CDN origin and handles player requests. It does not pass the content through itself — it only builds a manifest for every viewer in which ad segments replace the original ones.

## Flow
![SSAI.TV architecture: channel → OTT → SSAI → player, ad server and tracking](https://support.adaptek.tv/docs-assets/ssai/media/public/ssai-flow.en.png)

The numbers on the diagram are the steps of the server-side insertion process: [validation, VAST request and response, transcoding, stitching, S2S tracking](https://support.adaptek.tv/docs/ssai/integration/ad-server?lang=en#процес-серверної-вставки-s2s).

1. **The TV channel** broadcasts a stream with **SCTE-35** markers indicating the start and duration of an ad break.
2. **The OTT platform** encodes the stream for players and packages it into HLS (creates the `.m3u8` manifest). Markers are preserved, and chunks are cut so that break boundaries coincide with segment boundaries — a standard packager feature.
3. **SSAI.TV** reads the manifest and recognizes the markers. When a break starts and there is a decision to replace ads, it builds an individual manifest.
4. **The viewer's player** requests the playlist via the link the OTT received from SSAI.TV. Device data is passed with the request: IP (geo), User-Agent (device type), device ID (frequency, reach).
5. **SSAI.TV calls the ad server** (VAST request) with the break and viewer parameters.
6. **The ad server** decides whether the viewer belongs to the campaigns' target audience and returns a list of creatives in one response.
7. **SSAI.TV** transcodes new creatives into all stream profiles (with EBU R 128 loudness normalization), assembles the ad break, fills the remainder with a **filler** agreed with the channel, and returns a new playlist to the viewer. If there are fewer ads than the **fillfloor** threshold, no insertion happens and the original broadcast plays.
8. **Tracking:** SSAI.TV follows segment requests, counts the actual ad duration and reports every impression to the measurement systems (or passes the trackers to the client — [Client Side Tracking](https://support.adaptek.tv/docs/ssai/integration/client-side-tracking?lang=en)).

> [!NOTE]
> The first request for a new creative usually gets the filler: the creative is transcoded first and goes on air from the next request. This is expected behaviour.

## Two deployment options
| | SSAI “behind” OTT (reverse proxy) | SSAI “in front of” OTT |
|---|---|---|
| Viewer link | OTT domain | SSAI.TV domain |
| Who calls SSAI | OTT servers, passing viewer data in headers | the player directly |
| Content segments | absolute links to the OTT CDN | absolute links to the OTT CDN |
| Ad segments | via the OTT CDN (`/creatives/`) | via the OTT CDN (`/creatives/`) |

Details — in [Integration spec for OTT platforms](https://support.adaptek.tv/docs/ssai/integration/ott?lang=en).

## Roles and responsibilities
| Party | Responsible for |
|---|---|
| **Rights holder / channel** | SCTE-35 markers, filler, ad rules — [SCTE-35 markers on the channel](https://support.adaptek.tv/docs/ssai/integration/scte35?lang=en) |
| **Sales house / ad server** | Campaigns, creative validation with the rights holder, VAST — [Technical requirements for ad servers](https://support.adaptek.tv/docs/ssai/integration/ad-server?lang=en) |
| **OTT platform** | HLS packaging, CDN, passing device data — [Integration spec for OTT platforms](https://support.adaptek.tv/docs/ssai/integration/ott?lang=en), [CDN — requirements for SSAI](https://support.adaptek.tv/docs/ssai/integration/cdn?lang=en) |
| **Adaptek (SSAI.TV)** | Manifest manipulation, transcoding, tracking, reporting |

> [!IMPORTANT]
> SSAI.TV is not responsible for copyright compliance or content owners' requirements — it inserts the creative as instructed by the ad server chosen by the customer. Creative validation is the job of the sales house and the rights holder.

## VOD and FAST
For VOD the break layout comes from the CMS media plan or from the ad server's ad rules (VMAP). A FAST channel with the same server-side insertion can be built from VOD content. Insertion accuracy in VOD is limited by segment boundaries — see [Ads cut a scene in VOD](https://support.adaptek.tv/docs/ssai/troubleshooting?lang=en#реклама-ріже-сцену-у-vod).
