#[non_exhaustive]pub struct Options {
pub track: Option<String>,
pub config: Config,
pub bandwidth: Allocator,
pub join: Duration,
}Expand description
Encode and publication policy for Producer.
#[non_exhaustive]: construct via Options::default and set fields, so
new knobs can be added without breaking callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.track: Option<String>Track name to publish under. None derives a unique one from the codec
(0.opus, then 1.opus, …), matching how the video side names its
track. Subscribers find it through the catalog either way.
config: ConfigCodec input and encoded output config.
bandwidth: AllocatorThe connection’s bandwidth, as an allocator over
Session::send_bandwidth.
The audio track reserves its bitrate against it, so the video encoder sharing the connection sizes itself against what’s actually left rather than against the whole uplink. Pass the same allocator to both.
Defaults to Allocator::unlimited,
which reserves nothing and leaves every sender at its configured rate.
Audio reserves but does not follow its share: Opus can retune live and PCM
can’t at all, and at hang’s priorities audio outranks video, so it is only
ever squeezed on a link that can’t carry audio alone.
join: DurationThe time between join points: the minimum audio carried by each group. The packet that reaches it closes the group, and the next packet opens a new one, so a positive join shorter than a packet puts every packet in its own group.
Defaults to [moq_mux::container::Join::DEFAULT] (100 ms); Producer::new refuses zero.
Each group costs the relay a stream and its bookkeeping, so raising this trades per-group
overhead for coarser loss: a viewer that falls behind skips a whole group, and a lost packet
stalls the rest of its group until retransmitted. Packets still forward as
they are encoded rather than buffered until the group fills. A longer
Config::frame_duration (up to 60 ms for Opus) also packs more audio
per group, at the cost of encoder latency. An unfinished group remains open
across a pause or Producer::reanchor until the next write; use
Producer::discontinuity to close it when capture stops.