#utilities #surrounding #plugin #plane #vapour-synth #vapoursynth4-rs

vapours

A collection of utilities surrounding vapoursynth4-rs

14 releases

0.2.5 Feb 27, 2026
0.2.3 Sep 7, 2025
0.2.0 Jul 30, 2025
0.1.6 Mar 31, 2025
0.1.0 Dec 31, 2024

#443 in Audio

Download history 75/week @ 2026-01-08 200/week @ 2026-01-15 514/week @ 2026-01-22 255/week @ 2026-01-29 266/week @ 2026-02-05 325/week @ 2026-02-12 359/week @ 2026-02-19 628/week @ 2026-02-26 417/week @ 2026-03-05 348/week @ 2026-03-12 405/week @ 2026-03-19 386/week @ 2026-03-26 390/week @ 2026-04-02 1006/week @ 2026-04-09 692/week @ 2026-04-16 427/week @ 2026-04-23

2,566 downloads per month

MIT license

32KB
694 lines

vapours

vapours is a collection of utilities surrounding vapoursynth4-rs. Generally these aid in VapourSynth plugin development. vapours can also be seen as a Rust equivalent to vs-tools to some extent.

For example, the classic invert filter goes from this:

for plane in 0..fi.num_planes {
    let mut src_p = src.plane(plane);
    let src_stride = src.stride(plane);
    let mut dst_p = dst.plane_mut(plane);
    let dst_stride = dst.stride(plane);

    let h = src.frame_height(plane);
    let w = src.frame_width(plane);

    for _ in 0..h {
        for x in 0..w as usize {
            unsafe { *dst_p.wrapping_add(x) = !*src_p.wrapping_add(x) };
        }

        src_p = src_p.wrapping_offset(src_stride);
        dst_p = dst_p.wrapping_offset(dst_stride);
    }
}

To this:

// Bring in extensions on `VideoFrame` like `as_slice()` and `as_mut_slice()`.
use vapours::frame::VapoursVideoFrame;

// ...

for plane in 0..fi.num_planes {
    let src_slice = src.as_slice::<u8>(plane);
    let dst_slice = dst.as_mut_slice::<u8>(plane);

    for (src_pixel, dst_pixel) in zip(src_slice, dst_slice) {
        *dst_pixel = !*src_pixel;
    }
}

Dependencies

~3.5MB
~65K SLoC