Skip to main content

VideoStream

Trait VideoStream 

Source
pub trait VideoStream: Send {
    // Required methods
    fn read_frame(&mut self) -> Result<CapturedFrame, VideoCaptureError>;
    fn fps(&self) -> Result<f64, VideoCaptureError>;
    fn seek_to_start(&mut self) -> Result<(), VideoCaptureError>;
}
Expand description

An open video stream producing frames on demand.

Required Methods§

Source

fn read_frame(&mut self) -> Result<CapturedFrame, VideoCaptureError>

Reads the next frame. Returns VideoCaptureError::EndOfStream when the stream is exhausted.

Source

fn fps(&self) -> Result<f64, VideoCaptureError>

Frames-per-second as reported by the backend.

Source

fn seek_to_start(&mut self) -> Result<(), VideoCaptureError>

Rewind the stream so the next Self::read_frame returns the first frame.

Implementors§