DEV Community

Amar Thodupunoori
Amar Thodupunoori

Posted on

SCTE-35 Ad Insertion: Easiest Way to Professional Ads

SCTE-35 is the industry standard that enables TV networks and professional broadcasters to seamlessly cut away from a live event to a commercial break at exactly the right moment.

It isn’t done manually by someone hitting a switch. It’s fully automated using SCTE-35 markers embedded in the video stream.

If you are building a streaming platform, you likely want to monetize your content. However, Ant Media Server (AMS) does not insert the ads itself. Instead, it acts as the crucial bridge in the ecosystem. It preserves the ad markers from your source stream and passes them downstream so that specialized Server-Side Ad Insertion (SSAI) services (like AWS Elemental MediaTailor) know exactly when to swap your live feed for an ad.

We are excited to announce a new plugin for Ant Media Server that enables full SCTE-35 support, converting SRT stream markers into HLS cues for professional ad workflows.

What is SCTE-35 and Why Does It Matter?
SCTE-35 is the “digital cue card” of the video industry. It signals downstream systems that an event, like an ad break, is about to happen. Without these signals, ad insertion servers are blind; they don’t know when to trigger an ad. The diagram below illustrates how SCTE-35 markers flow through the system:

scte scte-35 hls manifest ad insertion

This plugin solves a specific interoperability challenge:

Ingest: It takes an SRT stream containing SCTE-35 data.
Process: It parses the MPEG-TS payload to find splice commands (Table ID 0xFC).
Output: It injects standard HLS ad markers (#EXT-X-CUE-OUT / #EXT-X-CUE-IN) into the manifest (.m3u8).
Importantly, Ant Media Server does not remove your original video segments. The plugin simply “wraps” your existing content with SCTE markers, so the stream remains playable even without an ad insertion server. Your original segments stay in the manifest as slate or placeholder content.

When an Ad Insertion Server like AWS MediaTailor reads the manifest, it uses these markers to seamlessly stitch ads into the stream, replacing your slate during CUE-OUT and switching back to live content at CUE-IN.

Installation
First of course, you need ant media server installed. Follow the docs here.

The plugin source code is available on GitHub. It can be compiled by using build.sh script available in the repository. Or download compiled .jar here.

Getting the plugin running requires adding the JAR file and registering a filter in your application configuration.

Deploy the Plugin
Copy the plugin JAR file to your application’s plugin directory:
cp SCTE35Plugin.jar /usr/local/ant-media-server/plugins/

Configure the Filter
You must register the SCTE35ManifestModifierFilter in your application’s web.xml. This filter intercepts the HLS manifest generation to inject the tags.
Open /usr/local/ant-media-server/webapps/AppName/WEB-INF/web.xml and add the following entry


SCTE35ManifestModifierFilter
io.antmedia.scte35.SCTE35ManifestModifierFilter
true


SCTE35ManifestModifierFilter
/streams/*

Important: Place this after the HlsManifestModifierFilter entry to ensure the execution order is correct.
Restart and Verify
Restart the server to load the new config:
sudo systemctl restart antmedia

Check the logs (/var/log/antmedia/ant-media-server.log) to confirm successful initialization. You should see:
SCTE-35 Plugin initialized successfully
SCTE35ManifestModifierFilter is properly registered
Preparing Your Source Stream
For production, you simply need to push an SRT stream that already contains SCTE-35 data in its MPEG-TS payload to Ant Media Server. The plugin handles the rest automatically.

However, testing SCTE-35 can be tricky. If you want to run a quick test to verify your pipeline is working, we strongly recommend using a known valid source rather than generating one from scratch.

Why not FFMPEG? During our testing, we found that while FFMPEG handles video well, it often fails to transmit SCTE-35 packets correctly over SRT to the server side.

The Recommended Test Approach: We have provided a pre-baked test file that contains SCTE-35 ad triggers every 2 to 5 minutes. You can use the srt-live-transmit tool to stream this file to AMS reliably.

Download the test stream from this link
Stream it using srt-live-transmit:
cat scte35_spliceInsert_2hour_demo.ts | pv -L 19K | srt-live-transmit file://con "srt://your-server:4200?streamid=WebRTCAppEE/your_stream"
Stream the file with a bitrate limit to match the content
Integration: Testing with an Ad Insertion Server
Once your stream is running in AMS, the HLS manifest will start populating with SCTE tags. Any SSAI (Server-Side Ad Insertion) platform that supports HLS with SCTE-35 markers will work—such as AWS MediaTailor, Google Ad Manager, Broadpeak, or Yospace. In this example, we’ll use AWS MediaTailor to demonstrate the integration. When SCTE cue get hit in media timeline, you should see something like this in the .m3u8 file:

EXTINF:6.000,segment001.ts

EXT-X-DISCONTINUITY

EXT-X-CUE-OUT:30.000

EXTINF:6.000,segment002.ts

To see the ads in action:

  1. Create a Configuration in MediaTailor

Video Content Source: http:///YourAppName/
Important: MediaTailor requires port 80 (HTTP). Ensure your AMS is accessible via standard HTTP.
Set Ad Decision Server URL: You can use a standard VAST/VMAP test URL (like TheoPlayer’s demo VAST for verification.

  1. Playback with ads:

MediaTailor replaces the AMS base URL with its own. Append your stream path to the MediaTailor URL:

Original: http:///YourAppName/streams/stream1.m3u8
MediaTailor: https:///streams/stream1.m3u8
Summary
This plugin opens the door for broadcast-grade monetization on Ant Media Server. By bridging the gap between SRT ingest and HLS-based ad insertion, you can now integrate seamlessly with the industry’s leading SSAI tools.

In this blog post, we explored how to use the SCTE-35 plugin to enable server-side ad insertion with Ant Media Server. We hope this guide helps you get started with broadcast-grade monetization for your streams. If you have any questions, please feel free to contact us via contact@antmedia.io.

Top comments (0)