pub struct FrameExtractor { /* private fields */ }Expand description
Implementations§
Source§impl FrameExtractor
impl FrameExtractor
Sourcepub fn new(input: impl AsRef<Path>) -> Self
pub fn new(input: impl AsRef<Path>) -> Self
Creates a new FrameExtractor for the given input file.
The default extraction interval is 1 second.
Sourcepub fn interval(self, d: Duration) -> Self
pub fn interval(self, d: Duration) -> Self
Sets the time interval between extracted frames.
Passing Duration::ZERO causes run to return
DecodeError::AnalysisFailed.
Sourcepub fn run(self) -> Result<Vec<VideoFrame>, DecodeError>
pub fn run(self) -> Result<Vec<VideoFrame>, DecodeError>
Runs the extraction and returns one frame per interval.
Timestamps 0, interval, 2×interval, … up to (but not including)
the video duration are sampled. DecodeError::NoFrameAtTimestamp
for a given timestamp is silently skipped with a warn! log; all
other errors are propagated immediately.
§Errors
DecodeError::AnalysisFailed— interval is zero, or the input file cannot be opened.- Any other
DecodeErrorpropagated from the decoder.
Auto Trait Implementations§
impl Freeze for FrameExtractor
impl RefUnwindSafe for FrameExtractor
impl Send for FrameExtractor
impl Sync for FrameExtractor
impl Unpin for FrameExtractor
impl UnsafeUnpin for FrameExtractor
impl UnwindSafe for FrameExtractor
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