Crates.io | avirus |
lib.rs | avirus |
version | 0.2.5 |
source | src |
created_at | 2018-07-25 05:46:13.109304 |
updated_at | 2024-03-20 19:51:18.89111 |
description | A Rust library for manipulating AVI files for purposes such as glitch art. |
homepage | |
repository | https://github.com/chinatsu/avirus/ |
max_upload_size | |
id | 75856 |
size | 19,416 |
avirus
is a library for manipulating AVI files for purposes such as glitch art.
[dependencies]
avirus = "0.2.5"
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();
}