pub struct Stabilizer;Expand description
Two-pass video stabilization using FFmpeg’s vidstabdetect /
vidstabtransform filters.
Pass 1: Stabilizer::analyze — motion analysis, produces a .trf file.
Pass 2: Stabilizer::transform — correction, consumes the .trf file.
Implementations§
Source§impl Stabilizer
impl Stabilizer
Sourcepub fn analyze(
input: &Path,
output_trf: &Path,
opts: &AnalyzeOptions,
) -> Result<(), FilterError>
pub fn analyze( input: &Path, output_trf: &Path, opts: &AnalyzeOptions, ) -> Result<(), FilterError>
Analyze motion in input and write the transform file to output_trf.
Runs a self-contained FFmpeg filter graph:
movie → vidstabdetect → buffersink.
The resulting .trf file is consumed by Stabilizer::transform in pass 2.
§Errors
Returns FilterError::Ffmpeg if:
vidstabdetectis not available in the linkedFFmpegbuild.- The input file is unreadable or does not exist.
- The filter graph cannot be configured or the
.trffile cannot be written.
Sourcepub fn transform(
input: &Path,
trf_path: &Path,
output: &Path,
opts: &StabilizeOptions,
) -> Result<(), FilterError>
pub fn transform( input: &Path, trf_path: &Path, output: &Path, opts: &StabilizeOptions, ) -> Result<(), FilterError>
Apply motion transforms from the .trf file produced by Stabilizer::analyze.
Reads input, applies vidstabtransform, and writes the stabilized video
to output (re-encoded with the best available H.264 encoder).
§Errors
Returns FilterError::Ffmpeg if:
vidstabtransformis not available in the linkedFFmpegbuild.trf_pathdoes not exist or is unreadable.- The input file is unreadable or does not exist.
- The output file cannot be created or encoded.
Auto Trait Implementations§
impl Freeze for Stabilizer
impl RefUnwindSafe for Stabilizer
impl Send for Stabilizer
impl Sync for Stabilizer
impl Unpin for Stabilizer
impl UnsafeUnpin for Stabilizer
impl UnwindSafe for Stabilizer
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