101: How to Create SCTE 35 & 224 Markers for HLS, JSON, XML, Python, JavaScript, & Ruby

To create SCTE markers for DAI (Dynamic Ad Insertion) for live streaming, you can use a variety of scripting languages and tools. Here are a few examples:

SCTE-35 is a standard for signaling ad insertion opportunities in live streams. It uses MPEG-2 Transport Stream packets to insert “cue” messages that indicate the start and end of ad breaks. To create SCTE-35 markers, you can use tools like SCTE-35 Commander or SCTE-35 Injector. These tools allow you to create SCTE-35 messages and insert them into your live stream.

1. HLS: HLS (HTTP Live Streaming) is a streaming protocol that allows for dynamic ad insertion in live streams. To create SCTE markers for HLS, you can use the EXT-X-CUE-OUT and EXT-X-CUE-IN tags. These tags indicate the start and end of an ad break and can be used to trigger the insertion of ad content. Here is an example of an HLS manifest with SCTE markers:

“`m3u8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-CUE-OUT:DURATION=30
#EXTINF:10.0,
https://example.com/live/stream_720p/chunk_00001.ts
#EXTINF:10.0,
https://example.com/live/stream_720p/chunk_00002.ts
#EXT-X-CUE-IN
#EXTINF:10.0,
https://example.com/live/ad_720p/chunk_00001.ts
#EXTINF:10.0,
https://example.com/live/ad_720p/chunk_00002.ts
#EXT-X-CUE-OUT:DURATION=30
#EXTINF:10.0,
https://example.com/live/stream_720p/chunk_00003.ts
#EXTINF:10.0,
https://example.com/live/stream_720p/chunk_00004.ts
#EXT-X-CUE-IN
#EXTINF:10.0,
https://example.com/live/ad_720p/chunk_00003.ts
#EXTINF:10.0,
https://example.com/live/ad_720p/chunk_00004.ts
#EXT-X-ENDLIST
“`

In this example, the SCTE markers are represented by the EXT-X-CUE-OUT and EXT-X-CUE-IN tags. These tags indicate the start and end of an ad break, and the ad content is inserted between them.

2. JSON: SCTE-224 is a standard for signaling ad breaks in live streams using JSON metadata. To create SCTE markers using SCTE-224, you can use tools like the SCTE-224 Event Scheduler or the SCTE-224 Event Injector. These tools allow you to create JSON metadata that signals the start and end of ad breaks in your live stream.

3. XML: Like JSON, SCTE-224 also supports XML metadata for signaling ad breaks in live streams. You can use XML tags to specify the start and end of ad breaks and other metadata. For example:

“`xml
<ADI>
<Asset>
<Metadata>
<SCTE35>
<SpliceInfoSection>
<SpliceInsert>
<SpliceEvent>
<SpliceEventId>12345</SpliceEventId>
<SpliceOutOfNetworkIndicator>false</SpliceOutOfNetworkIndicator>
<SpliceImmediateFlag>true</SpliceImmediateFlag>
<BreakDuration>30000</BreakDuration>
</SpliceEvent>
</SpliceInsert>
</SpliceInfoSection>
</SCTE35>
</Metadata>
</Asset>
</ADI>
“`

In this example, an SCTE-35 splice event is specified using XML tags within an Asset Description and Metadata Interface (ADI) file.

4. Python: You can also use Python scripts to generate SCTE-35 messages for DAI. For example, the SCTE-35 Python library allows you to create SCTE-35 messages using Python code. Here’s an example Python script that creates an SCTE-35 message:

“`python
from scte35 import SpliceInfoSection, SpliceInsert

splice_event = SpliceInsert(
splice_event_id=12345,
out_of_network=False,
immediate=True,
break_duration=30
)

splice_info_section = SpliceInfoSection(
splice_insert=splice_event
)

scte35_message = splice_info_section.to_bytes()
“`

This script creates a splice event with ID 12345, a break duration of 30 seconds, and other parameters, and then generates an SCTE-35 message using the scte35 library.

5. JavaScript: If you’re working with web-based live streaming technologies like HLS or DASH, you can use JavaScript to manipulate the manifest files and insert SCTE markers. For example, you could use JavaScript to modify the EXT-X-CUE-OUT and EXT-X-CUE-IN tags in an HLS manifest file to indicate ad breaks.

6. Ruby: Ruby is another scripting language that can be used to generate SCTE-35 messages for DAI. The SCTE35 gem is a Ruby library that allows you to create and parse SCTE-35 messages. Here’s an example Ruby script that creates an SCTE-35 message:

“`ruby
require ‘scte35’

splice_event = SCTE35::SpliceInsert.new(
splice_event_id: 12345,
out_of_network: false,
immediate: true,
break_duration: 30
)

splice_info_section = SCTE35::SpliceInfoSection.new(
splice_insert: splice_event
)

scte35_message = splice_info_section.to_binary_s
“`

This script creates a splice event using the SCTE35 gem, sets its parameters, and generates an SCTE-35 binary message.

Overall, the choice of scripting language and tool depends on the specific requirements of your live streaming setup. These examples show some common options for creating SCTE markers for DAI in live streaming.

101: What is ESAM Scripting for YouTube & SCTE DAI?

First, what is SCTE? (pronounced scut-e). The Society of Cable Telecommunications Engineers (SCTE) is a professional association that offers education, certification, and standards for the telecommunications industry. SCTE serves as a technical and applied science leader, providing training and certification programs in broadband, cable networks, and digital video. It has a diverse membership of professionals, including engineers and technicians, who work in the cable and telecommunications industries.

Next, what is ESAM? ESAM stands for Event Signaling and Management. It is a protocol used in cable networks to provide advanced notification and management of network events. ESAM allows for the delivery of messages that can be used to signal events such as program start and end times, emergency alerts, and other network events. It is an important component of the CableLabs Enhanced Content Specification, which is a set of technical specifications used in digital TV networks. ESAM is designed to enhance the functionality and interoperability of networks, improving the viewing experience for subscribers.

ESAM scripting for SCTE:

1. Identify the video content that needs to be marked up with SCTE markers. These could be ad breaks, chapter markers, or other significant events in the video.

2. Use an ESAM editor tool to create the ESAM script. There are several tools available, such as ESAM Creator and ESAM Builder. These tools allow you to create, edit, and validate the ESAM script.

3. Define the SCTE markers in the ESAM script. Each marker should include the timecode, duration, and type of event. For example, an ad break marker could be defined as a “cue-in” event with a duration of 30 seconds.

4. Validate the ESAM script to ensure that it is compliant with the SCTE specification. Use the ESAM editor tool to run the validation process and check for any errors or warnings.

5. Save the ESAM script and upload it to your YouTube account. You can do this by selecting the video content in your YouTube Studio dashboard, navigating to the “Advanced” tab, and uploading the ESAM script in the “Content ID” section.

6. Review the video content to ensure that the SCTE markers are working correctly. You can use the YouTube player to test the markers and make any necessary adjustments to the ESAM script.

By following these steps, you can create an ESAM script for YouTube SCTE that will help you manage and monetize your video content more effectively.

An ESAM script is an XML-based file that contains information about events or markers that occur in video content. These markers can be used for a variety of purposes, such as indicating ad breaks, chapter markers, or other significant events in the video.

Here is an example of an ESAM script for a dynamic commercial SCTE marker in XML format:

“`xml
<?xml version=”1.0″ encoding=”UTF-8″?>
<ESAM xmlns=”urn:ietf:params:xml:ns:esam:1.0″>
<EventSignal Time=”00:05:00.000″ Duration=”00:00:30.000″ Type=”Commercial”>
<Metadata>
<MetadataItem Name=”AdType”>Dynamic</MetadataItem>
<MetadataItem Name=”AdID”>1234</MetadataItem>
<MetadataItem Name=”AdTitle”>Example Ad</MetadataItem>
<MetadataItem Name=”Advertiser”>Acme Corp</MetadataItem>
</Metadata>
</EventSignal>
</ESAM>
“`

In this example, the ESAM script includes a “Commercial” event signal that occurs at the 5-minute mark of the video and lasts for 30 seconds. The metadata associated with the event signal includes information about the ad type, ID, title, and advertiser.

By using ESAM scripts like this one, video content creators and distributors can manage and monetize their content more effectively, while providing a better experience for viewers.

More scripting tomorrow…. stay tuned!