Skip to main content

Setup

Struct Setup 

Source
pub struct Setup { /* private fields */ }
Expand description

Builds a new encoder.

Implementations§

Source§

impl Setup

Source

pub fn preset( preset: Preset, tune: Tune, fast_decode: bool, zero_latency: bool, ) -> Self

Creates a new builder with the specified preset and tune.

Source

pub fn fastfirstpass(self) -> Self

Makes the first pass faster.

Source

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.

Source

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.

Source

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.

Source

pub fn bitrate(self, bitrate: i32) -> Self

Approximately restricts the bitrate.

The value is in metric kilobits per second.

Source

pub fn baseline(self) -> Self

The lowest profile, with guaranteed compatibility with all decoders.

Source

pub fn main(self) -> Self

A useless middleground between the baseline and high profiles.

Source

pub fn high(self) -> Self

The highest profile, which almost all encoders support.

Source

pub fn max_keyframe_interval(self, interval: i32) -> Self

Set the maximum number of frames between keyframes.

Source

pub fn min_keyframe_interval(self, interval: i32) -> Self

Set the minimum number of frames between keyframes.

Source

pub fn scenecut_threshold(self, threshold: i32) -> Self

Set the scenecut threshold. Set this to zero to guarantee a keyframe every max_keyframe_interval.

Source

pub fn build<C>(self, csp: C, width: i32, height: i32) -> Result<Encoder>
where C: Into<Encoding>,

Build the encoder.

Trait Implementations§

Source§

impl Default for Setup

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for Setup

§

impl RefUnwindSafe for Setup

§

impl !Send for Setup

§

impl !Sync for Setup

§

impl Unpin for Setup

§

impl UnsafeUnpin for Setup

§

impl UnwindSafe for Setup

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> 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, 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.