Rust API

In Rust, an encoder is nc_encoder::Encoder<B>, the shared engine, driving one codec's backend B: nc_h264::H264Backend, nc_hevc::HevcBackend, nc_vvc::VvcBackend, nc_av1::Av1Backend, nc_vp9::Vp9Backend or nc_av2::Av2Backend. Each codec crate also has its decoder (nc_h264::Decoder, ...). The crates are not published on crates.io; depend on them by git or path.

# Cargo.toml
[dependencies]
nc-common = { git = "https://github.com/cribbinsb/nanocodec" }
nc-encoder = { git = "https://github.com/cribbinsb/nanocodec" }
nc-h264 = { git = "https://github.com/cribbinsb/nanocodec" }

The encoder

This is the only way any of our front ends encodes: the command line, the C API and the browser module all drive this Encoder.

Minimal encode and decode loop

H.264 at 300 kbps, decoded frame by frame. It is crates/nc-h264/examples/encode_decode.rs, compiled by the workspace tests; run it with cargo run --release -p nanocodec-h264 --example encode_decode:

Loading…

The API documentation of every crate: cargo doc --open -p nanocodec-encoder.