filiphanes / websocket-overlays

Websocket controlled Video Overlay server for OBS-Studio, XSplit, CasparCG, ProPresenter and everything with web browser.
MIT License
28 stars 8 forks source link
caspercg html5 nodejs obs-studio propresenter python websocket-overlays websocket-server websockets xsplit

Websocket Overlay

My other project web-overlays implements websocket, mqtt and gun protocols for syncing data.

Simple and powerfull remote controlled html pages useful for overlays in OBS Studio, Casper CD, XSplit or simply fullscreen browser.

Check out overlays project using gundb: https://github.com/filiphanes/gun-overlays

Features

Install

You can run server with Python or Nodejs.

Python 3.6+ is needed. You can download it from https://www.python.org/downloads/

pip3 install websockets

NodeJS is needed. You can download it from https://nodejs.org/en/

npm install ws

Run

1. Run websocket server

Python server:

python3 server.py 127.0.0.1 8089

Node server:

node server.js 127.0.0.1 8089

2. Open controller

Open in browser lower-third-simple/controller.html.

3. Open overlay

Open in browser lower-third-simple/overlay.html

Setup in playout software

Setting you might need to change is websocket URI in overlay.html and controller.html in directory your-overlay/. FSet it to the same IP address and port as your server is running on.

WEBSOCKET_URI = "ws://127.0.0.1:8089/"

OBS Studio

  1. Click the plus button under Sources
  2. Select BrowserSource
  3. Name the source and click "OK"
  4. Check the "Local file" box
  5. Click the "Browse" button on the right and select the client.html you want to use
  6. Set the Resolution to 1920x1080 (Width: 1920; Height: 1080) or the overlay resolution
  7. Set FPS to you stream FPS (examples: 25, 30, 50, 60)

Caspar CG

https://github.com/CasparCG/help/wiki/Media:-HTML-Templates

ProPresenter

https://learn.renewedvision.com/propresenter6/the-features-of-propresenter/web-view

XSplit

https://help.xsplit.com/en/articles/5142996-webpage

New overlays

You can create your own overlay and associated controller without implementing server.

Server API

Server API is made simple and universal. Server only keeps state of overlay and broadcasts state updates from controller to all connected clients.

Usually you want to send commands to overlay like show or hide something. With state updating aproach you don't send {"command":"show-counter"} and {"command":"hide-counter"}, but rather {"show-counter":true} and {"show-counter":false}.

This approach is more robust against errors on network. Controller and overlay can connect and disconnect any time and he recieves full state and don't need to replay commands from history.

Thanks

This project was inspired by

TODO