Skip to content

SRT playback

Flussonic supports playing SRT streams. Read more about SRT at Using SRT protocol.

SRT port is usually configured per stream, i.e. one SRT stream per port. Nevertheless, Flussonic provides you with the way to set up a single global SRT port for multiple streams. For example, if you use SRT for restreaming only, it may come in handy. The playback URL depends on the way you choose to specify the port, read more

One SRT stream per port

To configure an SRT port to play a single SRT stream, use srt_play configuration in the stream settings like so:

stream example_stream {
  input fake://fake;
  srt_play {
  port 9998;
  }
}

To play the stream, use the following URL:

  • srt://FLUSSONIC-IP:SRT_PORT

where:

  • FLUSSONIC-IP is an IP address of your Flussonic server.
  • SRT_PORT is an SRT port, specified for playback.

Thus, for our example_stream the link will look as follows: srt://localhost:9998. Using the srt_play you allow to play the SRT stream over a specified port.

You can also define an SRT port for a particular stream not only for a playback, but also for publishing (see Publishing SRT stream to learn more about publishing SRT streams to Flussonic). To configure a single SRT port to publish and play a stream, use srt PORT_NUMBER option in the stream settings:

stream example_stream {
  input publish://;
  srt 9998;
}

In the example above we publish some SRT stream to example_stream over port 9998 and we can also play this stream over the same port, using the following URL format:

  • srt://FLUSSONIC-IP:SRT_PORT?streamid=#!::m=request

where:

  • streamid is a string formatted as described here.
  • m=request is a playback mode.

streamid is used here to specify the mode m= to play the stream example_stream as it is not obvious now whether we are going to publish the stream or to play it.

So the URL for our stream is srt://localhost:9998?streamid=#!::m=request.

Besides using one SRT port for one stream to allow playback for a particular stream, Flussonic provides you with the way to use one port for multiple SRT streams.

One SRT port to play multiple streams

To enable one SRT port for playback only for any number of streams, use srt_play as a global setting:

srt_play {
  port 9998;
}
stream example_stream {
  input fake://fake;
}

To play example_stream over the 9998 SRT port, use the following URL:

  • srt://FLUSSONIC-IP:SRT_PORT?streamid=#!::r=STREAM_NAME

where:

  • streamid is a string formatted as described here.
  • r=STREAM_NAME is a stream name.

So for the above example the URL looks as follows: srt://localhost:9998?streamid=#!::r=example_stream.

Let us consider one more example. Say you publish an SRT stream to Flussonic over a specified publishing port, and then you need to play it along with other streams. So the example configuration looks as follows:

srt_play {
  port 9998;
}
stream example_stream {
  input fake://fake;
}
stream another_stream {
  input publish://;
  srt_publish {
    port 8888;
  }
}

The URL for another_stream is different from the URL for the example_stream stream, and looks as follows:

  • srt://FLUSSONIC-IP:SRT_PORT?streamid=#!::r=STREAM_NAME,m=request

where:

  • m=request is a playback mode.
  • r=STREAM_NAME is a stream name.

So the resulting URL for our example: srt://localhost:9998?streamid=#!::r=another_stream,m=request.

The summary is tabulated in the table below for your convenience:

Playback URL Configuration Description URL example
srt://FLUSSONIC-IP:SRT_PORT stream example_stream {
input fake://fake;
srt_play {
port 9988;
}
}
Allows playing only one stream per port.
Supported by most players.
srt://localhost:9988
srt://FLUSSONIC-IP:SRT_PORT?streamid=#!::m=request " _wzxhzdk:21_="
" input="input" publish:_wzxhzdk:22_="publish://;
" srt="srt">stream example_stream
Allows publishing and playing a stream over the same SRT port. srt://localhost:8888?streamid=#!::m=request
srt://FLUSSONIC-IP:SRT_PORT?streamid=#!::r=STREAM_NAME srt_play {
port 9999;
}
stream example_stream {
input fake://fake;
}
Allows playing several streams over the same SRT port. srt://localhost:9999?streamid=#!::r=example_stream
srt://FLUSSONIC-IP:SRT_PORT?streamid=#!::r=STREAM_NAME,m=request srt_play {
port 9988;
}
stream example_stream {
input fake://fake;
}
stream another_stream {
input publish://;
srt_publish {
port 8888;
}
}
Having a specified publishing port for the stream allows playing the stream over a globally defined SRT port. srt://localhost:9988?streamid=#!::r=another_stream,m=request

Parameters for an SRT playback

Flussonic allows you to manage the playback by setting the parameters.

Example with passphrase:

stream example_stream {
  input fake://fake;
  srt_play {
    passphrase 0987654321;
    port 9998;
  }
}

The URL will look like this:

  • srt://FLUSSONIC-IP:9998?passphrase=0987654321&streamid=#!::m=request