Configuring MistServer
MistServer can be configured through the API & Interface, by default this is port 4242. Any browser can reach MistServer over HTTP and log in. The very first time you're booting MistServer you will be asked to create an account either through terminal or browser if the first boot method does not open a terminal.
Editing the configuration of MistServer directly is also an option. The config file can be found as config.json in the same folder as MistController or at /etc/mistserver.conf if ran as a service.
| Method | How |
|---|---|
| API | HTTP GET/POST JSON to port 4242 |
| Interface | Visit http://address:4242 |
| Configuration | Edit the MistServer JSON config file |
Especially for the first time we recommend just reaching the interface with any browser and going to http://address:4242 and doing initial configuration through the interface before using the API or direct configuration manipulation
Creating your local MistServer account
The first time you connect to MistServer you will be prompted to create an account. This will be the information necessary to authorize any configuration changes within MistServer. You will also have the option to enable all default protocols, we recommend using this option if testing MistServer is your intent.
Any time you access MistServer through a localhost address this will be detected and login authorization will be skipped.
3 important pages
-
Protocol page This is where you setup how others can reach MistServer, both for viewers and sending streams towards MistServer.
-
Streams page Streams is where you set up any possible stream within MistServer. Each stream must have its own unique
stream namethat is used to identify/select the matching stream. -
Push page This is where you set up pushes towards other servers/platforms, but also recordings.
1. Protocol page
The Protocol page determines the methods others can reach your MistServer instance. This applies to both viewers, but also streams send towards your MistServer using protocols such as RTMP, WebRTC and SRT.
Note that even if MP4 is not set up MistServer would be able to open MP4 files. Likewise if SRT or HLS is not set up MistServer would still be able to open those addresses.
For a first time use we recommend enabling the default protocols. This will open the following:
| Protocol | Port |
|---|---|
| HTTP | 8080 (tcp) |
| HTTPS | 4433 (tcp) (requires manual setup) |
| RTMP | 1935 (tcp) |
| RTSP | 5554 (tcp) |
| SRT | 8889 (udp) |
| WebRTC | 18203 (udp) (also uses HTTP or HTTPS) |
We have non-standard ports for some protocols because anything under port 1000 needs administrator permissions and to avoid conflicting with other applications. We absolutely recommend using The default for HTTP (80), HTTPS (443) and RTSP (554) if the server is dedicated to MistServer.
2. Streams page
This is where you set up Streams within MistServer and allows a quick overview of any streams currently available or set up. You can right click on any stream for visiting stream specific pages or deleting the stream.
Streams in blueare active, but not set up & can be created by rightclicking on them.Streams in whiteare configured, but not necessarily live/active unless the status says so.
Creating a stream can be done through the create a new stream button.
Creating a stream
When creating a new stream there are 2 key settings:
-
Stream name:This is how MistServer identifies the stream internally and how you can quickly access the stream with your player. -
Source:This determines how MistServer should get to the stream data for the given stream name. This could be a live input, creating a port for others to push towards or local video on demand file.
Some of the most used type of inputs are listed here.
| Type of Source | Syntax | Example | Used for |
|---|---|---|---|
| Media file | path | /media/example.mp4 | Ingesting a media file |
| Media folder | path | /media/ | Monitoring a folder for media files |
| SRT | srt://:port | srt://:9876 | Opening a SRT-Listening port to push towards |
| Live Push inputs | push:// | push:// | Others to push RTMP, SRT, RTSP or WebRTC to MistServer |
| Live pull inputs | http://address | http://example.com/index.m3u8 | Pulling in streams over HTTP or HTTPS |
| UDP MPEGTS input | tsudp://address:port | tsudp://234.234.234.234:9876 | Binding the given address and receiving MPEG-TS over UDP |
More inputs can be found at our Stream settings
Media files / VoD Sources
The only requirement here is to provide the path to the media file you want to stream. This file should be accessible as if available on a local disk. You can also select a folder to make all the streams within that folder available.
A single .dtsh file will be created and put adjacent to the media file. This is to quicker load in the media next time.
Live streams
Live streams are any type of source that are not locally stored within MistServer. Even if the source is a file on an outside location. These sources can be divided in 2 types:
Push inputs
Push inputs mean another server connects to MistServer and pushes in the stream data. MistServer waits for this device to make connection. Most incoming pushes can be set up using the following source:
push://(address)(@password)
address: Optional, if used white-list only the given source to push this stream.
@password: Optional and obsolete if stream keys are used, if used the push attempt must include this password.
in MistServer the following protocols can be used through push:// sources: RTMP, RTSP, SRT, WebRTC.
Some push inputs can or need to dedicate a specific port to the protocol. In this case a specific source needs to be given starting with the protocol scheme.
Directly below the source field will appear how to push using specific protocols and the MistServer defaults.
push://
Then push using the following settings:
| Protocol | Push target |
|---|---|
| RTMP | rtmp://address/live/streamname |
| SRT | srt://address:8889?streamid=streamname |
| RTSP | rtsp://address:5554/streamname |
| WebRTC-WS | ws://address:8080/webrtc/streamname |
| WHIP | http://address:8080/webrtc/streamname |
Stream keys
Stream keys allow you to change the streamname part of a push into an unique token for your users. This sets an extra security layer on your streams for your users while keeping playback of streams easily predictable. We recommend using it if you're planning to let your users push streams towards your MistServer.
Pull inputs
Pull inputs mean MistServer connects to an outside address and pulls in whatever stream is available at the given address. Simply fill in the address and watch the stream appear.
MPEG-TS over UDP
Both Unicast and Multicast addresses can be used through this input. A specific network interface can also be chosen by adding it to the address. The full syntax for that would be:
tsudp://address:port/interface
For example to listen on 234.234.234.234 on port 9876 using the interface that holds address 123.456.789.123 would be:
tsudp://234.234.234.234:9876/123.456.789.123
3. Push page
Here you can set up pushing outputs within MistServer. For MistServer recording a stream to a local file path is considered a push as well, the only difference is that you're pushing it towards a local file instead of a remote address.
Automatic vs single push
An automatic push is a pushing rule that will activate whenever the result of the rule is true. These can be scheduled by stream activation, time and (custom) variables. For detailed use of automatic pushes we recommend visiting how to push/record documentation. In most cases the defaults would suffice, which is whenever the stream becomes active start the push/recording.
A single push is starting a push output towards the target right now. If MistServer is unable to do so the push stops and does not restart in any way. This push will stop if the stream it's pushing goes offline, it receives a stop request or when a stop parameter is true. For more detailed pushes we recommend looking at the how to push/record documentation.
Push basics
Any push requires a stream name and a target. All the available targets types should show up in a drop down menu when you start selecting the target. Most MistServer users will want to set up an automatic push using just the stream name and target, that would mean that whenever the stream goes live, also do this push and/or recording.
Example:
- Stream: example
- Target: rtmp://example.com/live/example
Tips
-
For RTMP if your stream contains a
?MistServer will assume you're trying to apply track selectors. In this case add an additional?at the end, it will not be added to the stream. Alternatively set up thehostapplicationandstreamid. The syntax is:rtmp://host/application/streamid. -
A
stream namecan have as many (automatic) pushes as you like. -
Variable substitutions can be used to automatically fill in information such as the stream name or the current time/day/etc.
-
Track selectors can be used to specify which video/audio track should be used for the push. By default MistServer goes for the last added video/audio tracks compatible with the chosen protocol.
-
Removing an Automatic push rule does not stop a current active push, it will only prevent a new push from starting.
-
We recommend recording streams in .ts or .mkv for best compatibility. When recording to MP4 a fMP4 will be generated which is not compatible with all devices/players. To create a normal MP4 record in another format, create a stream out of the recording file and download the MP4 output.
-
You can disable Automatic pushing rules to temporary make them unable to start.