SRT

The datarhei Core includes a simple SRT server for publishing and playing streams. It is not enabled by default. You have to enable it in the config in the srt section or via the corresponding environment variables.

SRT is a modern live streaming protocol with a low latency and network failure tolerance. Read more.

The SRT server supports publishing and requesting streams, similar to an RTMP server. With your SRT client you have to connect to the SRT server always in caller mode and live transmission mode.

Example:

srt://127.0.0.1:6000?mode=caller&transmode=live&streamid=...

Passphrase

If a passphrase is set in the config (or via environment variable), you have to provide the passphrase in the SRT URL. Example SRT URL with the passphrase foobarfoobar:

srt://127.0.0.1:6000?mode=caller&transmode=live&streamid=...&passphrase=foobarfoobar

StreamID

In order to define whether you want to publish or request a resource, you have to provide your intent in the streamid.

The streamid is formatted as follows:

[resource],mode:[request|publish],token:[token]

The resource is the name of the stream. This can be anything. You can publish only one stream with that same name.

The mode is either request or publish. If you don't provide a mode, request will be assumed. You can only request resources that are currently publishing. You can only publish resources that are not already publishing.

The token is the one defined in the config (see srt.token). If no token is configured, you can omit the token in the streamid.

Examples

Publishing the resource 12345 with the token foobar:

12345,mode:publish,token:foobar

Publishing the resource 12345 with no token defined in the configuration:

12345,mode:publish

Requesting the resource 12345 with no token defined in the configuration:

12345

Requesting the resource 12345 with the token foobar:

12345,token:foobar

The whole SRT URL might look like this for the last example:

srt://127.0.0.1:6000?mode=caller&transmode=live&streamid=12345,token:foobar

API

Via the SRT endpoint in the API you can gather statistics about the currently connected SRT clients.

Last updated