Smart TV Local Media Server: Rust & Axum Backend
A high-performance, asynchronous media streaming and indexing server built in Rust. It dynamically generates video thumbnails and temporal scrubbing previews via FFmpeg subprocesses while efficiently serving raw media files over HTTP.
Performance & metrics
- Zero-overhead asynchronous I/O prevents thread starvation during simultaneous media streaming and FFmpeg execution
- Headless, resource-minimal memory footprint compared to JVM or Node.js based media servers
- Efficient localized frame extraction minimizes CPU thrashing by generating only surrounding frames during video scrubbing
Why I built it
Streaming large 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 large 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
- Asynchronous media indexing and recursive directory traversal
- On-the-fly FFmpeg subprocess orchestration for temporal scrub thumbnail generation
- Zero-copy static media serving via the
tower-httplayer - Recursive boot-time thumbnail preloader ensuring immediate cache readiness
- Non-blocking, daily rolling logs via the
tracingecosystem
Technical review
This backend demonstrates aggressive optimization in local media serving. By delegating static file delivery to the highly optimized tower-http layer and handling expensive ffmpeg extraction strictly via non-blocking Tokio tasks, the server maintains strict memory safety and runs reliably on low-power NAS hardware or single-board computers, directly feeding the Flutter frontend.
Related projects
Major project
Ferivonus Swagger Gen: Zero-Boilerplate OpenAPI Macro Engine
A zero-boilerplate OpenAPI 3.0.0 generator and custom Swagger UI engine for Actix-Web, distributed as a native Cargo crate and powered by compile-time procedural macros.
- Rust
- JavaScript
- HTML
- +10
Strawberry & Sugar: High-Performance Actix-Web & SQLx API
A high-performance Rust backend built on Actix-Web and SQLx, featuring compile-time query verification, Argon2 hashing, and strict role-based access control (RBAC).
- Rust
- SQL
- Actix-Web
- +5

Easy-DB: Dynamic REST API & SQLite Automation Library
A zero-boilerplate Rust library distributed via crates.io that instantly converts SQLite tables into a secure REST API, bundled with its own asynchronous HTTP client.
- Rust
- Axum
- Tokio
- +4
Need something similar?
I can build a system like this for you, too.
Describe your project in a few sentences, and we'll work out the right approach and an estimated scope together.