#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

#362 in Video

Download history 45/week @ 2024-01-05 16/week @ 2024-01-12 63/week @ 2024-01-19 2/week @ 2024-01-26 11/week @ 2024-02-02 30/week @ 2024-02-09 17/week @ 2024-02-16 39/week @ 2024-02-23 14/week @ 2024-03-01 51/week @ 2024-03-08 151/week @ 2024-03-15 121/week @ 2024-03-22 149/week @ 2024-03-29 74/week @ 2024-04-05

514 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

~18MB
~160K SLoC