Unified Origin - DAI

Live stream with Dynamic Ad Replacement

Ad replacement for live is built to industry specifications for assured interoperability with global ad vendors and partners. Chosen by major broadcasters, streaming providers and telcos for its ease of integration, playout compatibility and quality of user experience. A proven solution replacing advertisements in live streams watched by millions of viewers everyday.

Key features

  • Industry standard ad break signaling, uses SCTE 35 markers to signal advertisement opportunities
  • Supports HLS and MPEG-DASH, without breaking backward compatibility for older formats like Smooth
  • Frame accurate, cuts and splices at the exact ad break boundaries

Main benefits

  • Proven compatibility, works with the majority of third-party ad replacement services
  • No client-side integration, works natively on many players, increasing the size of your potential audience
  • Increase revenue, target ads per region, user and demographic
  • Seamless playback, transitions between programs and ad breaks without buffering or artifacts
  • Advanced ad break signaling, use SCTE 35's 'splice_insert' for simple ad break signaling, or leverage 'time_signal' for your advanced use cases

How it works

As in a regular live workflow an encoder posts a live stream to Origin, which ingests it, creating a live archive on disk to stream from. To enable ad replacement the live encoder sends SCTE 35 markers as part of the stream, with additional keyframes wherever the start or end of an ad break is signaled.

From the live archive, Unified Origin generates a stream with splice points at the start and end of each ad break. A third-party ad replacement service then manipulates the manifest to replace the existing ads with more relevant ones.



Apart from below, more background about timed metadata in our blog post: How to make your media streams smarter using timed metadata.

Introduction to Timed Metadata / SCTE 35

When streaming Live, metadata can be used to 'mark' a certain timestamp in the stream. Such a mark is also called a 'cue'. These markers or cues are pushed to a publishing point as part of a separate track and are carried in SCTE 35 messages, which, like the contents of all other tracks, need to be packaged in fMP4 containers.

SCTE 35 messages can contain info about a program or other relevant data, but for the current document it is most important that they can cue splice points in a stream.

A splice point is a specific timestamp in a stream that corresponds to an IDR frame that is signaled as being a sync-sample. This means that the splice point offers the opportunity to seamlessly switch the livestream to a different clip. Splice points can be used to cue:

  • (Ad) replacement/insertion opportunities
  • Start and endpoint of a program (for Live2VOD see Capturing LIVE)

When the timestamp of the cue that signals a splice point does not correspond to the start of a media segment in the stream (i.e., it does not correspond to any of the IDR frames that are present in the stream by default), the encoder that pushes the livestream to the publishing point, needs to insert an additional IDR frame at the timestamp that the cue signals. If the --splice_media option is enabled, Origin then splices frame accurately and part of the media segment that contains the splice point is merged with either the previous or the next segment so that the number of segments before and after splicing remains the same.

In addition to splicing the media segments, if necessary, Origin will also signal the splice points in the Apple HLS and MPEG-DASH client manifests. A third party service may then be used to insert a clip into the livestream at such a splice point to create an ad insertion or ad replacement workflow, for example.

Different types of SCTE 35 signals

Unified Streaming products support the handling of:

  • splice_insert()
  • time_signal()
  • segmentation_descriptor()

And are capable of fulfilling the requirements in the following presentation formats:

  • HLS TS
  • HLS fMP4
  • MPEG-DASH (when using a SegmentList or SegmentTemplate)

Product support for SCTE 35 is based upon the following specifications and guidelines:


  • A legacy command (as described in Section 9.1 of SCTE 35 (2019)) to indicate where a break can occur within a program stream.
  • Still widely used in the industry (until all systems support time_signal)
  • Commands trigger either CUE-OUT (to the ad break) or CUE-IN (from the ad break) or both.
  • Breaks cannot overlap each other.

Section 9.2 of SCTE 35 (2019) outlines the following requirements for delivery of metadata in advance of the desired presentationTime:

The splice_insert() message shall be sent at least once a minimum of 4 seconds in advance of the desired splice time for a network Out Point condition. It is recommended that, if a return-to-network (an In Point) message is sent, the same minimum 4 second pre- roll be provided.


  • The successor command to indicate where a break can occur within a program stream.
  • Beginning to be adopted more in the industry.
  • Commands are supplied in pairs with each CUE-OUT/CUE-IN being used to describe a different type of break.
  • Can be used to decribe different types of 'breaks' (program, chapter, etc.)

Section 10.3.3 of SCTE 35 (2019) outlines the following requirements for delivery of metadata in advance of the desired presentationTime:

The time_signal() or splice_insert() message should be sent at least once a minimum of 4 seconds in advance of the signaled splice_time() to permit the insertion device to place the splice_info_section() accurately.

For further information on using 'time_signal()', please see --time_signal below.

Different types of messages

The processing entity (e.g., Packager or Origin) can receive SCTE 35 messages delivered as an event message track containing:

  • DASH Events stored in an ‘emsg’ box
  • Cablelabs ESAM stored in an ‘mdat’ box

DASH Events (emsg)

When converted to XML the message can take the following form:

<EventStream xmlns="urn:mpeg:dash:schema:mpd:2011"
value="2" timescale="10000000">
  <!-- 2019-12-19T08:30:21.942400Z -->
  <Event presentationTime="15767442219424000" duration="150000000" id="1576744212">
    <Signal xmlns="http://www.scte.org/schemas/35/2016">
        <SpliceInsert spliceEventId="1576744212"
            <SpliceTime ptsTime="1259272022" />
          <BreakDuration autoReturn="1" duration="1350000" />

Cablelabs (ESAM)

  • Part of Cablelabs ESAM specification OC-SP-ESAM-API
  • SCTE 35 messages delivered as XML
  • XML can be extracted directly from the file delivered
  • Adopted by AWS Elemental (Live, MediaLive)
<?xml version="1.0"?>
<sig:AcquiredSignal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.cablelabs.com/namespaces/metadata/xsd/conditioning/2 ESAM_Signal.xsd">
  <AcquiredSignal acquisitionPointIdentity=""
    <sig:UTCPoint utcPoint="2017-10-05T23:47:43.138Z"/>
    <sig:BinaryData signalType="SCTE35">/DAlAAAAAA4QAP/wFAUAAAACf+/+ABjGMP4ADbugAAEBAQAAbRyXaw==</sig:BinaryData>
      <sig:StreamTime timeType="HSS" timeValue="15072472620400000"/>
      <sig:StreamTime timeType="SignalID"
      <sig:StreamTime timeType="Duration" timeValue="100000000"/>

Enabling Media Splicing on SCTE 35 Markers


New in version 1.9.0.

If your USP license includes support for timed metadata, you can enable Origin to pass it through using the --timed_metadata option when creating the server manifest. SCTE 35 messages that Origin ingests are then automatically signaled in the MPEG-DASH and Apple HLS client manifests.

By default Origin uses the SCTE 35 splice_insert() command as markers for ad breaks and period boundaries.


New in version 1.9.0.

This option requires that your USP license includes support for timed metadata and that the --timed_metadata option is enabled on the publishing point of your livestream. When this is true and your content contains SCTE 35 markers that signal splice points, Origin can be instructed to splice the MPEG-DASH and Apple HLS media segments on these splice points by enabling the --splice_media when creating the Live server manifest.


New in version 1.10.15.

The SCTE 35 splice_insert() is considered legacy and a better alternative is to use the SCTE 35 time_signal() command to signal splice events.

This option takes a comma separated list of segmentation type ids that mark the ad breaks and period boundaries.

segmentation_type_id Segmentation Message
34 Break Start
35 Break End
48 Provider Advertisement Start
49 Provider Advertisement End
50 Distributor Advertisement Start
51 Distributor Advertisement End
52 Provider Placement Opportunity Start
53 Provider Placement Opportunity End
54 Distributor Overlay Placement Opportunity Start
55 Distributor Overlay Placement Opportunity End
56 Provider Overlay Placement Opportunity End
57 Provider Overlay Placement Opportunity Start


For HLS output the selected types will be signalled as either SCTE-OUT or SCTE-IN as appropriate. All other types will be SCTE-CMD.


It's crucial that the archive_length set when creating the publishing point is longer than the longest possible ad break for that particular live stream.

Origin Ingest Requirements

Origin supports the ingest of SCTE 35 messages in the form of DASH event messages. This means that SCTE 35 messages need to be contained in an emsg box inside an fMP4 container. The SCTE 35 messages need to be stored in binary, with a schemeIdUri of urn:scte:scte35:2013:bin.

The timing of the cue must be sample accurate and it is an error to not have an IDR frame (which must be signaled as being a sync-sample) at the time of a cue. In other words, the encoder must ensure that an IDR frame is present at each timestamp that is signaled in a SCTE 35 message. Also, if an additional IDR frame needs to be inserted, the encoder should not shorten or lengthen any of the media segments but keep the original length intact.

SCTE 35 markers must be received by Unified Origin at least 2x ahead of the specified [hls|mpd].minimum_fragment_length. Example:

2 x minimum_fragment_length = latest receive time
2 x 6s = 12s

Using time_shift to reduce the time required:

2 x minimum_fragment_length - time_shift = latest receive time
2 x 6s - 8s = 4s

Using smaller minimum_fragment_length:

2 x minimum_fragment_length = latest receive time
2 x 4s = 8s

To give some context as to why it exists:

The shortest part of any sliced segment needs to be either prepended to the next segment (if the the second 'half' of sliced segment is the shortest) or appended to the segment before (if the the first 'half' of sliced segment is the shortest). As changing the duration of previously announced segment is not allowed, we need to know about any splicing (via the SCTE marker) that needs to be signaled before the segment that precedes the segment within which the splice opportunity occurs.


In addition to the above, the regular ingest requirements should be followed, as documented in Content Preparation.

SCTE 35 cue events


We follow the guidelines as described in SCTE 67 (2017) Guidelines. In particular chapter 8.1: Starting a Break.

The SCTE 35 splice_insert() is used to announce an opportunity to either splice out of the network into an ad (a 'cue-out event'), or splice into network, out of an ad.

A cue-out event is indicated by a SCTE 35 splice_insert() message with the out_of_network_indicator field set to 1. The break_duration() must be present and signal the duration of the break. The auto_return flag shall be 1 (Auto Return Mode).


A cue-out event should not overlap other cue-out events.

A SCTE 35 splice_insert() message that signals the return to the main content can be referred to as a 'cue-in event' and must have the out_of_network_indicator set to 0. When present, its splice_event_id must match an associated cue-out event. The time of the cue that signals the switch back to the main content must match the sum of the associated cue-out's time and duration.

The presence of a 'cue-in event' is not required to successfully signal a break, as Origin can calculate the end time of a break from the information contained in the 'cue-out event' (i.e., start of break + duration of break = end of break).

A cue event may cause Origin to splice a media segment. Since a media segment can only be spliced once, you cannot have cues with time ranges that refer to the same media segment. E.g., when using 8 seconds media segments you cannot have a cue-out marker with a duration shorter than 8 seconds. This should not pose a problem because in practice the (ad) insertion opportunities are much longer than a single media segment.

Origin Playout

The events signaled in SCTE 35 messages are passed through to the client manifests when this feature is part of your USP license and you have enabled the --timed_metadata option for the particular publishing point. For HLS, the events are signaled using the EXT-X-DATERANGE tag and a combination of the EXT-X-CUE-OUT and EXT-X-CUE-IN tags, while for MPEG-DASH they are signaled in DASH Event Messages.

For HLS, the EXT-X-DATERANGE and EXT-X-CUE-OUT plus EXT-X-CUE-IN tags present different ways of signaling similar information. By adding them both, compatibility with a broader range of third party services that make use of these tags is ensured. Some of these services rely on the EXT-X-DATERANGE tag being present (e.g., Yospace), while others expect EXT-X-CUE-OUT and #EXT-X-CUE-IN tags (e.g. Google DFP and AWS Elemental MediaTailor).

Because Origin appends or prepends part of the spliced media segment to the previous or next media segment, no new media segments are introduced and discontinuities in the sequence numbering of the segments is avoided. Since we merge a part of the spliced media segment, the duration of the media segments remains between 0.5 and 1.5 times the original segment duration.


For post-rolls, the EXT-X-DATERANGE and EXT-X-CUE-OUT plus EXT-X-CUE-IN tags will precede the last media segment. This is because the HLS specification requires tag decorators to be explicitly declared before a segment. See the AWS Elemental MediaTailor documentation for more information.

HLS signaling of SCTE 35

In addition to SCTE 35 markers being added to the media playlists using the EXT-X-DATERANGE and EXT-X-CUE-OUT plus EXT-X-CUE-IN tags, the break_duration() of a cue-out event is signaled both in the PLANNED-DURATION attribute of the EXT-X-DATERANGE tag and as the value of the EXT-X-CUE-OUT tag.

An example from an actual livestream with SCTE 35 markers is shown below. The example is taken from HLS - Pure live (SCTE 35)`. This livestream contains cue-out markers that are exactly aligned with the media segment boundaries so that no media segments need to be spliced:

#EXTINF:4, no desc
#EXTINF:4, no desc
#EXTINF:4, no desc
#EXTINF:4, no desc
#EXTINF:4, no desc
#EXTINF:4, no desc
#EXTINF:4, no desc
#EXTINF:4, no desc


As long as a cue-event has not finished, the signaling of the start of the event will remain part of the playlist, even if the start of the event is outside of the specified DVR window.

Early Announcement of Opportunities in HLS

Since version 1.11.5 Unified Origin is capable of signalling opportunities ahead of the desired presentation time. Previously Unified Origin would only signal these opportunities at the presentation even if they had been received earlier from the upstream encoder.

Now it's possible for a downstream platform to extract information from the EXT-X-DATERANGE tag signalled at the foot of the HLS client manifest to prepare supplementary content for the opportunity ahead of time.

The following example manifest describes how a future opportunity due to occur at 09:56:27 is already announced in the client manifest at 09:56:21. The Unified Origin has received the SCTE 35 opportunity 6seconds ahead of its presentation time. Until the live-edge of the presentation time reaching this time the EXT-X-DATERANGE will continue to be appended with every new media segment announced.

Fri Dec 10 09:56:21 UTC 2021
## Created with Unified Streaming Platform  (version=1.11.9-25075)
## splice_insert(auto_return)
## Auto Return Mode
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
## splice_insert(auto_return)
#EXT-X-DATERANGE:ID="72617-1639130187",START-DATE="2021-12-10T09:56:27.840000Z",PLANNED-DURATION=19.2,SCTE35-OUT=0xFC302100000000000000FFF0100500011BA97FEF7FFE001A5E00C00000000000E4612## Auto Return Mode

Since the live-edge has now reached the presentation time of the SCTE 35 opportunity the manifest is now conditioned with both the EXT-X-DATERANGE and EXT-X-CUE-OUT at the segment boundary that has been spliced (split and merged).

Fri Dec 10 09:56:32 UTC 2021
## Created with Unified Streaming Platform  (version=1.11.9-25075)
## splice_insert(auto_return)
## Auto Return Mode
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:1.92, no desc
#EXTINF:0.96, no desc
## splice_insert(auto_return)
#EXTINF:2.88, no desc
## Auto Return Mode

SCTE 35 based spliced media in HLS

The below example that is taken from HLS - Pure live (SCTE 35, spliced) shows the signaling of SCTE 35 markers in a livestream when the cue-out markers do not align with the media segment boundaries. In this example, a 10 second segment need to be spliced to fit a 24 second break. (Origin will only splice segments if the --splice_media option is present in the publishing point's server manifest.)

The duration of the SCTE 35 cue-out event in the example below is 24 seconds and the last media segment in this time range is spliced at exactly 4 seconds and appended to the media segment before it to match the duration of 24 seconds (10 + (10 + 4) = 24 seconds). The remaining 6 seconds of the media segment that was spliced then becomes a media segment on its own, right after the cue-in that signals the end of the 24 second break:

#EXTINF:10, no desc
#EXTINF:10, no desc
#EXTINF:10, no desc
#EXTINF:10, no desc
#EXTINF:14, no desc
#EXTINF:6, no desc
#EXTINF:10, no desc

MPEG-DASH signaling of SCTE 35

For a MPEG-DASH client manifest, Origin does not create a new period for cue-out events, but signals these events in the same period as the main event. The advantage of this is that the presentation remains backwards compatible with any device previously capable of playing this stream (if the player on such a devices silently ignores the presence of the EventStream element).

The SCTE 35 markers are carried in DASH Event Messages. The @presentationTime is relative to the Period@Start, the @messageData contains a base64 encoded representation of the message_data field in the emsg.

Each 'Event' will be signaled in an MPD as long as it is relevant. That is, an 'Event' signaling a 'cue-out' message will be present for the complete duration of the break, as signaled in the 'cue-out' message. Furthermore, each 'Event' will have an 'id' that is unique (which in most cases will the same as the 'splice id' signaled in the SCTE 35 'cue-out' message).

The below example is taken from MPEG-DASH - Pure live (SCTE 35)`. In this livestream the cue-out markers are exactly aligned with the media segment boundaries so that no media segments are spliced.

    <Signal xmlns="http://www.scte.org/schemas/35/2016">
    <Signal xmlns="http://www.scte.org/schemas/35/2016">

SCTE 35 based spliced media in DASH (index based)

In the example MPEG-DASH - Pure live (SCTE 35, spliced) livestream, the AdaptationSets in the MPD contain media segments with a duration of 8 seconds, because --mpd.minimum_fragment_length=8 is specified (the ingested fragments have a 1 second length and are concatenated into segments that have the 8 seconds duration that is specified using the --mpd.minimum_fragment_length option).

As the cue-out events signaled by the SCTE 35 markers in this stream do not align with the stream's media segment boundaries, the media segments containing the timestamps that represent the start and end of a cue-out event need to be spliced and Origin will append or prepend part of the spliced media segment to the previous or next media segment.

In the example that results in the media segments before and after a splice being between 4 and 12 seconds long, instead of the stream's original segment duration of 8 seconds. However, because the SegmentTemplate does not signal individual segments when $Number$ is used to index the segments, the contents of the SegmentTemplate element are no different than if splicing would not have been enabled in the server manifest of the publishing point. See:




This specifically relates to MPEG-DASH - Pure live (SCTE 35, spliced). We advise to use the SegmentTemplate $Time$ timeline alongside --splice_media for best accuracy

Insertion opportunities for MPEG-DASH

When a third party service is used to insert content based on the cue-out events in the MPEG-DASH client manifest that is generated by Origin, this service can create a multi-period presentation based on the original client manifest. When doing so, it should insert a new period inserted both at the time of the start and end of the cue-out event.

The second of the new periods will represent a return to the main event, while the first will represent the content that is inserted (e.g., an ad). The timing information required for this can be calculated based on the timestamp in the EventStream element of the MPD, where the start of the event is represented by the @presentationTime and the end of the event equals the sum @presentationTime and @duration.


When the original livestream contains ads and SCTE 35 markers are inserted to allow for these ads to be replaced, the markers also have a use when the ads are not yet replaced, because a device's player can be configured to use the events signaled in EventStream to fire beacons to gather metrics for the ads in the original livestream.


There is an important concern among broadcasters about the legacy devices impact. It is important to maintain compatibility with the existing device population. By using a single-period manifest the legacy devices can simply ignore the additional ad signaling.