pub struct Encoder { /* private fields */ }
Expand description
Encodes video.
Implementations§
source§impl Encoder
impl Encoder
sourcepub fn builder() -> Setup
pub fn builder() -> Setup
Creates a new builder with default options.
For more options see Setup::new
.
sourcepub fn encode(
&mut self,
pts: i64,
image: Image<'_>
) -> Result<(Data<'_>, Picture)>
pub fn encode(
&mut self,
pts: i64,
image: Image<'_>
) -> Result<(Data<'_>, Picture)>
Feeds a frame to the encoder.
Panics
Panics if there is a mismatch between the image and the encoder regarding width, height or colorspace.
sourcepub unsafe fn encode_unchecked(
&mut self,
pts: i64,
image: Image<'_>
) -> Result<(Data<'_>, Picture)>
pub unsafe fn encode_unchecked(
&mut self,
pts: i64,
image: Image<'_>
) -> Result<(Data<'_>, Picture)>
Feeds a frame to the encoder.
Unsafety
The caller must ensure that the width, height and colorspace of the image are the same as that of the encoder.
sourcepub fn headers(&mut self) -> Result<Data<'_>>
pub fn headers(&mut self) -> Result<Data<'_>>
Gets the video headers, which should be sent first.