#image #ffmpeg #frame #decode #iterator #grabber

ffmpeg-frame-grabber

Provides a frame iterator for videos by using ffmpeg. Decodes images using the image crate.

1 unstable release

0.1.0 Mar 31, 2021

#521 in Video

Download history 76/week @ 2024-11-15 11/week @ 2024-11-22 1/week @ 2024-11-29 36/week @ 2024-12-06 15/week @ 2024-12-13 5/week @ 2024-12-20 7/week @ 2024-12-27 51/week @ 2025-01-03 15/week @ 2025-01-10 5/week @ 2025-01-17 2/week @ 2025-01-24 10/week @ 2025-01-31 11/week @ 2025-02-07 39/week @ 2025-02-14 57/week @ 2025-02-21 54/week @ 2025-02-28

165 downloads per month

MIT license

17KB
439 lines

FFmpeg Rust Adapter

Installation

cargo add ffmpeg_frame_grabber

Requirements

This library requires the ffmpeg and ffprobe commands to be installed and in path!

Usage

use ffmpeg_frame_grabber::{FFMpegVideo, FFMpegVideoOptions};
use image_visualizer::{visualizer::view, VisualizableImage};
use std::{path::Path, time::Duration};

fn main()s {
    let video = FFMpegVideo::open(
        Path::new(&"./data/video.mp4"),
        FFMpegVideoOptions::default().with_sampling_interval(Duration::from_secs(120)),
    )
    .unwrap();

    for frame in video {
        let f = frame.unwrap();
        println!("offset: {:?}", f.time_offset);
        view!(&f.image.visualize());
    }
}

Dependencies

~11MB
~173K SLoC