Coder Social home page Coder Social logo

dpirlo / scte35-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from comcast/scte35-js

0.0 0.0 0.0 6.5 MB

A SCTE 35 Parser for JavaScript

Home Page: https://comcast.github.io/scte35-js/

License: Apache License 2.0

TypeScript 7.29% JavaScript 0.87% HTML 77.67% Stylus 0.32% CSS 13.85%

scte35-js's Introduction

ANSI/SCTE-35 JS

ANSI/SCTE35 JS PARSER

SCTE35 tools for parsing in CLI using NodeJS or in a "modern" browser.

Demo

Visit https://comcast.github.io/scte35-js/ and paste the following in the text box and hit the Parse button:

/DBGAAET8J+pAP/wBQb+AAAAAAAwAi5DVUVJQAErgX+/CR9TSUdOQUw6OGlTdzllUWlGVndBQUFBQUFBQUJCQT09NwMDaJ6RZQ==

In order to deploy changes to the demo read the README found at https://github.com/Comcast/scte35-js/tree/master/ui.

SCTE35 Module

// See ISCTE35 for methods & ISpliceInfoSection for results.
    import { SCTE35 } from "scte35";
    const scte35: SCTE35 = new SCTE35();
    const result = scte35.parseFromB64("<base64 string>");

CLI

The parser can be executed from the bin by first installing it globally and then executing the scte35 command:

    npm i scte35 -g
    scte35
    > ? Please provide the SCTE-35 tag that you would like to parse

Parsing defaults to base 64, however hexadecimal can easily be parsed as well using the --hex flag

    #default base64
    scte35 /DBGAAET8J+pAP/wBQb+AAAAAAAwAi5DVUVJQAErgX+/CR9TSUdOQUw6OGlTdzllUWlGVndBQUFBQUFBQUJCQT09NwMDaJ6RZQ==

    #hexadecimal
    scte35 --hex fc3046000113f09fa900fff00506fe000000000030022e4355454940012b817fbf091f5349474e414c3a386953773965516946567741414141414141414242413d3d370303689e9165

    #both will output the formatted JSON
    > {
        "tableId": 252,
        "selectionSyntaxIndicator": false,
        "privateIndicator": false,
        ...
    }

Piping

The parser output can be piped into other tools, such as a JSON display utility like fx in order to visualize the JSON object and interact with it.

    npm i -g fx
    scte35 /DBGAAET8J+pAP/wBQb+AAAAAAAwAi5DVUVJQAErgX+/CR9TSUdOQUw6OGlTdzllUWlGVndBQUFBQUFBQUJCQT09NwMDaJ6RZQ== | fx

scte35-js's People

Contributors

avhetman avatar estobbart avatar courtfinn avatar johnriv avatar kristakhare avatar rosmaryg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.