System requirements
Before building, make sure you have the following installed:| Dependency | Version | Purpose |
|---|---|---|
| Rust | ≥ 1.74 | Core engine (dpf binary) |
| Go | ≥ 1.23 | FFI bridge and dpf-example |
| musl-tools | Debian/Ubuntu | Static binary builds |
| FFmpeg | 6.0+ | Video and audio operations |
musl-tools on Debian/Ubuntu:
Clone the repository
Build commands
- Make commands
- Manual commands
Full build (Rust + Go)
Build both the Rust engine and the Go example in one step:This runs
build-rust followed by build-go. The Rust binary lands at dpf/target/release/dpf and the Go example at ./dpf-example.Static musl binary (Linux)
Build a fully static binary using musl libc — no shared library dependencies:Output:
dpf/target/x86_64-unknown-linux-musl/release/dpfStatic builds require
musl-tools and the x86_64-unknown-linux-musl Rust target. On macOS, the Makefile automatically selects aarch64-apple-darwin as the target triple instead.Go bridge only
Build the Go example binary (requires the Rust binary to already exist):Output:
./dpf-exampleRelease profile
The
[profile.release] section in dpf/Cargo.toml enables aggressive optimizations: opt-level = 3, lto = "fat", and codegen-units = 1. Fat LTO performs whole-program link-time optimization across all crates, and a single codegen unit allows the compiler to inline and optimize across module boundaries. These settings produce the smallest, fastest binary at the cost of longer compile times.