#[non_exhaustive]pub struct EncoderConfig {
pub width: u32,
pub height: u32,
pub fps: u32,
pub bitrate_bps: u32,
pub max_bitrate_bps: u32,
pub keyframe_interval: Option<u32>,
pub temporal_layers: TemporalLayers,
}Expand description
Encoder settings.
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: u32Coded width in pixels (1 to 16383).
height: u32Coded height in pixels (1 to 16383).
fps: u32The frame rate the input arrives at (for rate control).
bitrate_bps: u32Target bitrate in bits per second.
Easy content can come in under it: rate control never goes below quantizer index 4, its best quality, so a mostly flat or static picture (a test pattern, an idle slide) uses fewer bits than a high target allows. Camera content lands on the target.
max_bitrate_bps: u32Ceiling the encoder skips frames to stay under, in bits per second.
Raised to bitrate_bps if lower.
keyframe_interval: Option<u32>A keyframe every this many frames; None, only on request.
temporal_layers: TemporalLayersTemporal layering.
Implementations§
Source§impl EncoderConfig
impl EncoderConfig
Sourcepub fn new(width: u32, height: u32, fps: u32, bitrate_bps: u32) -> Self
pub fn new(width: u32, height: u32, fps: u32, bitrate_bps: u32) -> Self
Settings for width x height at fps and bitrate_bps, with a
1.5x ceiling, keyframes on request only and no temporal layers.
Sourcepub fn with_temporal_layers(self, layers: TemporalLayers) -> Self
pub fn with_temporal_layers(self, layers: TemporalLayers) -> Self
The same settings with temporal layering.
Sourcepub fn with_keyframe_interval(self, frames: Option<u32>) -> Self
pub fn with_keyframe_interval(self, frames: Option<u32>) -> Self
The same settings with a keyframe interval.