#bindings #codec #decoder #multimedia #api-bindings #linker

cadeau

Idiomatic rust bindings to Cadeau library, performance primitives and media foundation functions

5 releases (breaking)

0.5.0 Dec 3, 2024
0.4.0 Jul 28, 2024
0.3.0 Jul 26, 2024
0.2.0 Jul 25, 2024
0.1.0 Jul 24, 2024

#242 in Images

Download history 147/week @ 2024-08-20 159/week @ 2024-08-27 120/week @ 2024-09-03 52/week @ 2024-09-10 37/week @ 2024-09-17 82/week @ 2024-09-24 242/week @ 2024-10-01 97/week @ 2024-10-08 97/week @ 2024-10-15 213/week @ 2024-10-22 175/week @ 2024-10-29 293/week @ 2024-11-05 214/week @ 2024-11-12 179/week @ 2024-11-19 215/week @ 2024-11-26 445/week @ 2024-12-03

1,109 downloads per month

MIT/Apache

48KB
986 lines

An efficient and idiomatic cadeau to Rust

Idiomatic wrapper around the Cadeau library: performance primitives and media foundation.

It’s possible to choose between dynamically loading the library and regular static / dynamic linking at build-time for a total of three options. See xmf-sys to learn more about this.

Example: generate a WebM file from a PNG image

use cadeau::xmf::image::Image;
use cadeau::xmf::recorder::Recorder;

fn main() -> Result<(), Box<dyn std::error::Error>> {
  #[cfg(feature = "dlopen")]
  unsafe { cadeau::xmf::init("libxmf.so")? };

  assert!(cadeau::xmf::is_init());

  let frame = Image::load_file("frame.png")?;

  let mut recorder = Recorder::builder(frame.width(), frame.height())
    .frame_rate(10)
    .init("output.webm")?;

  recorder.update_frame(frame.data(), 0, 0, frame.width(), frame.height(), frame.step())?;
  recorder.timeout();

  Ok(())
}

Dependencies

~0–4.5MB