#[non_exhaustive]pub struct Config {
pub width: u32,
pub height: u32,
pub framerate: u32,
pub bitrate: Option<u64>,
pub gop: u32,
pub codec: Codec,
pub kind: Kind,
pub color: Option<Color>,
}Expand description
Encoder configuration. width / height / framerate are the encoded
output; input frames must already be at this resolution.
#[non_exhaustive]: build via Config::new and set the optional fields,
so future knobs don’t break 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.width: u32§height: u32§framerate: u32§bitrate: Option<u64>Target bitrate in bits per second. None derives a sane default
from resolution and framerate (~0.07 bits per pixel per second).
gop: u32Keyframe interval in frames. Subscribers joining mid-stream wait at most this many frames before they can start decoding.
codec: CodecOutput codec. Defaults to Codec::H264.
kind: Kind§color: Option<Color>The color space of the input frames, written into the bitstream’s VUI so a
decoder doesn’t have to guess. None uses Color::infer, which is both
what the crate’s own RGB conversions produce and what a player falls back
to, so leaving it unset keeps the pixels and the label in agreement.
Set it only when feeding frames the crate did not convert and whose space you know from elsewhere.