#ffmpeg #image #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

#443 in Video

Download history 31/week @ 2024-07-20 53/week @ 2024-07-27 58/week @ 2024-08-03 38/week @ 2024-08-10 85/week @ 2024-08-17 116/week @ 2024-08-24 168/week @ 2024-08-31 11/week @ 2024-09-07 30/week @ 2024-09-14 32/week @ 2024-09-21 28/week @ 2024-09-28 38/week @ 2024-10-05 67/week @ 2024-10-12 46/week @ 2024-10-19 59/week @ 2024-10-26 129/week @ 2024-11-02

320 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
~171K SLoC