SRT
OvenMediaEngine supports playback of streams delivered via RTMP, WebRTC, SRT, MPEG-2 TS, and RTSP using SRT-compatible players or integration with other SRT-enabled systems.
Currently, OvenMediaEngine supports H.264, H.265, AAC codecs for SRT playback, ensuring the same compatibility as its SRT provider functionality.
Configuration
Bind
To configure the port for SRT to listen on, use the following settings:
The SRT Publisher must be configured to use a different port than the one used by the SRT Provider.
Application
You can control whether to enable SRT playback for each application. To activate this feature, configure the settings as shown below:
SRT client and streamid
streamid
As with using SRT as a live source, multiple streams can be serviced on a single port. To distinguish each stream, you must set the streamid
in the format <virtual host>/<app>/<stream>/<playlist>
.
streamid = "<virtual host name>/<app name>/<stream name>/<playlist name>"
SRT clients such as FFmpeg, OBS Studio, and srt-live-transmit
allow you to specify the streamid
as a query string appended to the SRT URL. For example, you can specify the streamid
in the SRT URL like this to play a specific SRT stream: srt://host:port?streamid=default/app/stream/playlist
.
Playback
To ensure that SRT streaming works correctly, you can use tools like FFmpeg or OBS Studio to verify the functionality. Here is the guidance on how to playback the stream using the generated SRT URL.
The SRT URL to be used in the player is structured as follows:
SRT Publisher creates a default playlist named playlist
with the first track from each of the audio tracks and video tracks, and all data tracks.
For example, to playback the default/app/stream
stream with the default playlist from OME listening on port 9998
at 192.168.0.160
, use the following SRT URL:
srt://192.168.0.160:9998?streamid=default/app/stream/playlist
You can input the SRT URL as shown above into your SRT client. Below, we provide instructions on how to input the SRT URL for each client.
FFplay (FFmpeg/FFprobe)
If you want to test SRT with FFplay, FFmpeg, or FFprobe, simply enter the SRT URL next to the command. For example, with FFplay, you can use the following command:
If you have multiple audio tracks, you can choose one with -ast
parameter
OBS Studio
OBS Studio offers the ability to add an SRT stream as an input source. To use this feature, follow the steps below to add a Media Source:
Once added, you will see the SRT stream as a source, as shown below. This added source can be used just like any other media source.
VLC
You can also playback the SRT stream in VLC. Simply select Media
> Open Network Stream
from the menu and enter the SRT URL.
Using Playlist
OvenMediaEngine automatically generates a default playlist regardless of whether a playlist is specified, so this step is optional.
When playing back stream via SRT, you can use a playlist configured for Adaptive Bitrate Streaming (ABR) to ensure that only specific audio/video renditions are delivered.
By utilizing this feature, you can provide services with different codecs, profiles, or other variations to meet diverse streaming requirements.
Configuration for playlists
Since SRT does not support ABR, it uses only the first rendition when there are multiple renditions.
Since SRT is packaged in the MPEG-TS, the EnableTsPackaging
option must be set to true
to use the playlist.
Playback using the playlists
To play a stream using a particular playlist, specify the Playlist.FileName
to the playlist name in the SRT playback URL, as shown below:
SRT playback URL using default playlist
SRT playback URL using 360p
playlist
SRT playback URL using 1080p
playlist
SRT Socket Options
You can configure SRT's socket options of the OvenMediaEngine server using <Options>
. This is particularly useful when setting the encryption for SRT, and you can specify a passphrase by configuring as follows:
For more information on SRT socket options, please refer to https://github.com/Haivision/srt/blob/master/docs/API/API-socket-options.md#list-of-options.
Last updated
Was this helpful?