๐Ÿ“ฆ hediet / rust-ffmpeg-frame-grabber

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

โ˜… 12 stars โ‘‚ 7 forks ๐Ÿ‘ 12 watching โš–๏ธ MIT License
ffmpegrust
๐Ÿ“ฅ Clone https://github.com/hediet/rust-ffmpeg-frame-grabber.git
HTTPS git clone https://github.com/hediet/rust-ffmpeg-frame-grabber.git
SSH git clone git@github.com:hediet/rust-ffmpeg-frame-grabber.git
CLI gh repo clone hediet/rust-ffmpeg-frame-grabber
Henning Dieterichs Henning Dieterichs Initial commit. 8da0559 4 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ .vscode
๐Ÿ“ data
๐Ÿ“ examples
๐Ÿ“ src
๐Ÿ“„ .gitignore
๐Ÿ“„ Cargo.lock
๐Ÿ“„ Cargo.toml
๐Ÿ“„ LICENSE.md
๐Ÿ“„ README.md
๐Ÿ“„ README.md

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