GithubHelp home page GithubHelp logo

streamwall / streamdelay Goto Github PK

View Code? Open in Web Editor NEW
48.0 6.0 2.0 350 KB

A delay + dump button for live streams, allowing screening and redaction of explict content.

License: MIT License

JavaScript 100.00%
stream srt rtmp censor bleep delay gstreamer

streamdelay's Introduction

Streamdelay

A pixelated stream filtered using streamdelay

Streamdelay enables streams to have "broadcast delay" for content redaction/filtering. Stream upload is delayed by a customizable duration, allowing a pixelization and audio blocking filter to be applied ahead of sensitive content being broadcast.

Streamdelay accepts an input stream using the SRT protocol (supported by OBS and ffmpeg), and can output to either an SRT or RTMP endpoint (such as twitch.tv or restream.io).

A UI is currently not provided. The streamdelay package is designed to run as a local service, controlled via its built-in API server. This is meant to be integrated into a larger stream management dashboard, such as streamwall.

Setup

Binaries

Binaries may be available via the releases page. You will need to install the GStreamer runtime for your platform.

Source

  1. Ensure you have the buildchain for your platform installed necessary to build binary node modules using node-gyp.
  2. Install GStreamer. You will need both the runtime and development headers installed.
  3. Run npm install. This will install dependencies and build the node-gstreamer-superficial library.

Usage

Starting Streamdelay

  1. Copy example.config.toml to config.toml and customize to suit your needs.
  2. Configure your streaming software to output to the SRT endpoint specified in "srtInUri".
  3. Run (binary) streamdelay --config=config.toml or (development) npm start -- --config=config.toml.
  4. Start streaming.

HTTP API

Streamdelay runs an HTTP server on the hostname and port you configure.

Authentication

Requests must either contain:

  • a Streamdelay-API-Key header equal to the apiKey value configured
  • a ?key=API_KEY query param equal to the apiKey value configured

All responses are Content-Type: application/json.

Get current status

GET /status

returns:

{
  isCensored: bool,
  isStreamRunning: bool,
  startTime: number?,
  state: {... full state object ...}
}

The state object can be matched using xstate's State.from constructor:

// Check if the stream is waiting for a connection
State.from(state).matches('stream.running.waiting')

// Check if the stream is connected and rolling
State.from(state).matches('stream.running.started')

// Check if we're in the process of deactivating the censorship mode
State.from(state).matches('censorship.censored.deactivating')

Start/stop the stream

Start / stop the streaming pipeline. When stopped, streamdelay disconnects from its input and output endpoints.

PATCH /status
Content-Type: application/json
{isStreamRunning: false} or {isStreamRunning: true}

returns: same as /status

Set status

Set the stream status to censored (redacted) or not. When transitioning from censored to uncensored status, Streamdelay will wait the configured delaySeconds before turning off the censored status. This helps prevent early release of the censored mode before the delayed content has been broadcast.

PATCH /status
Content-Type: application/json
{isCensored: false} or {isCensored: true}

returns: same as /status

WebSocket API

GET /ws?key=API_KEY
Upgrade: websocket

Upon initial connection, the current status will be sent in JSON format. It will be sent again whenever the status or state changes.

Sending a JSON message has the same behavior as PATCH /status.

streamdelay's People

Contributors

chromakode avatar tgreiser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

rnproj eisenyang

streamdelay's Issues

Errors trying to install

Trying to install on MacOS Monterey on a 2021 M1 MacBook Pro. Produces a wall of text I don't understand.

npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm ERR! code 7
npm ERR! git dep preparation failed
npm ERR! command /opt/homebrew/Cellar/node/19.0.1/bin/node /opt/homebrew/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/mark/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
npm ERR! > [email protected] install
npm ERR! > node-gyp rebuild
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info find Python using Python version 3.10.8 found at "/opt/homebrew/opt/[email protected]/bin/python3.10"
npm ERR! gyp ERR! UNCAUGHT EXCEPTION
npm ERR! gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
npm ERR! gyp ERR! stack     at createConfigFile (/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:117:21)
npm ERR! gyp ERR! stack     at /opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:84:9
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:189:23)
npm ERR! gyp ERR! System Darwin 21.6.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node/19.0.1/bin/node" "/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/mark/.npm/_cacache/tmp/git-clone-bc080093
npm ERR! gyp ERR! node -v v19.0.1
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! Node-gyp failed to build your package.
npm ERR! gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
npm ERR! npm ERR! code 7
npm ERR! npm ERR! path /Users/mark/.npm/_cacache/tmp/git-clone-bc080093
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c node-gyp rebuild
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /Users/mark/.npm/_logs/2022-11-13T03_32_43_355Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mark/.npm/_logs/2022-11-13T03_32_44_131Z-debug.log

I tried to paste the debug log as well but it says my comment is too long.

If there was just a simple error message I could probably figure it out but these walls of text are overwhelming. I just need to use this software, I feel like I shouldn't have to be a computer programmer.

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.