Why Did I Build This?
"Streaming massive local media files to a Smart TV requires a low-latency, zero-overhead backend. Off-the-shelf media servers like Plex or Jellyfin are inherently bloated and resource-intensive. I engineered this lightweight Rust backend to interface directly with a custom Flutter Smart TV client. It handles on-the-fly FFmpeg frame extraction for seek-bar scrubbing and provides static file serving without the massive CPU and RAM footprint of traditional media servers."
Architecture & Decisions
The architecture is built on the Tokio asynchronous runtime and the Axum web framework. It utilizes `tower-http` for highly optimized, zero-copy static file serving. Media directory traversal and FFmpeg frame extraction (`tokio::process::Command`) are executed asynchronously, preventing I/O thread blocking during heavy loads. The server features a recursive boot-time preloader to cache standard thumbnails and an on-demand generator for temporal seek-bar scrubbing (extracting localized frame sequences for preview). Logging is strictly handled via the non-blocking `tracing_appender` to ensure zero I/O latency bottlenecks.
Key Features
- 01.Asynchronous media indexing and recursive directory traversal
- 02.On-the-fly FFmpeg subprocess orchestration for temporal scrub thumbnail generation
- 03.Zero-copy static media serving via the `tower-http` layer
- 04.Recursive boot-time thumbnail preloader ensuring immediate cache readiness
- 05.Non-blocking, daily rolling logs via the `tracing` ecosystem