Packages
SRT Source and Sink for Membrane Framework
Current section
Files
Jump to
Current section
Files
membrane_srt_plugin
README.md
README.md
# Membrane SRT Plugin[](https://hex.pm/packages/membrane_srt_plugin)[](https://hexdocs.pm/membrane_srt_plugin)[](https://circleci.com/gh/membraneframework/membrane_srt_plugin)It's a part of the [Membrane Framework](https://membrane.stream).## InstallationThe package can be installed by adding `membrane_srt_plugin` to your list of dependencies in `mix.exs`:```elixirdef deps do [ {:membrane_srt_plugin, "~> 0.2.3"} ]end```## Usage### Usage of the `Membrane.SRT.Source` with built-in serverIn 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 connectionwith 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 SRTwill be demuxed and saved to MP4 file named `output.mp4`.### Usage of the `Membrane.SRT.Source` with external serverIf 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 examplesYou 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.### OBS configuration<img width="1437" alt="image" src="https://github.com/user-attachments/assets/d5841a09-4edc-4e0a-b25a-a33d91d8f271" />## Copyright and LicenseCopyright 2020, [Software Mansion](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=membrane_template_plugin)[](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=membrane_template_plugin)Licensed under the [Apache License, Version 2.0](LICENSE)