View Source Membrane.RTP.Demuxer (Membrane RTP plugin v0.30.0)

Element capable of receiving a raw RTP stream and demuxing it into individual parsed streams based on packet ssrcs.

Output pads can be linked either before or after a corresponding stream has been recognized. In the first case the demuxer will start sending buffers on the pad once a stream with payload type or SSRC matching the identification provided via the pad's options is recognized. In the second case, whenever a new stream is recognized and no waiting pad has matching identification, a new_rtp_stream_notification/0 is sent to the element's parent. In turn it should link an output pad of this element, passing the SSRC received in the notification as an option, to receive the stream.

Element options

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

  • payload_type_mapping

    RTP.PayloadFormat.payload_type_mapping()

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

  • not_linked_pad_handling

    %{action: :raise | :ignore | :warn, timeout: Membrane.Time.t()}

    Default value: %{timeout: 2000000000, action: :warn}
    This option determines the action to be taken after a stream has been announced with a new_rtp_stream_notification/0 notification but the corresponding pad has not been connected within the specified timeout period.

Pads

:input

Accepted formats:

%RemoteStream{type: :packetized, content_format: cf} when cf in [RTP, RTCP, nil]
Direction::input
Availability::always
Flow control::auto

:output

Accepted formats:

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

Pad options:

  • stream_id

    stream_id()

    Required
    Specifies what stream will be sent on this pad. If ssrc of the stream is known (for example from new_rtp_stream_notification/0), then most likely it should be used, since it's unique for each stream. If it's not known (for example when the pad is being linked upfront), encoding or payload type should be provided, and the first identified stream of given encoding or payload type will be sent on this pad.

Summary

Types

Notification sent by this element to it's parent when a new stream is received. Receiving a packet with previously unseen ssrc is treated as receiving a new stream.

Metadata present in each output buffer. The ExRTP.Packet.t() struct contains parsed fields of the packet's header. The payload field of this struct will be set to <<>>, and the payload will be present in payload field of the buffer.

Options for pad :output

t()

Struct containing options for Membrane.RTP.Demuxer

Functions

Returns description of options available for this module

Types

new_rtp_stream_notification()

@type new_rtp_stream_notification() ::
  {:new_rtp_stream,
   %{
     ssrc: Membrane.RTP.ssrc(),
     payload_type: Membrane.RTP.payload_type(),
     extensions: [ExRTP.Packet.Extension.t()]
   }}

Notification sent by this element to it's parent when a new stream is received. Receiving a packet with previously unseen ssrc is treated as receiving a new stream.

output_metadata()

@type output_metadata() :: %{rtp: ExRTP.Packet.t()}

Metadata present in each output buffer. The ExRTP.Packet.t() struct contains parsed fields of the packet's header. The payload field of this struct will be set to <<>>, and the payload will be present in payload field of the buffer.

output_pad_opts()

@type output_pad_opts() :: [{:stream_id, stream_id()}]

Options for pad :output

stream_id()

@type stream_id() ::
  {:ssrc, Membrane.RTP.ssrc()}
  | {:encoding_name, Membrane.RTP.encoding_name()}
  | {:payload_type, Membrane.RTP.payload_type()}

t()

@type t() :: %Membrane.RTP.Demuxer{
  not_linked_pad_handling: %{
    action: :raise | :ignore | :warn,
    timeout: Membrane.Time.t()
  },
  payload_type_mapping: Membrane.RTP.PayloadFormat.payload_type_mapping()
}

Struct containing options for Membrane.RTP.Demuxer

Functions

options()

@spec options() :: keyword()

Returns description of options available for this module