Skip to main content

RcConfig

Struct RcConfig 

Source
pub struct RcConfig {
Show 20 fields pub mode: RateControlMode, pub target_bitrate: u64, pub max_bitrate: Option<u64>, pub min_bitrate: Option<u64>, pub min_qp: u8, pub max_qp: u8, pub initial_qp: u8, pub crf: f32, pub buffer_size: u64, pub initial_buffer_fullness: f32, pub framerate_num: u32, pub framerate_den: u32, pub gop_length: u32, pub enable_aq: bool, pub aq_strength: f32, pub lookahead_depth: usize, pub b_qp_offset: i8, pub i_qp_offset: i8, pub scene_cut_detection: bool, pub scene_cut_threshold: f32,
}
Expand description

Rate control configuration.

Fields§

§mode: RateControlMode

Rate control mode.

§target_bitrate: u64

Target bitrate in bits per second.

§max_bitrate: Option<u64>

Maximum bitrate in bits per second (for VBR).

§min_bitrate: Option<u64>

Minimum bitrate in bits per second (for VBR).

§min_qp: u8

Minimum QP value (higher quality limit).

§max_qp: u8

Maximum QP value (lower quality limit).

§initial_qp: u8

Initial QP for the first frame.

§crf: f32

CRF value for quality-based modes (0-63).

§buffer_size: u64

VBV/HRD buffer size in bits.

§initial_buffer_fullness: f32

Initial buffer fullness as a fraction (0.0-1.0).

§framerate_num: u32

Frame rate numerator.

§framerate_den: u32

Frame rate denominator.

§gop_length: u32

GOP (keyframe interval) length.

§enable_aq: bool

Enable adaptive quantization.

§aq_strength: f32

AQ strength (0.0-2.0).

§lookahead_depth: usize

Lookahead depth (number of frames).

§b_qp_offset: i8

B-frame QP offset from P-frame.

§i_qp_offset: i8

I-frame QP offset from P-frame (typically negative).

§scene_cut_detection: bool

Enable scene cut detection.

§scene_cut_threshold: f32

Scene cut threshold (0.0-1.0).

Implementations§

Source§

impl RcConfig

Source

pub fn cqp(qp: u8) -> Self

Create a CQP configuration.

Source

pub fn cbr(bitrate: u64) -> Self

Create a CBR configuration.

Source

pub fn vbr(target: u64, max: u64) -> Self

Create a VBR configuration.

Source

pub fn crf(crf_value: f32) -> Self

Create a CRF configuration.

Source

pub fn framerate(&self) -> f64

Get the frame rate as a floating point value.

Source

pub fn target_bits_per_frame(&self) -> u64

Get the target bits per frame.

Source

pub fn validate(&self) -> Result<(), RcConfigError>

Validate configuration parameters.

Trait Implementations§

Source§

impl Clone for RcConfig

Source§

fn clone(&self) -> RcConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RcConfig

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for RcConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.