The source code
MistServers source code is available here.
Dependencies
- C++ compiler
- Meson
- mbedtls (optional, automatically compiled as a subproject if SSL is enabled and mbedtls is not installed system-wide)
- libsrt (optional, automatically compiled as a subproject if SRT is enabled and libsrt is not installed system-wide)
- librist (optional, automatically compiled as a subproject if RIST is enabled and librist is not installed system-wide).
OPTIONAL Recommended
- git (to pull in the code easily)
- libav (If encoding/transcoding processes are of interest)
Compiling
We support both Meson and CMake. We currently recommend building with Meson as it takes care of all libraries automatically. CMake is considered the legacy compile method, it will still work for now but support most likely will be dropped in the future.
Compile flags
For an up to date list of compile flags please look at the output of:
meson configure
List of compile flags:
| Flag | Default | Description |
|---|---|---|
| APPNAME | MistServer | Name of the application which will show in multiple outputs |
| DATASIZE | 40 | Size in mebibytes for live stream data pages |
| DEBUG | 4 | Default debug level. Recommended value for development is 4, recommended value for production is 3 |
| DISKSERIAL | DEFAULT | Lock MistServer to a specific disk through a given disk serial number |
| FILLER_DATA | false | Data used as filler data in various protocols that use/need it |
| LOAD_BALANCE | false | Build the MistServer Load Balancer (WIP) |
| NOAUTH | false | Disable API authentication entirely (insecure!) |
| NOLLHLS | false | Disable all forms of LL-HLS, falling back on plain HLS |
| NORIST | false | Disable RIST support, regardless of the library being present |
| NOSHM | false | Disable shared memory, use temporary files instead |
| NOSRT | false | Disable SRT support, regardless of the library being present |
| NOSSL | false | Disable SSL/TLS support |
| NOUPDATE | false | Disable the updater |
| NOUSRSCTP | false | Disable usrsctp (WebRTC data channels) support |
| RELEASE | DEFAULT | Release string used in the reported version information |
| STAT_DELAY | 15 | Delay to apply to statistics, used to consistently handle segmented protocols |
| STAT_CUTOFF | 600 | Time in seconds that statistics history is kept in memory |
| UDP_API_HOST | localhost | Hostname the internal UDP API listens on |
| UDP_API_PORT | 4242 | Port the internal UDP API listens on |
| WITH_AV | false | Enable libAV based processing, requires libav installed on system |
| WITH_SANITY | false | Enable MistOutSanityCheck for stream testing |
| WITH_THREADNAMES | false | Enable fancy names for threads (not supported on all platforms) |
Adding these compile flags to an existing Meson setup requires you to configure them using the -D flag. For example setting the default debug level to 3 (recommended production level) would be:
meson configure -DDEBUG=3
Setting multiple compile flags is quite easy as well:
meson configure -DDEBUG=3 -DNOAUTH=true -DNOUPDATE=true -DNORIST=true -DNOSRT=true -DWITH_AV=true
The above sets the default debug level to 3, removes the authorization for the browser interface, removes auto-update checks, disables RIST & SRT and finally builds libAV based processing binaries.
Meson
Compiling with the defaults is as easy as:
meson setup build
meson compile -C build
Compiling with setting compile flags:
meson setup build -DDEBUG=3
meson compile -C build
From scratch steps (Linux)
You'll need to install the dependencies, though we would also recommend git since you can then easily pull in the latest versions.
git clone https://github.com/DDVTECH/mistserver.git
cd mistserver
meson setup build
meson compile -C build
You'll find your MistServer binaries in the build folder, and you can immediately begin by booting the MistController binary.
./build/MistController
MistServer saves & loads the configuration from config.json from the folder you run the command from. If you want to load in a previously installed MistServer configuration be sure to use the -c /path/to/file boot parameter, for example:
./build/MistController -c /etc/mistserver.conf