pub struct InterEncoder { /* private fields */ }Expand description
H.264 with P-frames. See the module docs.
Implementations§
Source§impl InterEncoder
impl InterEncoder
Sourcepub fn new(width: u32, height: u32, qp: i32) -> Self
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).
Sourcepub fn keyframe_interval(self, n: u32) -> Self
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.
Sourcepub fn entropy(self, mode: EntropyMode) -> Self
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.
Sourcepub fn scene_cut_threshold(self, mad: f64) -> Self
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.
Sourcepub fn search_range(self, samples: i32) -> Self
pub fn search_range(self, samples: i32) -> Self
Motion search range in luma samples, each way (default 48).
Sourcepub fn threads(self, n: usize) -> Self
pub fn threads(self, n: usize) -> Self
Threads for motion search (default: the machine’s cores, up to 16).
Sourcepub fn force_keyframe(&mut self)
pub fn force_keyframe(&mut self)
Make the next picture a keyframe.
Sourcepub fn config(&self) -> &H264Config
pub fn config(&self) -> &H264Config
The configuration the parameter sets describe.
Sourcepub fn sps(&self) -> &[u8] ⓘ
pub fn sps(&self) -> &[u8] ⓘ
The sequence parameter set NAL unit: header included, no start code.
Sourcepub fn pps(&self) -> [&[u8]; 2]
pub fn pps(&self) -> [&[u8]; 2]
Both picture parameter sets: the intra one (id 0), the inter one (id 1).
Sourcepub fn reconstruction(&self) -> Option<&Reconstruction>
pub fn reconstruction(&self) -> Option<&Reconstruction>
The picture a decoder reconstructs from the last encode,
at coded size.
Sourcepub fn encode(&mut self, frame: &Yuv420Frame) -> EncodedPicture
pub fn encode(&mut self, frame: &Yuv420Frame) -> EncodedPicture
Encode the next picture, in display order.
Auto Trait Implementations§
impl Forget for InterEncoder
impl Freeze for InterEncoder
impl Move for InterEncoder
impl RefUnwindSafe for InterEncoder
impl Send for InterEncoder
impl Sync for InterEncoder
impl Unpin for InterEncoder
impl UnsafeUnpin for InterEncoder
impl UnwindSafe for InterEncoder
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> 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