Skip to content

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

License

Notifications You must be signed in to change notification settings

hediet/rust-ffmpeg-frame-grabber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8da0559 · Mar 31, 2021

History

1 Commit
Mar 31, 2021
Mar 31, 2021
Mar 31, 2021
Mar 31, 2021
Mar 31, 2021
Mar 31, 2021
Mar 31, 2021
Mar 31, 2021
Mar 31, 2021

Repository files navigation

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());
    }
}

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages