[][src]Struct hl_capture::encode::Encoder

pub struct Encoder {
    converter: PixFmtConverter,
    resampler: Context,
    context: Output,
    video_encoder: Video,
    audio_encoder: Audio,
    video_stream_index: usize,
    audio_stream_index: usize,
    audio_output_frame: Audio,
    audio_input_frame: Audio,
    packet: Packet,
    finished: bool,
    time_base: Rational,
    video_stream_time_base: Rational,
    audio_stream_time_base: Rational,
    video_pts: i64,
    audio_pts: i64,
    audio_position: usize,
}

An encoder used to encode video and audio to a file.

Call Encoder::start() to start the encoding, then encode some frames with Encoder::encode(). The encoder will flush and save the output file automatically upon being dropped.

Fields

converter: PixFmtConverterresampler: Contextcontext: Outputvideo_encoder: Videoaudio_encoder: Audiovideo_stream_index: usizeaudio_stream_index: usizeaudio_output_frame: Audioaudio_input_frame: Audiopacket: Packetfinished: booltime_base: Rationalvideo_stream_time_base: Rationalaudio_stream_time_base: Rationalvideo_pts: i64audio_pts: i64audio_position: usize

Current position, in samples, in the audio frame.

Methods

impl Encoder[src]

pub fn start(parameters: &EncoderParameters) -> Result<Self, Error>[src]

fn push_frame(
    &mut self,
    frame: Option<&mut Video>,
    times: usize
) -> Result<(), Error>
[src]

fn push_audio_frame(&mut self) -> Result<(), Error>[src]

pub fn take(&mut self, frame: &mut Video, times: usize) -> Result<(), Error>[src]

Takes the given frame the specified number of times.

pub fn take_audio(&mut self, samples: &[(i16, i16)]) -> Result<(), Error>[src]

Encodes 16-bit signed interleaved 2-channel stereo sound.

fn flush(&mut self) -> Result<(), Error>[src]

pub fn finish(&mut self) -> Result<(), Error>[src]

pub fn width(&self) -> u32[src]

pub fn height(&self) -> u32[src]

pub fn format(&self) -> Pixel[src]

Trait Implementations

impl Drop for Encoder[src]

Auto Trait Implementations

impl Unpin for Encoder

impl !Sync for Encoder

impl !Send for Encoder

impl !RefUnwindSafe for Encoder

impl !UnwindSafe for Encoder

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]