Skip to content

Ad Insertion Markers

The dynamic ad insertion (DAI) technique is used for adding commercials into linear live streams, such as TV broadcasts. A regional TV provider can, by using DAI, embed "local" advertising into a broadcast.

The dynamic ad insertion method uses ad insertion markers to prepare a stream for ad insertion. Markers are stream's metadata that signals about the ad insertion event. This event means that you can embed a commercial of a certain duration in a certain place of a video stream. This place (a cue splice point) in a stream allows smooth switching to another stream (such as a commercial) and back to the main video.

Ad insertion markers are created according to various standards, the most popular standard is SCTE-35. Technically, they are tags in a client manifest, that is why markers must be added for each video transmission protocol (adaptive sreaming). Flussonic can do that.

Flussonic works with markers in the SCTE-35, SCTE-104, and AWS formats and recognizes the metadata about the splice_insert events.

The following marker formats are read from streams of different types:

  • HLS — markers in formats: SCTE-35, AWS (learn more in AWS Documentation), or simple cue-in and cue-out markers.
  • MPEG-TS — SCTE-35 markers.
  • Video from Decklink or DekTec capture cards — SCTE-104 markers.

It can be summed up in a table below:

Stream protocol Ad insertion marker
MPEG-TS SCTE-35
HLS SCTE-35, AWS
SDI SCTE-104

Usage example: You need to read the SCTE-35 markers in a transport stream and convert them to a format standard for broadcasting via HLS.
Flussonic can detect markers in the ingested stream, convert them to a specified standard, and automatically add them to a client's requested manifest.

Converting ad insertion markers with Flussonic

Flussonic can convert ad insertion markers that come with an input stream into another format and pass them to the output stream.

Markers from MPEG-TS input streams

  • from MPEG-TS SCTE-35 — to MPEG-TS SCTE-35
  • from MPEG-TS SCTE-35 — to HLS AWS
  • from MPEG-TS SCTE-35 — to HLS SCTE-35
  • from MPEG-TS SCTE-35 — to VANC SCTE-104
  • from MPEG-TS SCTE-35 — to DASH AWS

For incoming MPEG-TS streams with SCTE-35 markers you can enable Flussonic to convert markers to AWS or SCTE-35 when a stream is accessed over HLS, AWS for DASH or SCTE-104 in case of VANC. Then, when the stream is accessed via HLS, DASH or SDI, it will contain markers in the specified format (AWS, SCTE-35 or SCTE-104).

For MPEG-TS output, markers do not need to be converted to SCTE-35. They are transmitted automatically if received from the input MPEG-TS stream.

Markers from HLS input streams

  • from HLS cue markers, SCTE-35, or AWS — to HLS AWS or HLS SCTE-35 respectively
  • from HLS cue markers, SCTE-35, or AWS — to MPEG-TS SCTE-35
  • from HLS cue markers, SCTE-35, or AWS — to DASH AWS

The ad markers from incoming HLS streams (SCTE-35 or AWS) can further be converted to SCTE-35 or AWS for output streams accessed via HLS and to AWS for DASH output streams. Accessing the stream via MPEG-TS, markers can be converted to SCTE-35.

  • from VANC SCTE-104 — to MPEG-TS SCTE-35, HLS SCTE-35 or DASH AWS

Flussonic reads SCTE-104 markers in the VANC format from Decklink or DekTec capture cards. The reading takes place by default.

Markers are passed automatically as SCTE-35 to MPEG-TS, DASH and HLS output streams, no conversion settings needed.

Setting up conversion of ad insertion markers

To set up ad markers convertion:

  • Enable reading of ad insertion markers from the input stream
  • Specify the desired format of the markers for the output stream.

This can be done by editing the input stream settings.

Reading markers from the input stream

To enable markers processing:

  • for MPEG-TS input: no additional options are required; SCTE-35 markers are read automatically.

  • for HLS input: add ad=true option to the input to enable the processing of ad markers from an HLS input stream; simple SCTE-35 cue markers and AWS markers are supported.

  • for SDI input: SCTE-104 markers are automatically read from VANC.

Example

input hls://IP-ADDRESS:PORT/STREAM_NAME ad=true;

That way Flussonic will read ad markers from the input HLS stream.

Conversion of markers

The next step is to specify the format of markers for output HLS streams.

Notes.

Ad insertion markers (SСTE-35 or AWS respectively) will be passed to output MPEG-TS or DASH automatically.

SCTE-104 ad insertion markers from VANC will be passed to output MPEG-TS, HLS and DASH automatically.

To enable markers conversion add hls_scte35 to the input stream settings.

Syntax:

hls_scte35 aws|scte35|rfc8216;

where:

  • aws — AWS ad markers for HLS output
  • scte35 — SСTE-35 ad markers for HLS output
  • rfc8216 — SСTE-35 ad markers for HLS output complying with the RFC 8216 standard. Such markers are passed in the EXT-X-DATERANGE tag. This format is supported by Apple devices.

Example

hls_scte35 scte35;

Flussonic will add SСTE-35 cue markers to the output HLS stream.

hls_scte35 is used specifically for HLS output.

Two-part example

In this example we will: 1. Read SСTE-35 markers from MPEG-TS 2. Convert them to HLS AWS markers to use in the output HLS stream.

Reading MPEG-TS SСTE-35 markers, transform them into AWS format for playing the stream via HLS (hls_scte35 aws):


stream STREAM_NAME {
    input tshttp://IP-ADDRESS:PORT/INPUTSTREAM/mpegts;
    hls_scte35 aws;
}

Now when you access this stream via HLS, it will contain AWS ad markers.

Let's access the resulting stream via HLS locally, read the markers from it and specify the option to convert it to the SCTE-35 format when playing this stream via HLS:


stream STREAM_NAME_HLS {
    input hls://FLUSSONIC-IP:PORT/STREAM_NAME/tracks-v1a1/mono.m3u8 ad=true;
    hls_scte35 scte35;
}

Checking that a stream has SCTE-35 markers

If you want to make sure the output stream contains SСTE-35 markers, check the Flussonic log. Flussonic raises the 'scte35' event that belongs to the standard log level. The logs in /var/log/flussonic/flussonic.log will show mpegts_scte35 messages.

To raise the scte35 event, add these lines to the configuration:


event_sink events {
  url log:///var/log/flussonic/example.log;
  only event=scte35;
}

An alternative way of detecting the cue markers in the HLS stream is to look at this HLS manifest. It is less convenient and you will also need to wait for them to appear in real time playback.