pub struct Video { /* private fields */ }Expand description
A playing video, through whichever back end can play it. AVFoundation is tried first; a file it refuses on opening, fails on later, or draws no picture of within 1.5 s is played by FFmpeg when present, keeping the player’s settings and place.
Main thread only (it is not Send). Dropping it stops playback.
Implementations§
Source§impl Video
impl Video
Sourcepub fn open(path: &Path) -> Result<Video>
pub fn open(path: &Path) -> Result<Video>
Opens a file for playback, paused at the start, with no sound when
FFmpeg plays it. Fails off the main thread, and for anything
probe refuses.
Sourcepub fn open_with(path: &Path, mixer: Option<&Mixer>) -> Result<Video>
pub fn open_with(path: &Path, mixer: Option<&Mixer>) -> Result<Video>
As Video::open; when FFmpeg plays the file its sound goes to
mixer (AVFoundation plays its own).
pub fn info(&self) -> &Info
Sourcepub fn error(&self) -> Option<String>
pub fn error(&self) -> Option<String>
Why the video can’t play, once every back end has given up. A system
failure FFmpeg may still recover from (on the next Video::tick)
is not reported.
pub fn pause(&mut self)
pub fn toggle(&mut self)
pub fn is_playing(&self) -> bool
Sourcepub fn step(&mut self, frames: i32)
pub fn step(&mut self, frames: i32)
Moves frames frames forwards (or backwards when negative) and
pauses, as frame stepping does in any player.
pub fn rate(&self) -> f32
pub fn set_rate(&mut self, rate: f32)
Sourcepub fn set_volume(&mut self, volume: f32)
pub fn set_volume(&mut self, volume: f32)
0..=1.
pub fn set_muted(&mut self, muted: bool)
Sourcepub fn needs_mixer(&self) -> bool
pub fn needs_mixer(&self) -> bool
Whether this preview has yet to be given an output by Video::set_mixer.
Sourcepub fn set_mixer(&mut self, mixer: Mixer)
pub fn set_mixer(&mut self, mixer: Mixer)
Gives a preview the output its FFmpeg sound goes to, whichever player has it now or takes over later.
pub fn set_looping(&mut self, looping: bool)
pub fn looping(&self) -> bool
Sourcepub fn current_time(&self) -> f64
pub fn current_time(&self) -> f64
The playhead in seconds.
Sourcepub fn tick(&mut self)
pub fn tick(&mut self)
Call every frame: at the end of the clip, starts again from the top when looping, or stops. When the system player has failed or has drawn nothing in time, FFmpeg takes over here.
Sourcepub fn current_frame(&self) -> Result<Frame>
pub fn current_frame(&self) -> Result<Frame>
The picture at the playhead at the clip’s full size, turned upright:
what Eagle’s frame tools (set as thumbnail, copy, save) capture.
Decoded afresh, so it does not disturb playback or the frames
Video::frame hands out.