[−][src]Trait ac_ffmpeg::codec::Encoder
A media encoder.
Common encoder operation
- Push a frame to the encoder.
- Take all packets from the encoder until you get None.
- If there are more frames to be encoded, continue with 1.
- Flush the encoder.
- Take all packets from the encoder until you get None.
Associated Types
type CodecParameters
type Frame
Required methods
fn codec_parameters(&self) -> Self::CodecParameters
Get codec parameters.
fn try_push(&mut self, frame: Self::Frame) -> Result<(), CodecError>
Push a given frame to the encoder.
fn try_flush(&mut self) -> Result<(), CodecError>
Flush the encoder.
fn take(&mut self) -> Result<Option<Packet>, Error>
Take the next packet from the encoder.
Provided methods
fn push(&mut self, frame: Self::Frame) -> Result<(), Error>
Push a given frame to the encoder.
Panics
The method panics if the operation is not expected (i.e. another operation needs to be done).
fn flush(&mut self) -> Result<(), Error>
Flush the encoder.
Panics
The method panics if the operation is not expected (i.e. another operation needs to be done).