Membrane Source acting as a MoQ subscriber.
Connects to a MoQ relay server and subscribes to tracks of a single broadcast over one shared QUIC connection. An output pad corresponds to one MoQ track.
Parent notifications
Membrane.MoQ.Source watches the broadcast catalog and notifies its parent about track changes:
{:new_track, {track :: ExMoQ.Native.track(), stream_format :: struct()}}when a track is advertised.trackis the catalog rendition key to pass as the:trackoption of an output pad;stream_formatis the format the pad will start with.{:track_removed, track :: ExMoQ.Native.track()}when an advertised track disappears from the catalog (e.g. the publisher ended it).- A track whose codec parameters change mid-broadcast is reported as a
:track_removed, followed by a:new_track, so a stale pad can be torn down and re-wired against the new format. {:subscription_died, {track :: ExMoQ.Native.track(), reason :: String.t()}}when the native subscription feeding a pad fails while the track may still be advertised in the catalog. The source sends:end_of_streamto that pad; re-linking a pad for the track starts a fresh subscription.{:disconnected, reason :: String.t() | ExMoQ.Native.close_reason()}when the broadcast goes away or the session drops. The source sends:end_of_streamto all active pads.
Element options
Passed via struct Membrane.MoQ.Source.t/0
urlString.t()Required
URL of the MoQ relay to connect to, e.g."https://localhost:4443".broadcastString.t()Required
Broadcast path to subscribe to, seeBroadcastat https://doc.moq.dev/concept/layer/moq-lite.html#terminology. A.msfsuffix pulls track info from the MSF catalog, and the default fallback is hang.disable_tls_verify?boolean()Default value:
false
Iftrue, the QUIC client skips TLS certificate verification. Useful for self-signed local relays only.latencyMembrane.Time.t()Default value:
1000000000
How long each track buffers received frames before emitting them, trading end-to-end delay for resilience to network jitter and reordering.
Pads
:output
Accepted formats:
Membrane.AACMembrane.OpusMembrane.H264Membrane.H265%Membrane.RemoteStream{type: :packetized}| Direction: | :output |
| Availability: | :on_request |
| Flow control: | :push |
Pad options:
trackExMoQ.Native.track()Required
Catalog rendition key within the broadcast to subscribe to on this pad, seeTrackat https://doc.moq.dev/concept/layer/moq-lite.html#terminologypriority0..255 | nilDefault value:
nil
Delivery priority of this subscription. 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 output_pad_opts() :: [track: ExMoQ.Native.track(), priority: 0..255 | nil]
Options for pad :output
@type t() :: %Membrane.MoQ.Source{ broadcast: String.t(), disable_tls_verify?: boolean(), latency: Membrane.Time.t(), url: String.t() }
Struct containing options for Membrane.MoQ.Source
Functions
@spec options() :: keyword()
Returns description of options available for this module