aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 5a9eb194ddf76ab86ea00faeecaeeb2dc3964e76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<div align="center">
    <img src="https://git.spacekookie.de/brook/plain/docs/logo.png" width="256px"/>
    <h1>brook</h1>
</div>

A minimal self-hostable streaming setup.


## Setup

`brook` is a modular project, meaning that many different components
come together to provide a lightweight streaming setup.  Following is
a quick overview of components.

* `ffmpeg` - running an rtmp server, and converting video to dash
  output format
* `nginx` - serves the dash directory
* `prosody` - An XMPP server to back the chat room
* `brook-web` - a simple static HTML front-end, supporting dash.js
  video playback, and an XMPP web chat via converse.js
* `brook-metrics` - a server-side service to track viewer metrics


## Configuration

I'm running my brook instance on NixOS, and as such a lot of the
configuration is Nix specific.  For other linux distributions, or to
consider a reference implementation for other systems, check the
[`common`](./common) directory.

### NixOS

If you want to use XMPP chats, you need to configure prosody
yourself - `brook` will only setup the anonymous user virtualhost to
be used by the brook-web chat.

Get started by importing the module.

```nix
imports = [
  /path/to/brook/nix
];
```

After that you can use the various `brook` submodules to configure your
streaming setup.

```nix
services.brook = {
  nginx = {
    enable = true;
    hostAddr = "stream.spacekookie.de";
    acmeHost = "spacekookie.de";
  };
  
  prosody = {
    enable = true;
    certRoot = "/var/lib/acme/spacekookie.de";
  };
  
  dash = {
    enable = true;
    name = "kookie.tv";
  };
};
```