pub struct AvifEncoder { /* private fields */ }Expand description
Frame-to-AVIF encoder: every video frame becomes one complete AVIF file packet. See the module docs for the input-format mapping and the option surface.
Implementations§
Source§impl AvifEncoder
impl AvifEncoder
Sourcepub fn new(codec_id: CodecId) -> Self
pub fn new(codec_id: CodecId) -> Self
Build an encoder announcing codec_id in its output parameters.
Sourcepub fn with_params(params: CodecParameters) -> Self
pub fn with_params(params: CodecParameters) -> Self
Build an encoder from an explicit parameter set, reading the
options leniently: unknown keys and malformed values are
ignored (the historical behaviour of this constructor).
Self::try_with_params — what make_encoder and the
registry use — refuses them instead. Option parsing happens
here (construction time), never on the frame path.
Sourcepub fn try_with_params(params: CodecParameters) -> Result<Self>
pub fn try_with_params(params: CodecParameters) -> Result<Self>
Build an encoder from a parameter set whose options are parsed
strictly against AvifEncoderOptions’s schema: an unknown
key, a malformed value or one outside its range is
InvalidData.
Sourcepub fn from_options(params: CodecParameters, opts: AvifEncoderOptions) -> Self
pub fn from_options(params: CodecParameters, opts: AvifEncoderOptions) -> Self
Build an encoder from a parameter set and already-parsed
options (the option bag on params is not read again).
Sourcepub fn encode_options(&self) -> EncodeOptions
pub fn encode_options(&self) -> EncodeOptions
The still-encoder tuning this encoder codes with (q,
alpha_q, the quality mapping, chroma, premultiplied,
speed, and the worker threads the next frame runs on: the
explicit threads option, else the execution context’s budget).
Trait Implementations§
Source§impl Encoder for AvifEncoder
impl Encoder for AvifEncoder
Source§fn set_execution_context(&mut self, ctx: &ExecutionContext)
fn set_execution_context(&mut self, ctx: &ExecutionContext)
The worker budget for the AV1 tile search of every coded item;
an explicit threads option wins over it. The bytes never
depend on the budget (the tile layout follows the picture size).
Source§fn output_params(&self) -> &CodecParameters
fn output_params(&self) -> &CodecParameters
Source§fn send_frame(&mut self, frame: &Frame) -> Result<()>
fn send_frame(&mut self, frame: &Frame) -> Result<()>
receive_packet in a loop afterwards.Source§fn receive_packet(&mut self) -> Result<Packet>
fn receive_packet(&mut self) -> Result<Packet>
Error::NeedMore
when the encoder needs another frame (or a flush).