summaryrefslogtreecommitdiff
path: root/README.md
blob: 8d092fb4b2cfdd00901f798ae437bca1c60afeee (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
67
<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 simple and relatively 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
* `index.html` - static html file with js for a dash player and xmpp
  web chat
* `brook-metrics` - the only custom server-side program to track
  viewer metrics
* `prosody` - An XMPP server to back the chat room


## 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 are already running an nginx, or prosody, you will have to
manually integrate [`nix`](./nix) into your configuration.  In case
you don't, you can simply include the whole module.

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

Then you can use the various `brook` submodules to configure your
streaming setup.  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.

```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";
  };
};
```