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
urlString.t()Required
URL to the MoQ relay server.broadcastString.t()Required
Broadcast path, seeBroadcastat https://doc.moq.dev/concept/layer/moq-lite.html#terminologycontainer:legacy | :locDefault value:
:legacy
Wire container for media frames, applied to every track of this sink and advertised per rendition in the catalog.latencyMembrane.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 of0, 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:
trackExMoQ.Native.track()Required
Track name for this pad's stream, this will be the track name advertised by the hang/MSF catalog. SeeTrackat https://doc.moq.dev/concept/layer/moq-lite.html#terminology.priority0..255 | nilDefault 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
@type input_pad_opts() :: [track: ExMoQ.Native.track(), priority: 0..255 | nil]
Options for pad :input
@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
@spec options() :: keyword()
Returns description of options available for this module