pub struct EncoderConfig {Show 29 fields
    pub width: usize,
    pub height: usize,
    pub sample_aspect_ratio: Rational,
    pub time_base: Rational,
    pub bit_depth: usize,
    pub chroma_sampling: ChromaSampling,
    pub chroma_sample_position: ChromaSamplePosition,
    pub pixel_range: PixelRange,
    pub color_description: Option<ColorDescription>,
    pub mastering_display: Option<MasteringDisplay>,
    pub content_light: Option<ContentLight>,
    pub level_idx: Option<u8>,
    pub enable_timing_info: bool,
    pub still_picture: bool,
    pub error_resilient: bool,
    pub switch_frame_interval: u64,
    pub min_key_frame_interval: u64,
    pub max_key_frame_interval: u64,
    pub reservoir_frame_delay: Option<i32>,
    pub low_latency: bool,
    pub quantizer: usize,
    pub min_quantizer: u8,
    pub bitrate: i32,
    pub tune: Tune,
    pub film_grain_params: Option<Vec<GrainTableSegment>>,
    pub tile_cols: usize,
    pub tile_rows: usize,
    pub tiles: usize,
    pub speed_settings: SpeedSettings,
}Expand description
Encoder settings which impact the produced bitstream.
Fields§
§width: usizeWidth of the frames in pixels.
height: usizeHeight of the frames in pixels.
sample_aspect_ratio: RationalSample aspect ratio (for anamorphic video).
time_base: RationalVideo time base.
bit_depth: usizeBit depth.
chroma_sampling: ChromaSamplingChroma subsampling.
chroma_sample_position: ChromaSamplePositionChroma sample position.
pixel_range: PixelRangePixel value range.
color_description: Option<ColorDescription>Content color description (primaries, transfer characteristics, matrix).
mastering_display: Option<MasteringDisplay>HDR mastering display parameters.
content_light: Option<ContentLight>HDR content light parameters.
level_idx: Option<u8>AV1 level index to target (0-31). If None, allow the encoder to decide. Currently, rav1e is unable to guarantee that the output bitstream meets the rate limitations of the specified level.
enable_timing_info: boolEnable signaling timing info in the bitstream.
still_picture: boolStill picture mode flag.
error_resilient: boolFlag to force all frames to be error resilient.
switch_frame_interval: u64Interval between switch frames (0 to disable)
min_key_frame_interval: u64The minimum interval between two keyframes
max_key_frame_interval: u64The maximum interval between two keyframes
reservoir_frame_delay: Option<i32>The number of temporal units over which to distribute the reservoir usage.
low_latency: boolFlag to enable low latency mode.
In this mode the frame reordering is disabled.
quantizer: usizeThe base quantizer to use.
min_quantizer: u8The minimum allowed base quantizer to use in bitrate mode.
bitrate: i32The target bitrate for the bitrate mode.
tune: TuneMetric to tune the quality for.
film_grain_params: Option<Vec<GrainTableSegment>>Parameters for grain synthesis.
tile_cols: usizeNumber of tiles horizontally. Must be a power of two.
Overridden by tiles, if present.
tile_rows: usizeNumber of tiles vertically. Must be a power of two.
Overridden by tiles, if present.
tiles: usizeTotal number of tiles desired.
Encoder will try to optimally split to reach this number of tiles,
rounded up. Overrides tile_cols and tile_rows.
speed_settings: SpeedSettingsSettings which affect the encoding speed vs. quality trade-off.
Implementations§
Source§impl EncoderConfig
 
impl EncoderConfig
Sourcepub fn with_speed_preset(speed: u8) -> Self
 
pub fn with_speed_preset(speed: u8) -> Self
This is a preset which provides default settings according to a speed
value in the specific range 0–10. Each speed value corresponds to a
different preset. See from_preset(). If the input value is greater
than 10, it will result in the same settings as 10.
Sourcepub fn set_key_frame_interval(&mut self, min_interval: u64, max_interval: u64)
 
pub fn set_key_frame_interval(&mut self, min_interval: u64, max_interval: u64)
Sets the minimum and maximum keyframe interval, handling special cases as needed.
Sourcepub fn frame_rate(&self) -> f64
 
pub fn frame_rate(&self) -> f64
Returns the video frame rate computed from time_base.
Sourcepub fn render_size(&self) -> (usize, usize)
 
pub fn render_size(&self) -> (usize, usize)
Computes the render width and height of the stream based
on width, height, and sample_aspect_ratio.
Sourcepub const fn temporal_rdo(&self) -> bool
 
pub const fn temporal_rdo(&self) -> bool
Is temporal RDO enabled ?
pub(crate) fn get_film_grain_at( &self, timestamp: u64, ) -> Option<&GrainTableSegment>
pub(crate) fn get_film_grain_mut_at( &mut self, timestamp: u64, ) -> Option<&mut GrainTableSegment>
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 moreSource§impl Debug for EncoderConfig
 
impl Debug for EncoderConfig
Source§impl Default for EncoderConfig
Default preset for EncoderConfig: it is a balance between quality and
speed. See with_speed_preset().
 
impl Default for EncoderConfig
Default preset for EncoderConfig: it is a balance between quality and
speed. See with_speed_preset().
Auto Trait Implementations§
impl Freeze for EncoderConfig
impl RefUnwindSafe for EncoderConfig
impl Send for EncoderConfig
impl Sync for EncoderConfig
impl Unpin for EncoderConfig
impl UnwindSafe for EncoderConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more