Skip to main content

InterEncoder

Struct InterEncoder 

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

H.264 with P-frames. See the module docs.

Implementations§

Source§

impl InterEncoder

Source

pub fn new(width: u32, height: u32, qp: i32) -> Self

width × height at quantizer qp (lower is better and bigger; 18–40 is the useful range).

Source

pub fn keyframe_interval(self, n: u32) -> Self

A keyframe at least every n pictures (default 50: two seconds at 25 fps). Seeking lands on keyframes, so shorter is faster to seek and bigger. 1 is all keyframes.

Source

pub fn entropy(self, mode: EntropyMode) -> Self

The P slices’ entropy coder: CABAC (the default; Main profile, as the keyframes already are) or CAVLC, about 10–15 % larger.

Source

pub fn scene_cut_threshold(self, mad: f64) -> Self

Mean absolute difference per luma sample, after motion search, above which a picture is taken to be a cut and coded as a keyframe (default 28). A jump to three times the previous picture’s (and over 12) is a cut too. f64::INFINITY turns the absolute test off.

Source

pub fn search_range(self, samples: i32) -> Self

Motion search range in luma samples, each way (default 48).

Source

pub fn threads(self, n: usize) -> Self

Threads for motion search (default: the machine’s cores, up to 16).

Source

pub fn force_keyframe(&mut self)

Make the next picture a keyframe.

Source

pub fn config(&self) -> &H264Config

The configuration the parameter sets describe.

Source

pub fn sps(&self) -> &[u8] ⓘ

The sequence parameter set NAL unit: header included, no start code.

Source

pub fn pps(&self) -> [&[u8]; 2]

Both picture parameter sets: the intra one (id 0), the inter one (id 1).

Source

pub fn avcc(&self) -> Vec<u8> ⓘ

The avcC decoder configuration, with the SPS and both PPSs.

Source

pub fn reconstruction(&self) -> Option<&Reconstruction>

The picture a decoder reconstructs from the last encode, at coded size.

Source

pub fn encode(&mut self, frame: &Yuv420Frame) -> EncodedPicture

Encode the next picture, in display order.

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.