$ show rust-av/Av1an
Av1an is a hyper-scalable video encoding framework written in Rust, designed to parallelize encoding of AV1 (and other codecs) by splitting videos into scenes, encoding each scene independently, and concatenating the results. It supports multiple encoders (aomenc, SVT-AV1, rav1e, x264, x265, vpx) and provides advanced features like target quality (iterative probing to achieve a desired VMAF/SSIMULACRA2/Butteraugli score), VapourSynth integration for frame-accurate input and metric calculations, and scene detection via av-scenechange. The architecture is a classic library+binary workspace: `av1an-core` contains all encoding logic, chunk management, metrics, interpolation, and concatenation, while the `av1an` binary provides a CLI interface with extensive options for chunking methods, encoder parameters, zones, and resume capabilities. The system relies heavily on external tools (ffmpeg, mkvmerge, vspipe, encoder binaries) and uses a broker-based worker pool for parallel encoding with progress bars and Ctrl+C handling. The codebase is well-tested with integration tests that run actual encodes, and includes a dedicated interpolation module with eight methods (linear, natural cubic spline, Fritsch-Carlson, PCHIP, quadratic, cubic polynomial, Catmull-Rom, Akima) that is self-contained and reusable. While the project demonstrates strong engineering practices (modular design, extensive tests, CI/CD), it carries some technical debt: heavy use of nightly Rust features, global state via OnceCell, many unwrap/expect calls, and tight coupling to external tool versions. The repository is actively maintained with recent commits and a responsive issue tracker.
The LLM identified 2 files worth highlighting for reuse:
Provides eight interpolation methods (Linear, Natural cubic spline, Fritsch-Carlson, PCHIP, Quadratic, Cubic polynomial, Catmull-Rom, Akima) for predicting quantizer values from metric scores. The module is entirely self-contained with no internal dependencies beyond standard library types, making it directly reusable in any Rust project requiring interpolation. It includes thorough unit tests with real CRF/score data and demonstrates non-obvious numerical craftsmanship.
Implements `MetricStatistics` struct that computes mean, median, percentile, standard deviation, variance, and other aggregate statistics from a slice of f64 values. The module is isolated and generic, requiring only standard library imports. It solves a common data analysis problem (summarizing metric scores) and can be extracted into any Rust project needing statistical summaries without modification.