#[non_exhaustive]pub struct Options {
pub bitrate: Option<u64>,
pub codec: Codec,
pub kind: Kind,
pub bandwidth: Option<Consumer>,
}Expand description
Source-agnostic encode knobs for publish_capture, where the geometry
(width / height / framerate) comes from the capture source, not the caller.
For the bring-your-own-frames Encoder path, where you
must specify geometry, use Config instead.
#[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.bitrate: Option<u64>Target bitrate in bits per second; None derives from resolution.
This is a ceiling, not a fixed rate: with bandwidth
set, the encoder backs off below it while the uplink is congested and
climbs back afterwards, but never exceeds it.
codec: CodecOutput codec. Defaults to Codec::H264.
kind: KindEncoder implementation preference.
bandwidth: Option<Consumer>The connection’s send-bandwidth estimate, from
Session::send_bandwidth (or
moq_native::Reconnect::send_bandwidth, which survives reconnects).
Set it and the encoder tracks the estimate per the default
rate::Policy, so a closing uplink gets a softer
picture instead of a stalled one. Leave it None and the
encoder holds bitrate regardless of congestion, which
is what you want when the estimate isn’t meaningful (a local file, a test
harness) or unavailable (a publisher that only accepts inbound sessions).