Membrane.RTP.Muxer (Membrane RTP plugin v0.31.4)

View Source

Element that combines multiple streams into a single RTP stream.

Each new input stream is assigned a unique SSRC that the packets transporting this stream will have. The demuxer will try to resolve what payload_type and clock_rate should be assumed based on the incoming stream format and passed pad options. Timestamps are calculated based on assumed clock_rate.

Element options

Passed via struct Membrane.RTP.Muxer.t/0

  • payload_type_mapping

    RTP.PayloadFormat.payload_type_mapping()

    Default value: %{}
    Mapping of the custom RTP payload types ( > 95).

  • srtp

    false | [ExLibSRTP.Policy.t()]

    Default value: false
    Specifies whether to use SRTP to encrypt the output stream. Requires adding srtp dependency to work. If true takes a list of SRTP policies to use for encrypting packets. See ExLibSRTP.Policy.t/0 for details.

Pads

:input

Accepted formats:

RTP
Direction::input
Availability::on_request
Flow control::auto

Pad options:

  • ssrc

    RTP.ssrc() | :random

    Default value: :random
    SSRC that this stream will be assigned. If not provided, a random free value will be assigned.

  • initial_sequence_number

    ExRTP.Packet.uint16() | :random

    Default value: :random
    Sequence number that will be assigned to the first packet of this stream. Sequence numbers of subsequent packets will be determined by incrementing this value. This value should be generated randomly to prevent known payload attacks.

  • initial_timestamp

    ExRTP.Packet.uint16() | :random

    Default value: :random
    RTP Timestamp that will be assigned to the first packet of this stream. Timestamps of subsequent packets will be calculated starting from this value. This value should be generated randomly to prevent known payload attacks.

  • payload_type

    RTP.payload_type() | nil

    Default value: nil
    Payload type of the stream. If not provided, determined from the resolved encoding name.

  • encoding

    RTP.encoding_name() | nil

    Default value: nil
    Encoding name of the stream that will be used if the muxer fails to infer it from incoming stream format. Used for determining payload_type, if it wasn't provided.

  • clock_rate

    non_neg_integer() | nil

    Default value: nil
    Clock rate to use. If not provided, determined from resolved payload type.

:output

Accepted formats:

%RemoteStream{type: :packetized, content_format: RTP}
Direction::output
Availability::always
Flow control::auto

Summary

Types

Options for pad :input

t()

Struct containing options for Membrane.RTP.Muxer

Functions

Returns description of options available for this module

Types

input_pad_opts()

@type input_pad_opts() :: [
  ssrc: Membrane.RTP.ssrc() | :random,
  initial_sequence_number: ExRTP.Packet.uint16() | :random,
  initial_timestamp: ExRTP.Packet.uint16() | :random,
  payload_type: Membrane.RTP.payload_type() | nil,
  encoding: Membrane.RTP.encoding_name() | nil,
  clock_rate: non_neg_integer() | nil
]

Options for pad :input

t()

@type t() :: %Membrane.RTP.Muxer{
  payload_type_mapping: Membrane.RTP.PayloadFormat.payload_type_mapping(),
  srtp: false | [ExLibSRTP.Policy.t()]
}

Struct containing options for Membrane.RTP.Muxer

Functions

options()

@spec options() :: keyword()

Returns description of options available for this module