Membrane.SRT.Source (Membrane SRT plugin v0.2.0)
View SourceMembrane Source acting as a SRT server.
It listens for connection on given port.
When the connection is estabilished, it start receiving stream
with given stream_id.
Element options
Passed via struct Membrane.SRT.Source.t/0
ipString.t() | nilDefault value:
nil
Address on which the server starts listening.port:inet.port_number() | nilDefault value:
nil
Port on which the server starts listening.stream_idString.t() | nilDefault value:
nil
ID of the stream which will be accepted by this server.passwordString.t() | nilDefault value:
nil
Password used to authenticate the connection. If set, the server will require clients to provide this password when connecting. If not set, the server will accept connections without authentication. Note that if you set this option, you must also set the same password on the client side when connecting to this server. Password needs to have between 10 and 79 characters.Please note that it can only be used along
ip,portandstream_idoptions (password cannot be set whenserverandconn_idare provided).serverExLibSRT.Server.t() | nilDefault value:
nil
Reference to an already-runningExLibSRT.Server. Must be provided together withconn_id.When using this option, the other options (
ip,port,stream_idandpassword) cannot be set. If you want to useMembrane.SRT.Sourcewith that option, remember to spawn the element right after receiving{:srt_server_conn, conn_id, stream_id}message from the server, so that the source can bind to the desired connection within the 1-second timeout.Exemplary usage scenario:
# Start the server listening on desired address and port {:ok, server} = ExLibSRT.Server.start(<ip>, <port>, accept_mode: :accept_all)
# Wait until a client with desired stream_id connects receive do
{:srt_server_conn, conn_id, _stream_id} -> pid = Membrane.RCPipeline.start_link!() # Spawn the `Membrane.SRT.Source` element and pass the server # and connection ID as arguments spec = child(:source, %Membrane.SRT.Source{server: server, conn_id: conn_id}) |> child(:sink, %Membrane.File.Sink{location: "output.ts"}) Membrane.RCPipeline.exec_actions(pid, spec: spec)end
conn_idExLibSRT.Server.connection_id() | nilDefault value:
nil
Connection ID received via{:srt_server_conn, conn_id, stream_id}. Must be provided together withserver.
Pads
:output
Accepted formats:
Membrane.RemoteStream| Direction: | :output |
| Availability: | :always |
| Flow control: | :push |
Summary
Types
Struct containing options for Membrane.SRT.Source
Types
@type t() :: %Membrane.SRT.Source{ conn_id: ExLibSRT.Server.connection_id() | nil, ip: String.t() | nil, password: String.t() | nil, port: :inet.port_number() | nil, server: ExLibSRT.Server.t() | nil, stream_id: String.t() | nil }
Struct containing options for Membrane.SRT.Source
Functions
@spec options() :: keyword()
Returns description of options available for this module