#multimedia-video #multimedia #frame #art #manipulating #avi

avirus

A Rust library for manipulating AVI files for purposes such as glitch art

6 releases

Uses old Rust 2015

0.2.5 Mar 20, 2024
0.2.4 Apr 17, 2023
0.2.3 Apr 26, 2019
0.2.2 Aug 28, 2018
0.2.0 Jul 25, 2018

#122 in Video

Download history 7/week @ 2024-02-16 9/week @ 2024-02-23 109/week @ 2024-03-15 25/week @ 2024-03-22 11/week @ 2024-03-29 4/week @ 2024-04-05

149 downloads per month

Custom license

17KB
248 lines

avirus

avirus is a library for manipulating AVI files for purposes such as glitch art.

[dependencies]
avirus = "0.2.5"

Examples

avirus::AVI takes an existing AVI file and loads it into memory for manipulation. avirus::frames exposes a meta field, which holds simple structures with metadata about a frame. This field can be iterated over, and modified to create odd effects in the output file. When the AVI file's output() function is called, a new file will be rebuilt with the modified metadata.

extern crate avirus;

use avirus::AVI;
use avirus::frame::Frame;

fn main() {
    let mut avi = AVI::new("sample.avi").unwrap();
    let mut new_meta: Vec<Frame> = Vec::new();
    for frame in &mut avi.frames.meta {
        if frame.is_pframe() || frame.is_audioframe() {
            for _ in 0..3 {
                new_meta.push(*frame);
            }
        }
        else {
            new_meta.push(*frame);
        }
    }
    avi.frames.meta = new_meta;
    avi.output("sample_output.avi").unwrap();
}

Dependencies

~120KB