View Source Membrane.RTMP.SourceBin (Membrane RTMP plugin v0.28.1)

Bin responsible for demuxing and parsing an RTMP stream.

Outputs single audio and video which are ready for further processing with Membrane Elements. At this moment only AAC and H264 codecs are supported.

The bin can be used in the following two scenarios:

  • by providing the URL on which the client is expected to connect - note, that if the client doesn't connect on this URL, the bin won't complete its setup
  • by spawning Membrane.RTMPServer, receiving client reference after client connects on a given app and stream_key and passing the client reference to the Membrane.RTMP.SourceBin.

Bin options

Passed via struct Membrane.RTMP.SourceBin.t/0

  • client_ref

    pid()

    Default value: nil
    A pid of a process acting as a client reference. Can be gained with the use of Membrane.RTMPServer.

  • url

    String.t()

    Default value: nil
    An URL on which the client is expected to connect, for example: rtmp://127.0.0.1:1935/app/stream_key

  • client_timeout

    Membrane.Time.t()

    Default value: 5000000000
    Time after which an unused client connection is automatically closed, expressed in Membrane.Time.t() units. Defaults to 5 seconds.

Pads

:audio

Accepted formats:

AAC
Direction::output
Availability::on_request

:video

Accepted formats:

H264
Direction::output
Availability::on_request

Summary

Types

t()

Struct containing options for Membrane.RTMP.SourceBin

Functions

Returns description of options available for this module

Passes the control of the socket to the source.

Passes the control of the ssl socket to the source.

Types

@type t() :: %Membrane.RTMP.SourceBin{
  client_ref: pid(),
  client_timeout: Membrane.Time.t(),
  url: String.t()
}

Struct containing options for Membrane.RTMP.SourceBin

Functions

@spec options() :: keyword()

Returns description of options available for this module

Link to this function

pass_control(socket, source)

View Source
@spec pass_control(:gen_tcp.socket(), pid()) :: :ok | {:error, atom()}

Passes the control of the socket to the source.

To succeed, the executing process must be in control of the socket, otherwise {:error, :not_owner} is returned.

Link to this function

secure_pass_control(socket, source)

View Source
@spec secure_pass_control(:ssl.sslsocket(), pid()) :: :ok | {:error, any()}

Passes the control of the ssl socket to the source.

To succeed, the executing process must be in control of the socket, otherwise {:error, :not_owner} is returned.