pub struct Setup { /* private fields */ }Expand description
Builds a new encoder.
Implementations§
Source§impl Setup
impl Setup
Sourcepub fn preset(
preset: Preset,
tune: Tune,
fast_decode: bool,
zero_latency: bool,
) -> Self
pub fn preset( preset: Preset, tune: Tune, fast_decode: bool, zero_latency: bool, ) -> Self
Creates a new builder with the specified preset and tune.
Sourcepub fn fastfirstpass(self) -> Self
pub fn fastfirstpass(self) -> Self
Makes the first pass faster.
Sourcepub fn fps(self, num: u32, den: u32) -> Self
pub fn fps(self, num: u32, den: u32) -> Self
The video’s framerate, represented as a rational number.
The value is in frames per second.
Sourcepub fn timebase(self, num: u32, den: u32) -> Self
pub fn timebase(self, num: u32, den: u32) -> Self
The encoder’s timebase, used in rate control with timestamps.
The value is in seconds per tick.
Sourcepub fn annexb(self, annexb: bool) -> Self
pub fn annexb(self, annexb: bool) -> Self
Enabel/disable Annex B start codes.
More information at https://github.com/quadrupleslap/x264/issues/4.
This defaults to true, but should be disabled for MP4 files.
Sourcepub fn bitrate(self, bitrate: i32) -> Self
pub fn bitrate(self, bitrate: i32) -> Self
Approximately restricts the bitrate.
The value is in metric kilobits per second.
Sourcepub fn baseline(self) -> Self
pub fn baseline(self) -> Self
The lowest profile, with guaranteed compatibility with all decoders.
Sourcepub fn max_keyframe_interval(self, interval: i32) -> Self
pub fn max_keyframe_interval(self, interval: i32) -> Self
Set the maximum number of frames between keyframes.
Sourcepub fn min_keyframe_interval(self, interval: i32) -> Self
pub fn min_keyframe_interval(self, interval: i32) -> Self
Set the minimum number of frames between keyframes.
Sourcepub fn scenecut_threshold(self, threshold: i32) -> Self
pub fn scenecut_threshold(self, threshold: i32) -> Self
Set the scenecut threshold. Set this to zero to guarantee a keyframe
every max_keyframe_interval.