tpt-av-asset

Rust

A 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.

0 stars0 forks0 watchersApache License 2.0

Languages

Rust100.0%
README

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.

License: MIT OR Apache-2.0 Crates.io CI Status

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

  1. Background-first — all heavy processing happens on background worker threads; the UI thread never blocks.
  2. Incremental & resumable — jobs persist partial progress; a cancelled or crashed job resumes where it left off.
  3. Cache-invalidation aware — when a source file changes, its caches are automatically invalidated and regenerated.
  4. Pure Rustredb, notify, and image; no SQLite, no ffmpeg, no C/C++ bindings.
  5. 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).
  6. Permissive licensing only — MIT OR Apache-2.0, enforced via cargo-deny.

Workspace crates

CrateRole
tpt-av-asset-utilsShared types: AssetId, MediaInfo, Priority, progress, errors.
tpt-av-asset-dbEmbedded media database (assets, cache entries, jobs).
tpt-av-asset-cacheWaveform peak + thumbnail caches, on-disk storage, RT-safe reader.
tpt-av-asset-proxyProxy generation engine (video downscale/re-encode, audio convert).
tpt-av-asset-watcherCross-platform filesystem monitoring with debouncing.
tpt-av-asset-pipelinePrioritized 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

CrateRole
tpt-kinetixMedia containers, video codecs (source of video frames).
tpt-cadenceAudio codecs (source of PCM data).
tpt-av-assetAsset management (this repo).

Early-stage note: the tpt-kinetix / tpt-cadence integrations currently build against local stand-in crates under stubs/ (see todo.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.