Scte35.Net 0.3.0

dotnet add package Scte35.Net --version 0.3.0
                    
NuGet\Install-Package Scte35.Net -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Scte35.Net" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Scte35.Net" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Scte35.Net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Scte35.Net --version 0.3.0
                    
#r "nuget: Scte35.Net, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Scte35.Net@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Scte35.Net&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Scte35.Net&version=0.3.0
                    
Install as a Cake Tool

Scte35.Net

CI NuGet

<p align="center"> <img alt="Scte35.Net logo" src="./logo.png" width="400" />

</p>

A .NET 8 library for parsing and generating SCTE‑35 cue messages, adapted to idiomatic C# with guardrails around binary parsing and validation.

Based in part on Comcast's scte35-go, with C#/.NET adaptations and additional validation.

  • Source: src/Scte35.Net
  • Tests: tests/Scte35.Net.Tests
  • License: Apache 2.0

Features

  • Decode/encode SCTE‑35 splice_info_section to/from bytes, Hex, and Base64.
  • High-level helpers: FromHex, FromBase64, TryDecode, ToHex, ToBase64.
  • Commands: SpliceNull, SpliceSchedule, SpliceInsert, TimeSignal, BandwidthReservation, Private (unknown → preserved).
  • Descriptors: Avail, DTMF, Segmentation, Time, Audio, plus opaque Private descriptors.
  • CRC32 (MPEG‑2) computed/validated via Crc32Valid.
  • .NET 8 target, nullable enabled.

Install

  • NuGet (package id: Scte35.Net):
    • dotnet add package Scte35.Net
  • From source: open Scte35.Net.sln, then dotnet restore and dotnet build.

Quick Start

Decode from Base64/Hex/Bytes

using Scte35.Net;
using Scte35.Net.Model;

// Base64
SpliceInfoSection section = Scte35.FromBase64("/DABAAAAAAAAAP/wFAUAAABf+/w==");

// Hex ("0x" prefix optional)
section = Scte35.FromHex("FC300000000000000FFF0140500000017FEFF");

// Raw bytes
if (Scte35.TryDecode(mySpan, out var parsed)) {
    // parsed.SpliceCommandType, parsed.SpliceDescriptors, parsed.Crc32Valid, ...
}

Create a Basic Time Signal and Encode

using Scte35.Net;
using Scte35.Net.Model;
using Scte35.Net.Model.Enums;
using Scte35.Net.Model.SpliceCommand;

var section = new SpliceInfoSection {
    SapType = SapType.NotSpecified,
    Tier = 0x0FFF,
    SpliceCommand = new TimeSignalCommand {
        TimeSpecifiedFlag = true,
        // 10 seconds in 90kHz ticks
        PtsTime90K = 10UL * 90_000
    }
};

byte[] wire = Scte35.Encode(section);
string b64 = Scte35.ToBase64(section);
string hex = Scte35.ToHex(section);

Create a Basic Splice Insert (Program Immediate)

using Scte35.Net.Model.SpliceCommand;

var insert = new SpliceInsertCommand {
    SpliceEventId = 1,
    OutOfNetworkIndicator = true,
    ProgramSpliceFlag = true,
    SpliceImmediateFlag = true,
    DurationFlag = false,
    UniqueProgramId = 1,
    AvailNum = 0,
    AvailsExpected = 0
};

var msg = new SpliceInfoSection { SpliceCommand = insert };
string insertHex = Scte35.ToHex(msg);

Tests

  • Run: dotnet test -c Release
  • Suite: xUnit; tests mirror source (e.g., tests/Scte35.Net.Tests/Model/SpliceInsertTests.cs).
  • Focus areas: bit‑exact encode/decode, CRC32 validation, descriptor loops, and edge cases (e.g., 33‑bit PTS masking).
  • Includes conformance/spec vector coverage under tests/Scte35.Net.Tests/Conformance.

Advanced

  • Private Commands: pass a recognizer to skip unknown PrivateCommand identifiers during decode: Scte35.FromHex(hex, privateId => privateId == 0x43554549 /* CUEI */);
  • Hex/Base64 helpers are available via Scte35.ToHex/ToBase64 and Bytes utilities.

Contributing

Use Conventional Commits; include tests for new behavior. Ensure dotnet build and dotnet test pass locally. CI builds, tests, and packs.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 213 11/1/2025
0.2.2 278 10/29/2025
0.2.1 284 10/29/2025
0.2.0 267 10/29/2025