pub struct EncoderConfig {
pub width: usize,
pub height: usize,
pub profile: Profile,
pub chroma: ChromaFormat,
pub level_idc: u8,
pub qp: u8,
pub gop_size: u32,
pub bitrate: u32,
pub framerate: f32,
pub num_ref_frames: u32,
pub preset: Preset,
}Expand description
Configuration for an crate::Encoder.
Fields§
§width: usizePicture width in luma samples. Arbitrary (not restricted to /16).
height: usizePicture height in luma samples.
profile: ProfileTarget profile. Only Profile::ConstrainedBaseline is implemented.
chroma: ChromaFormatChroma format. Only ChromaFormat::Yuv420 is implemented.
level_idc: u8level_idc (e.g. 30 = level 3.0). Caller is responsible for choosing a
level that admits the resolution/bitrate; not yet validated.
qp: u8Quantization parameter (0..=51). With rate control off this is the fixed
QP for every frame; with it on, the base/fallback QP and pic_init_qp.
gop_size: u32Frames between IDR pictures. 1 = all-intra (every frame an IDR).
bitrate: u32Target bitrate in bits per second. 0 disables rate control (constant
QP); any positive value enables average-bitrate control, which varies the
per-frame QP around qp to converge on this rate.
framerate: f32Frame rate (frames per second), used by rate control to turn the bitrate target into a per-frame bit budget.
num_ref_frames: u32Number of reference frames the encoder may use for P-pictures (1..=16).
1 keeps the single-reference bitstream; higher values let P-macroblocks
pick an older reference (ref_idx), helping occlusion/periodic motion.
preset: PresetSpeed/quality trade-off. Defaults to Preset::Fast.
Implementations§
Source§impl EncoderConfig
impl EncoderConfig
Trait Implementations§
Source§impl Clone for EncoderConfig
impl Clone for EncoderConfig
Source§fn clone(&self) -> EncoderConfig
fn clone(&self) -> EncoderConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more