npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@astronautlabs/scte104

v1.0.1

Published

Implementation of the SCTE-104 TCP/IP protocol

Downloads

73

Readme

@/scte104

npm

📜 ANSI/SCTE 104 2019r1
Automation System To Compression System Communications Applications Program Interface (API)

📺 Part of the Astronaut Labs Broadcast Suite
@/is04 | @/rfc8331 | @/rtp | @/scte104 | @/scte35 | @/st2010 | @/st291

🚀 Production Quality
This library is functionally complete and is ready for use in production.


A complete implementation of the SCTE-104 TCP/IP protocol in Typescript. Supports both client and server, and includes a command line client.

Summary

This library provides a low-level, compliant implementation of the Automation System to Compression System TCP/IP signalling protocol specified in SCTE-104. It can be used to make calls to compliant SCTE-104 "injectors" or to implement SCTE-104 "injectors" themselves.

The library supports all of the messages for Provisioning and Alarm Management (PAMS), encryption, scheduling, and nearly all the messages that are outside of the "Simple Profile" specified in SCTE-104. Messages which are not natively supported can still be sent and received using custom implementations.

Uses @/bitstream to handle bitstream serialization/deserialization.

Command Line Client

This package also includes a simple command-line client for sending quick splice start/end messages to a SCTE 104 injector/automation system.

npm install @astronautlabs/scte104 -g
scte104 --server injector.example.com splice-start --immediate --program-id 12345

For complete set of options, use scte104 --help.

Client Library

import * as SCTE104 from "@astronautlabs/scte104";

async function main(argv : string[]) {
    let client = new SCTE104.Client();
    await client.connect('10.10.10.0');
    await client.init();

    // Signal a spliceStart_normal in immediate mode
    await client.multipleOperations({
        operations: [
            <SCTE104.Splice>{
                opID: SCTE104.MOP.SPLICE,
                splice_insert_type: SCTE104.SPLICE_START_NORMAL,
                splice_event_id: Date.now() / 1000,
                unique_program_id: 22211,
                pre_roll_time: 4000,
                break_duration: 0,
                avail_num: 0,
                avails_expected: 0,
                auto_return_flag: 1
            }
        ]
    })

    // spliceEnd_normal
    await client.multipleOperations({
        operations: [
            <SCTE104.Splice>{
                opID: SCTE104.MOP.SPLICE,
                splice_insert_type: SCTE104.SPLICE_END_NORMAL,
                splice_event_id: Date.now() / 1000,
                unique_program_id: 22211,
                pre_roll_time: 4000,
                break_duration: 0,
                avail_num: 0,
                avails_expected: 0,
                auto_return_flag: 1
            }
        ]
    })
}

main(process.argv.slice(1));

Server Library

import * as SCTE104 from '@astronautlabs/scte104';

let server = new SCTE104.Server();
server.messageReceived.subscribe(event => {

    // For example:
    
    if (event.message.opID == SCTE104.OP.INIT_REQUEST) {
        await event.connection.sendMessage(new SCTE104.InitResponse().with({
            result: SCTE104.RESULT.SUCCESS
        }));
    }
});
server.listen();

The class of event.message is dependent on the type of message being sent. It can be a subclass of SingleOperationMessage or an object of type MultipleOperationMessage. You can compare the opID field of the message to the constants found in SCTE104.OP and SCTE104.MOP, depending on the type of operation you are interested in.

event.connection represents the incoming network connection which sent the message. This allows you to respond once you've completed processing on the incoming message.

You (as the caller of the library) are expected to provide your own application logic. The Server class just exposes the ability to accept a connection from a '104 client, subscribe to notifications of incoming messages from that connection, and send messages back.

Roadmap

  • Provide an easy to access API for SCTE-104 encoding/decoding for auxiliary usecases
  • Provide an optional higher-level, opinionated fluent API on top