Membrane SRT Plugin
It's a part of the Membrane Framework.
Installation
The package can be installed by adding membrane_srt_plugin to your list of dependencies in mix.exs:
def deps do
[
{:membrane_srt_plugin, "~> 0.1.1"}
]
endUsage
Usage of the Membrane.SRT.Source with built-in server
In the simplest scenario Membrane.SRT.Source can be used in a built-in server mode.
It starts the ExLibSRT.Server on its own and then accept only a single client connection
with the assumed stream ID.
To see how it works you can run the following script:
elixir examples/receiver.exs
The receiver will be waiting for the SRT connection on port 1234 for all the available network interfaces.
When the SRT client with assumed stream ID (some_stream_id) connects, the content of stream sent via SRT
will be demuxed and saved to MP4 file named output.mp4.
Usage of the Membrane.SRT.Source with external server
If you don't know the client's stream ID in advance or when you want to handle multiple client connections on the same server port,
you can use the Membrane.SRT.Source in external server mode.
Run the following script:
elixir examples/receiver_with_external_server.exs
It starts a standalone ExLibSRT.Server and then each time a new client connects, it spawns a pipeline with
Membrane.SRT.Source using the external server reference.
Usage of the Membrane.SRT.Client
Membrane.SRT.Client connects on the given address and starts streaming with given stream ID.
To see it in action, run:
elixir examples/sender.exs
The sender will send a fixture content of MPEG-TS file via SRT on 127.0.0.1:1234 with stream id:
some_stream_id.
Running examples
You can run one of the receiver scripts (examples/receiver.exs or
examples/receiver_with_external_server.exs) and then in a new shell you can run examples/sender.exs
to see how the SRT connection is estabilished.
Alternatively, you can run one of the receiver scripts (examples/receiver.exs or
examples/receiver_with_external_server.exs) and stream to srt://127.0.0.1:1234?streamid=some_stream_id with the use of OBS.
Copyright and License
Copyright 2020, Software Mansion
Licensed under the Apache License, Version 2.0