pub struct VideoWriter<B: Backend> { /* private fields */ }Expand description
A high-level video writer that buffers frames and writes to disk.
Supports GIF output and image sequences. Frames are buffered in
memory and flushed on finish() or Drop.
Implementations§
Source§impl<B: Backend> VideoWriter<B>
impl<B: Backend> VideoWriter<B>
Sourcepub fn create(
output_path: impl AsRef<Path>,
width: usize,
height: usize,
options: &VideoWriteOptions,
) -> Result<Self>
pub fn create( output_path: impl AsRef<Path>, width: usize, height: usize, options: &VideoWriteOptions, ) -> Result<Self>
Creates a new video writer for the given output path and dimensions.
Sourcepub fn write_frame(&mut self, frame: &Frame<B>) -> Result<()>
pub fn write_frame(&mut self, frame: &Frame<B>) -> Result<()>
Writes a single frame to the buffer.
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Returns the number of frames currently buffered.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Returns whether the writer has been finished.
Sourcepub fn output_path(&self) -> &Path
pub fn output_path(&self) -> &Path
Returns a reference to the output path.
Trait Implementations§
Source§impl<B: Backend> Drop for VideoWriter<B>
impl<B: Backend> Drop for VideoWriter<B>
Auto Trait Implementations§
impl<B> Freeze for VideoWriter<B>
impl<B> RefUnwindSafe for VideoWriter<B>where
<B as BackendTypes>::FloatTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: RefUnwindSafe,
impl<B> Send for VideoWriter<B>
impl<B> Sync for VideoWriter<B>
impl<B> Unpin for VideoWriter<B>where
<B as BackendTypes>::FloatTensorPrimitive: Unpin,
<B as BackendTypes>::QuantizedTensorPrimitive: Unpin,
impl<B> UnsafeUnpin for VideoWriter<B>
impl<B> UnwindSafe for VideoWriter<B>where
<B as BackendTypes>::FloatTensorPrimitive: UnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more