pub enum VideoSource {
FrameDir {
frames: Vec<PathBuf>,
fps: f64,
},
Y4m {
path: PathBuf,
info: Y4mInfo,
},
}Expand description
A silent video given as decoded frames: a directory of images with an
explicit frame rate, or a Y4M stream (ffmpeg -i in.mp4 -pix_fmt yuv420p out.y4m). mp4 decoding is out of scope for v1.
Variants§
Implementations§
Source§impl VideoSource
impl VideoSource
Sourcepub fn frame_dir(dir: &Path, fps: f64) -> Result<Self, String>
pub fn frame_dir(dir: &Path, fps: f64) -> Result<Self, String>
Every image file of dir (png/jpg/jpeg/webp/gif/ppm), in natural
name order, played at fps.
Sourcepub fn y4m(path: &Path) -> Result<Self, String>
pub fn y4m(path: &Path) -> Result<Self, String>
Index a Y4M file (8-bit 4:2:0 / 4:2:2 / 4:4:4 / mono).
Sourcepub fn open(path: &Path, fps: Option<f64>) -> Result<Self, String>
pub fn open(path: &Path, fps: Option<f64>) -> Result<Self, String>
A directory (needs fps) or a .y4m file (its own rate; an explicit
fps overrides it).
pub fn frame_count(&self) -> usize
pub fn fps(&self) -> f64
Trait Implementations§
Source§impl Clone for VideoSource
impl Clone for VideoSource
Auto Trait Implementations§
impl Freeze for VideoSource
impl RefUnwindSafe for VideoSource
impl Send for VideoSource
impl Sync for VideoSource
impl Unpin for VideoSource
impl UnsafeUnpin for VideoSource
impl UnwindSafe for VideoSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more