Struct EncoderConfig

struct EncoderConfig { ... }

Encoder settings which impact the produced bitstream.

Fields

width: usize

Width of the frames in pixels.

height: usize

Height of the frames in pixels.

sample_aspect_ratio: crate::api::Rational

Sample aspect ratio (for anamorphic video).

time_base: crate::api::Rational

Video time base.

bit_depth: usize

Bit depth.

chroma_sampling: ChromaSampling

Chroma subsampling.

chroma_sample_position: ChromaSamplePosition

Chroma sample position.

pixel_range: PixelRange

Pixel 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: bool

Enable signaling timing info in the bitstream.

still_picture: bool

Still picture mode flag.

error_resilient: bool

Flag to force all frames to be error resilient.

switch_frame_interval: u64

Interval between switch frames (0 to disable)

min_key_frame_interval: u64

The minimum interval between two keyframes

max_key_frame_interval: u64

The maximum interval between two keyframes

reservoir_frame_delay: Option<i32>

The number of temporal units over which to distribute the reservoir usage.

low_latency: bool

Flag to enable low latency mode.

In this mode the frame reordering is disabled.

quantizer: usize

The base quantizer to use.

min_quantizer: u8

The minimum allowed base quantizer to use in bitrate mode.

bitrate: i32

The target bitrate for the bitrate mode.

tune: crate::encoder::Tune

Metric to tune the quality for.

film_grain_params: Option<Vec<crate::api::config::GrainTableSegment>>

Parameters for grain synthesis.

tile_cols: usize

Number of tiles horizontally. Must be a power of two.

Overridden by tiles, if present.

tile_rows: usize

Number of tiles vertically. Must be a power of two.

Overridden by tiles, if present.

tiles: usize

Total 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: crate::api::SpeedSettings

Settings which affect the encoding speed vs. quality trade-off.

Implementations

impl EncoderConfig

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.

fn set_key_frame_interval(self: &mut Self, min_interval: u64, max_interval: u64)

Sets the minimum and maximum keyframe interval, handling special cases as needed.

fn frame_rate(self: &Self) -> f64

Returns the video frame rate computed from time_base.

fn render_size(self: &Self) -> (usize, usize)

Computes the render width and height of the stream based on width, height, and sample_aspect_ratio.

const fn temporal_rdo(self: &Self) -> bool

Is temporal RDO enabled ?

fn is_hdr(self: &Self) -> bool

Describes whether the output is targeted as HDR

impl Clone for EncoderConfig

fn clone(self: &Self) -> EncoderConfig

impl Debug for EncoderConfig

fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result

impl Default for EncoderConfig

fn default() -> Self

impl Display for EncoderConfig

fn fmt(self: &Self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error>

impl Freeze for EncoderConfig

impl RefUnwindSafe for EncoderConfig

impl Send for EncoderConfig

impl Sync for EncoderConfig

impl Unpin for EncoderConfig

impl UnwindSafe for EncoderConfig

impl<T> Any for EncoderConfig

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for EncoderConfig

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for EncoderConfig

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for EncoderConfig

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for EncoderConfig

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for EncoderConfig

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> ToString for EncoderConfig

fn to_string(self: &Self) -> String

impl<T, U> Into for EncoderConfig

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for EncoderConfig

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for EncoderConfig

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>