huds
Head-Up-Display Server (HUDS)
Last updated a day ago by rse .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install huds 
SYNC missed versions from official npm registry.

HUDS

Head-Up-Display Server (HUDS)

Abstract

HUDS is a small server providing a Web service for serving one or more HTML Single-Page Applications (SPA) which act as "Head-Up-Displays (HUD)" or "Overlays" in video production scenarios. It is specially intended to be used with OBS Studio's CEF-based Browser Source and optionally the Elgato Stream Deck remote control device and its System:Website function.

HUDS serves the static files of one or more HUD HTML5 SPAs, which render the actual HUD display in OBS. It also provides a HUDS client API to each HUD HTML5 SPA for establishing a WebSocket connection back to HUDS. Over this WebSocket connection HUDS pushes events to each HUD which were received by HUDS either via WebSocket connections or REST endpoints. The REST endpoint is intended to be used by arbitrary Web clients to send events to any HUD. Usually, this is used with the Stream Deck System:Website plugin or with curl(1) on the command-line.

HUDS itself is usually run ad-hoc and side-by-side to OBS Studio (under localhost) but also can be deployed to a dedicated server by optionally requiring authentication and delivering one or more HUDs in parallel.

Installation

Install Node.js and then install HUDS globally into your system with:

$ npm install -g huds

Usage

The Unix manual pages huds(8) (for the server CLI) and huds(3) (for the client API) provide detailed usage information.

Example

Run a minimalistic Hello World HUD with:

$ npx -p huds -p huds-hud-hello \
  huds -a 127.0.0.1 -p 9999 -d hello:@huds-hud-hello

For a more elaborated HUD check out the Training HUD. It supports performing trainings as webinars and looks like this in practice:

screenshot

Architecture

HUDS is based on a Client/Server architecture as illustrated in the following diagram:

architecture

The individual communication steps in the diagram are:

  1. HUDS reads the HUD configuration and converts its content from YAML to JSON format for embedding into the HUDS (Client) Library. See training.yaml for an example of a HUD configuration.

  2. OBS Studio's CEF-based Browser Source open the URL http://127.0.0.1:9999/<hud-id>/

  3. HUDS delivers the HUD SPA with all its HTML/CSS/JS files. The individual assets are served via the HUDS URLs http://127.0.0.1:9999/<hud-id>/<asset>. See Hello World HUD for an example of a simple HUD and Training HUD for an example of a more elaborated HUD.

  4. The HUD SPA (in its index.html) references the HUDS (Client) Library with: <script type="text/javascript" src="huds"></script>.

  5. HUDS delivers the HUDS (Client) Library (and its embedded HUD configuration) under virtual HUDS URL http://127.0.0.1:9999/<hud-id>/huds.

  6. The HUDS (Client) Library opens a WebSocket connection back to HUDS under the HUDS URL http://127.0.0.1:9999/<hud-id>/events.

  7. An external program (like Elgato Stream Deck's System:Website function or Node-RED's HTTP-Request or just cURL) triggers an event with a HTTP GET request under the HUDS URL http://127.0.0.1:9999/<hud-id>/event/<event-name>[?data=<event-data>]. and with a HTTP POST request under the HUDS URL http://127.0.0.1:9999/<hud-id>/event/<event-name> and with <event-data> as the payload. In both cases, <event-data> has to be a JSON string.

  8. HUDS forwards the received event to all instances of the HUD by sending out the event to all HUD SPAs over their WebSocket connections. Notice: a single HUD can be opened multiple times and then all opened instances receive the event. This is useful to run a HUD both in OBS Studio and in parallel in the browser on a control notebook in case no dedicated Elgato Streak Deck remote control device is used.

  9. Similary, even HUD SPAs are allowed to send events (to theirself or other HUDs) over their WebSocket connection. This is useful to have a central dashboard HUD which controls one or more actual video HUDs.

License

Copyright © 2020 Dr. Ralf S. Engelschall (http://engelschall.com/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Current Tags

  • 1.5.1                                ...           latest (a day ago)

25 Versions

  • 1.5.1                                ...           a day ago
  • 1.5.0                                ...           17 days ago
  • 1.4.2                                ...           18 days ago
  • 1.4.1                                ...           25 days ago
  • 1.4.0                                ...           25 days ago
  • 1.3.1                                ...           2 months ago
  • 1.3.0                                ...           2 months ago
  • 1.2.2                                ...           2 months ago
  • 1.2.1                                ...           2 months ago
  • 1.2.0                                ...           2 months ago
  • 1.1.0                                ...           2 months ago
  • 1.0.1                                ...           2 months ago
  • 1.0.0                                ...           2 months ago
  • 0.9.11                                ...           2 months ago
  • 0.9.10                                ...           2 months ago
  • 0.9.9                                ...           2 months ago
  • 0.9.8                                ...           2 months ago
  • 0.9.7                                ...           2 months ago
  • 0.9.6                                ...           2 months ago
  • 0.9.5                                ...           2 months ago
  • 0.9.4                                ...           2 months ago
  • 0.9.3                                ...           2 months ago
  • 0.9.2                                ...           2 months ago
  • 0.9.1                                ...           2 months ago
  • 0.9.0                                ...           2 months ago
Maintainers (1)
Downloads
Today 0
This Week 9
This Month 9
Last Day 9
Last Week 0
Last Month 56
Dependencies (19)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |