Membrane.MoQ.Sink (Membrane MoQ plugin v0.1.0)

Copy Markdown View Source

Membrane Sink acting as a MoQ publisher.

Connects to a MoQ relay server and publishes audio and video tracks to a single, configured broadcast.

Tracks are advertised in both the hang and the IETF MSF catalog, so hang-native and MSF-based consumers can subscribe alike. Pads can be added or removed at any time during the pipeline lifecycle. The catalogs are republished on every track add/remove and mid-stream format change.

Frames are encapsulated in the wire container selected with the container option and optionally batched with latency.

Parent notifications

  • {:disconnected, reason :: String.t()} when the session drops after setup. The sink takes no action on its own; the parent decides whether to tear it down.

Element options

Passed via struct Membrane.MoQ.Sink.t/0

  • url

    String.t()

    Required
    URL to the MoQ relay server.

  • broadcast

    String.t()

    Required
    Broadcast path, see Broadcast at https://doc.moq.dev/concept/layer/moq-lite.html#terminology

  • container

    :legacy | :loc

    Default value: :legacy
    Wire container for media frames, applied to every track of this sink and advertised per rendition in the catalog.

  • latency

    Membrane.Time.t()

    Default value: 0
    How long each track buffers frames before writing them to the wire, trading latency for batched writes. With the default of 0, every frame is written immediately. Audio tracks are unaffected apart from up to one frame of added delay: every audio frame starts a new MoQ group, which flushes the buffer.

  • disable_tls_verify?

    boolean()

    Default value: false
    Whether to disable TLS verification when connecting to the relay. Useful for local development.

Pads

:input

Accepted formats:

%Membrane.AAC{encapsulation: :none}
%Membrane.Opus{self_delimiting?: false}
%Membrane.H264{stream_structure: ss} when Membrane.H264.is_avc(ss)
%Membrane.H265{stream_structure: ss} when Membrane.H265.is_hvc(ss)
Direction::input
Availability::on_request
Flow control::auto

Pad options:

  • track

    ExMoQ.Native.track()

    Required
    Track name for this pad's stream, this will be the track name advertised by the hang/MSF catalog. See Track at https://doc.moq.dev/concept/layer/moq-lite.html#terminology.

  • priority

    0..255 | nil

    Default value: nil
    Delivery priority of this pad's track. Under congestion, tracks with a higher value are sent first. When nil, hang defaults for the track's media kind are used.

Summary

Types

Options for pad :input

t()

Struct containing options for Membrane.MoQ.Sink

Functions

Returns description of options available for this module

Types

input_pad_opts()

@type input_pad_opts() :: [track: ExMoQ.Native.track(), priority: 0..255 | nil]

Options for pad :input

t()

@type t() :: %Membrane.MoQ.Sink{
  broadcast: String.t(),
  container: :legacy | :loc,
  disable_tls_verify?: boolean(),
  latency: Membrane.Time.t(),
  url: String.t()
}

Struct containing options for Membrane.MoQ.Sink

Functions

options()

@spec options() :: keyword()

Returns description of options available for this module