pub struct Mp4Encoder { /* private fields */ }Expand description
An HEVC-in-MP4 encoder on whichever EncodeBackend suits the platform.
Push RGBA frames, then finish for the file’s bytes. The
output is a standard hvc1 MP4 either way; what differs is speed and that
the native encoder is all-intra, so its files are larger at the same
quality.
Implementations§
Source§impl Mp4Encoder
impl Mp4Encoder
Sourcepub fn new(
width: u32,
height: u32,
options: EncodeOptions,
) -> Result<Self, String>
pub fn new( width: u32, height: u32, options: EncodeOptions, ) -> Result<Self, String>
The first hardware backend available that opens a session, or the native encoder when none does.
Sourcepub fn with_backend(
width: u32,
height: u32,
options: EncodeOptions,
backend: EncodeBackend,
) -> Result<Self, String>
pub fn with_backend( width: u32, height: u32, options: EncodeOptions, backend: EncodeBackend, ) -> Result<Self, String>
Exactly backend, failing if this build or this machine cannot.
Sourcepub fn backend(&self) -> EncodeBackend
pub fn backend(&self) -> EncodeBackend
The backend in use.
Auto Trait Implementations§
impl !RefUnwindSafe for Mp4Encoder
impl !Send for Mp4Encoder
impl !Sync for Mp4Encoder
impl Freeze for Mp4Encoder
impl Unpin for Mp4Encoder
impl UnsafeUnpin for Mp4Encoder
impl UnwindSafe for Mp4Encoder
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
Mutably borrows from an owned value. Read more
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> ⓘ
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 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> ⓘ
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