Introduction
Live video at the delay of a video call, to thousands of viewers, in one browser tag.
Nearglass carries live video from your source to your viewers with the delay of a video call, not of a broadcast. You send video from OBS, an encoder or your own device; your viewers watch in a web page or a native app; we run the relays in between.
What you build with it
- A live event where seconds matter. An auction, a race, a live sale: every viewer sees the moment at the same time, close enough to the source that a bid or a bet lands on what is really happening.
- A machine people drive over the web. One driver at a time sends commands back through the same relays while everyone else watches (Controller seats).
- A shared screen or camera inside your own app. The same stream plays in a web page and in a native Windows app.
How it fits together
your encoder or device --SRT, RTMP, WHIP or the SDK--> ingest --MoQ--> relays --MoQ--> players
|
your backend --secret key--> control API --tokens--------------------------+
your page --publishable key--^ (streams, seats, usage, webhooks)- Publishers send one stream: OBS or any encoder over SRT, RTMP or WHIP,
ffmpeg, thenearglasscommand line tool, or your own device with the SDK library. - Relays fan the stream out over MoQ (Media over QUIC). A viewer joins the nearest one.
- Players play it: the
<nearglass-player>element in any page,@nearglass/reactin a React app, or the C library in a native app. Browsers that cannot play MoQ (Safari, iPhone) fall back to LL-HLS by themselves. - The control API is where your backend creates streams, hands out seats with short-lived tokens, and reads usage. It is the only part your code talks to directly.
The ideas behind it (streams, keys, seats and tokens, the viewer cap, metering, the fallback) are in Concepts.
Start here
| Quickstart | a stream playing in a web page, from nothing, with packages only |
| Concepts | the few ideas the API, the player and the publishers are built on |
| Publish | OBS, SRT, RTMP, WHIP, ffmpeg, the native encoder, a device, audio |
| Play | the web player, React, a native Windows app, phones and Safari |
| Secure | viewer and publisher tokens, renewal, admission and caps |
| Operate | usage and spending caps, webhooks, monitoring, self-hosting, regions |
| Reference | the control API, the player, the CLI, config files, error codes |
What is in the box
| Package | What it is |
|---|---|
@nearglass/player | the browser player: plain ES modules, no dependencies, no build step |
@nearglass/react | a React component around the player |
nearglass | the command line tool: publish a file, run an ingest gateway, mint tokens |
nearglass-ffi | the C library (nearglass.h) for publishing from a device and playing in a native app |
nearglass-relay | the relay, as a Debian package, for running your own |