pub struct Ffv1Encoder { /* private fields */ }Expand description
FFV1 encoder.
Implements the VideoEncoder trait for encoding raw video frames
into FFV1 lossless bitstreams.
§Usage
ⓘ
use oximedia_codec::ffv1::Ffv1Encoder;
use oximedia_codec::traits::EncoderConfig;
let config = EncoderConfig::default();
let mut encoder = Ffv1Encoder::new(config)?;
encoder.send_frame(&frame)?;
if let Some(packet) = encoder.receive_packet()? {
// Write packet to container
}Implementations§
Source§impl Ffv1Encoder
impl Ffv1Encoder
Sourcepub fn new(config: EncoderConfig) -> CodecResult<Self>
pub fn new(config: EncoderConfig) -> CodecResult<Self>
Create a new FFV1 encoder with default FFV1 settings.
Sourcepub fn with_ffv1_config(
config: EncoderConfig,
ffv1: Ffv1Config,
) -> CodecResult<Self>
pub fn with_ffv1_config( config: EncoderConfig, ffv1: Ffv1Config, ) -> CodecResult<Self>
Create an FFV1 encoder with explicit FFV1 configuration.
Trait Implementations§
Source§impl VideoEncoder for Ffv1Encoder
impl VideoEncoder for Ffv1Encoder
Source§fn send_frame(&mut self, frame: &VideoFrame) -> CodecResult<()>
fn send_frame(&mut self, frame: &VideoFrame) -> CodecResult<()>
Send a raw frame to the encoder. Read more
Source§fn receive_packet(&mut self) -> CodecResult<Option<EncodedPacket>>
fn receive_packet(&mut self) -> CodecResult<Option<EncodedPacket>>
Receive an encoded packet. Read more
Source§fn config(&self) -> &EncoderConfig
fn config(&self) -> &EncoderConfig
Get encoder configuration.
Auto Trait Implementations§
impl Freeze for Ffv1Encoder
impl RefUnwindSafe for Ffv1Encoder
impl Send for Ffv1Encoder
impl Sync for Ffv1Encoder
impl Unpin for Ffv1Encoder
impl UnsafeUnpin for Ffv1Encoder
impl UnwindSafe for Ffv1Encoder
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