tpt-av-asset
RustA pure-Rust, background media asset management engine — proxy generation, waveform peak caching, thumbnail indexing, and filesystem monitoring. The performance backbone of the TPT AV stack. Dual-licensed MIT/Apache-2.0.
Languages
tpt-av-asset
A pure-Rust, background media asset management engine. Proxy generation, waveform caching, thumbnail indexing, and filesystem monitoring. The performance backbone of the TPT AV Stack.
tpt-av-asset is the media asset management layer of the TPT AV Stack.
It provides the background infrastructure that makes professional media
applications feel instantaneous — even when working with massive 4K/8K video
files or multi-hour podcast recordings:
- Background proxy generation — lightweight versions of heavy media files for smooth playback.
- Waveform peak caching — pre-computed min/max/RMS peaks for instant waveform rendering.
- Video thumbnail caching — pre-computed thumbnails for timeline scrubbing.
- Media database — fast, concurrent indexing of all imported assets
(
redb, pure Rust, no C bindings). - Filesystem monitoring — automatic detection of file changes, moves, and deletions with automatic cache invalidation.
- Background processing pipelines — multi-threaded, prioritized, cancellable and resumable job queues.
Design highlights
- Background-first — all heavy processing happens on background worker threads; the UI thread never blocks.
- Incremental & resumable — jobs persist partial progress; a cancelled or crashed job resumes where it left off.
- Cache-invalidation aware — when a source file changes, its caches are automatically invalidated and regenerated.
- Pure Rust —
redb,notify, andimage; no SQLite, no ffmpeg, no C/C++ bindings. - Real-time safe reads — reading waveform peaks is allocation-free and lock-free, safe for the audio/render thread (guarded by an allocation-counting test).
- Permissive licensing only — MIT OR Apache-2.0, enforced via
cargo-deny.
Workspace crates
| Crate | Role |
|---|---|
tpt-av-asset-utils | Shared types: AssetId, MediaInfo, Priority, progress, errors. |
tpt-av-asset-db | Embedded media database (assets, cache entries, jobs). |
tpt-av-asset-cache | Waveform peak + thumbnail caches, on-disk storage, RT-safe reader. |
tpt-av-asset-proxy | Proxy generation engine (video downscale/re-encode, audio convert). |
tpt-av-asset-watcher | Cross-platform filesystem monitoring with debouncing. |
tpt-av-asset-pipeline | Prioritized background job pipeline and high-level AssetImporter. |
Each sub-crate is independently useful: use just the cache, just the proxy generator, or just the database.
Ecosystem
| Crate | Role |
|---|---|
tpt-kinetix | Media containers, video codecs (source of video frames). |
tpt-cadence | Audio codecs (source of PCM data). |
tpt-av-asset | Asset management (this repo). |
Early-stage note: the
tpt-kinetix/tpt-cadenceintegrations currently build against local stand-in crates understubs/(seetodo.md). They provide real WAV decode/encode and a synthetic video container so the whole engine is testable today; they will be swapped for the real git dependencies once those repositories are ready.
Quick start
See examples/ for runnable demos:
cargo run -p tpt-av-asset-examples --bin import_media # import + generate all caches
cargo run -p tpt-av-asset-examples --bin waveform_viewer # ASCII-render cached peaks
cargo run -p tpt-av-asset-examples --bin thumbnail_browser # list cached thumbnails
cargo run -p tpt-av-asset-examples --bin proxy_generator # proxies for a folder
On-disk layout
~/.tpt-av-asset/
├── db/assets.redb # embedded database
└── cache/
├── waveforms/{asset_hash}.peaks
├── thumbnails/{asset_hash}/NNNNNN.jpg
└── proxies/{asset_hash}_proxy.mp4 | .flac
Contributing
Contributions are welcome — see CONTRIBUTING.md. All contributions are dual-licensed MIT OR Apache-2.0, and must not introduce GPL/LGPL/AGPL/MPL dependencies.
License
Dual-licensed under either of:
at your option.
Copyright © 2026 TPT Solutions.