pub struct FfmpegWriter { /* private fields */ }Expand description
Saves video frames to a video file using ffmpeg.
This spawns an ffmpeg process and pipes the frames as raw video
(-f rawvideo) with no intermediate format conversion on our side; ffmpeg
performs whatever conversion the chosen encoder requires. The ffmpeg process
is spawned lazily on the first frame, once the frame width, height and pixel
format are known.
Implementations§
Source§impl FfmpegWriter
impl FfmpegWriter
pub fn new( fname: &str, ffmpeg_codec_args: FfmpegCodecArgs, rate: Option<(usize, usize)>, ) -> Result<Self, Error>
Sourcepub fn write_dynamic_frame(
&mut self,
frame: &DynamicFrame<'_>,
) -> Result<Duration, Error>
pub fn write_dynamic_frame( &mut self, frame: &DynamicFrame<'_>, ) -> Result<Duration, Error>
Write a frame. Return the presentation timestamp (PTS).
pub fn close(self) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for FfmpegWriter
impl RefUnwindSafe for FfmpegWriter
impl Send for FfmpegWriter
impl Sync for FfmpegWriter
impl Unpin for FfmpegWriter
impl UnsafeUnpin for FfmpegWriter
impl UnwindSafe for FfmpegWriter
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
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