Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scte-signal

A TUI tool that sends SCTE-35 splice signals via UDP to TSDuck's tsp spliceinject plugin.

Features

  • Interactive terminal UI with split-pane layout (menu + colored JSON log)
  • Ad break start/end via splice_insert
  • Blackout start/end via time_signal + splice_segmentation_descriptor (0x20/0x21 with UPID)
  • Event cancel and null keepalive signals
  • Input validation (event_id, duration, UPID)
  • Conflict detection (duplicate starts, orphan ends)

Quick Start

cargo run

Navigate with ↑↓ or jk, press Enter to select, q to quit.

Configuration

Create config.yaml in the working directory or set SCTE_CONFIG=/path/to/config.yaml:

tsp:
  udp_host: "127.0.0.1"
  udp_port: 9000

udp_port must match the spliceinject --udp port that tsp listens on.

Test Setup

Run tsp and ffmpeg manually in separate terminals, then start scte-signal. Start tsp first (it is the SRT listener), then ffmpeg, then the app.

Terminal 1: tsp (SRT in, listen for SCTE-35 on UDP 7777)

tsp --add-input-stuffing 1/10 \
    -I srt --listener 4900 \
    -P pmt --service 1 --add-programinfo-id 0x43554549 --add-pid 600/0x86 \
    -P spliceinject --service 1 --udp 9000 \
    -P splicemonitor --all-commands \
    -O drop

--add-input-stuffing makes room to inject, -P pmt declares the SCTE-35 PID, and spliceinject --udp 7777 is the socket the app sends to. Swap -O drop for -O srt --caller <host>:<port> to forward downstream.

Terminal 2: ffmpeg (generate a test source into SRT)

ffmpeg -re -f lavfi -i testsrc2=duration=600:size=1280x720:rate=30 \
       -f lavfi -i sine=frequency=1000:duration=600 \
       -c:v libx264 -b:v 2M -c:a aac \
       -f mpegts "srt://127.0.0.1:4900"

Terminal 3: scte-signal

cargo run

Select a signal type, fill in parameters, and observe the decoded SCTE-35 output in Terminal 1.

Project Structure

src/
├── main.rs              # Entry point
├── config.rs            # YAML config loading
├── domain/
│   ├── error.rs         # Typed validation errors
│   ├── signal.rs        # SignalCommand enum + validation
│   └── event_tracker.rs # Active event conflict detection
├── xml/
│   ├── model.rs         # TSDuck XML element structs
│   └── serialize.rs     # Struct → XML rendering
├── transport/
│   └── udp.rs           # UDP sender
└── tui/
    ├── mod.rs           # Terminal setup + event loop
    ├── app.rs           # App state + command execution
    └── ui.rs            # Split layout + colored JSON rendering

Running Tests

cargo test

About

A TUI tool that sends SCTE-35 splice signals via UDP to TSDuck's tsp spliceinject plugin

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages