View Source Membrane.RTSP.Source (Membrane RTSP plugin v0.5.1)

Source bin responsible for connecting to an RTSP server.

This element connects to an RTSP server, depayload and parses the received media if possible. If there's no suitable depayloader and parser, the raw payload is sent to the subsequent elements in the pipeline.

In case connection can't be established or is severed during streaming this bin will crash.

The following codecs are depayloaded and parsed:

  • H264
  • H265
  • AAC (if sent according to RFC3640)

When the element finishes setting up all tracks it will send a t:set_up_tracks/0 notification. Each time a track is parsed and available for further processing the element will send a t:new_track/0 notification. An output pad Pad.ref(:output, ssrc) should be linked to receive the data.

Bin options

Passed via struct Membrane.RTSP.Source.t/0

  • stream_uri

    binary()

    Required
    The RTSP URI of the resource to stream.

  • allowed_media_types

    [:video | :audio | :application]

    Default value: [:video, :audio, :application]
    The media type to accept from the RTSP server.

  • transport

    transport()

    Default value: :tcp
    Transport protocol that will be used in the established RTSP stream. In case of UDP a range needs to be provided from which receiving ports will be chosen.

  • timeout

    Time.t()

    Default value: 15000000000
    RTSP response timeout

  • keep_alive_interval

    Time.t()

    Default value: 15000000000
    Interval of a heartbeat sent to the RTSP server at a regular interval to keep the session alive.

  • on_connection_closed

    :raise_error | :send_eos

    Default value: :raise_error
    Defines the element's behavior if the TCP connection is closed by the RTSP server:

    • :raise_error - Raise an error.
    • :send_eos - Send an :end_of_stream to the output pad.

Pads

:output

Accepted formats:

_any
Direction::output
Availability::on_request

Summary

Functions

Returns description of options available for this module

Types

Link to this type

new_track_notification()

View Source
@type new_track_notification() ::
  {:new_track, ssrc :: pos_integer(), track :: track()}
Link to this type

set_up_tracks_notification()

View Source
@type set_up_tracks_notification() :: {:set_up_tracks, [track()]}
@type t() :: %Membrane.RTSP.Source{
  allowed_media_types: [:video | :audio | :application],
  keep_alive_interval: Membrane.Time.t(),
  on_connection_closed: :raise_error | :send_eos,
  stream_uri: binary(),
  timeout: Membrane.Time.t(),
  transport: transport()
}

Struct containing options for Membrane.RTSP.Source

@type track() :: %{
  control_path: String.t(),
  type: :video | :audio | :application,
  fmtp: ExSDP.Attribute.FMTP.t() | nil,
  rtpmap: ExSDP.Attribute.RTPMapping.t() | nil
}
@type transport() ::
  {:udp, port_range_start :: non_neg_integer(),
   port_range_end :: non_neg_integer()}
  | :tcp

Functions

@spec options() :: keyword()

Returns description of options available for this module