pub struct EncoderConfig { /* private fields */ }Expand description
Configuration for the Encoder.
Setting missing? Please file a PR!
Implementations§
Source§impl EncoderConfig
impl EncoderConfig
Sourcepub const fn bitrate(self, bps: BitRate) -> Self
pub const fn bitrate(self, bps: BitRate) -> Self
Sets the requested bit rate in bits per second.
Sourcepub const fn debug(self, value: bool) -> Self
pub const fn debug(self, value: bool) -> Self
Enables detailed console logging inside OpenH264.
Sourcepub const fn skip_frames(self, value: bool) -> Self
pub const fn skip_frames(self, value: bool) -> Self
Set whether frames can be skipped to meet desired rate control target.
Sourcepub const fn max_frame_rate(self, value: FrameRate) -> Self
pub const fn max_frame_rate(self, value: FrameRate) -> Self
Sets the requested maximum frame rate in Hz.
Sourcepub const fn usage_type(self, value: UsageType) -> Self
pub const fn usage_type(self, value: UsageType) -> Self
Sets the usage type (e.g, screen vs. camera recording).
Sourcepub const fn rate_control_mode(self, value: RateControlMode) -> Self
pub const fn rate_control_mode(self, value: RateControlMode) -> Self
Sets the requested rate control mode.
Sourcepub const fn sps_pps_strategy(self, value: SpsPpsStrategy) -> Self
pub const fn sps_pps_strategy(self, value: SpsPpsStrategy) -> Self
Set the SPS/PPS behavior.
Sourcepub const fn max_slice_len(self, max_slice_len: u32) -> Self
pub const fn max_slice_len(self, max_slice_len: u32) -> Self
Set the maximum slice length
Sourcepub const fn complexity(self, complexity: Complexity) -> Self
pub const fn complexity(self, complexity: Complexity) -> Self
Set the complexity
Sourcepub const fn scene_change_detect(self, value: bool) -> Self
pub const fn scene_change_detect(self, value: bool) -> Self
Set scene change detect (on by default)
Sourcepub const fn adaptive_quantization(self, value: bool) -> Self
pub const fn adaptive_quantization(self, value: bool) -> Self
Set adaptive quantization control (on by default)
Sourcepub const fn background_detection(self, value: bool) -> Self
pub const fn background_detection(self, value: bool) -> Self
Set background detection (on by default)
Sourcepub const fn long_term_reference(self, value: bool) -> Self
pub const fn long_term_reference(self, value: bool) -> Self
Set use of long term reference (off by default)
Sourcepub const fn intra_frame_period(self, value: IntraFramePeriod) -> Self
pub const fn intra_frame_period(self, value: IntraFramePeriod) -> Self
Set the interval of intra frames (0 by default, disabling periodic intra frames)
Sourcepub const fn num_threads(self, threads: u16) -> Self
pub const fn num_threads(self, threads: u16) -> Self
Sets the number of internal encoder threads.
- 0 - auto mode
- 1 - single threaded operation
- >1 - fixed number of threads
Defaults to 0 (auto mode).
Sourcepub const fn vui(self, config: VuiConfig) -> Self
pub const fn vui(self, config: VuiConfig) -> Self
Sets the VUI (Video Usability Information) parameters.
VUI parameters are written into the H.264 SPS NAL unit and tell decoders how to interpret the color space of the video data. This is essential for correct color reproduction.
§Example
use openh264::encoder::{EncoderConfig, VuiConfig};
let config = EncoderConfig::new()
.vui(VuiConfig::bt709()); // HD content with BT.709 color spaceSee VuiConfig for common presets like bt709(), srgb(), and bt601().
Trait Implementations§
Source§impl Clone for EncoderConfig
impl Clone for EncoderConfig
Source§fn clone(&self) -> EncoderConfig
fn clone(&self) -> EncoderConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more