Building a Video Streaming Engine
An engineering exploration of building a small video-on-demand pipeline with Rust, FFmpeg, Axum, and adaptive HLS.
I started this experiment to understand what actually happens after a video is uploaded and before a browser can play it as an adaptive stream.
The code behind this exploration lives in mohxmd/stream-engine.
Across four posts, I follow the project from my initial assumptions to a working local pipeline and then to Cloudflare R2 storage: inspecting media with FFprobe, transcoding with FFmpeg, generating HLS playlists and segments, tracking background work, organizing storage, and moving generated playback assets out of the API server.
This is not an attempt to recreate Netflix or YouTube. It is a focused exploration of the mechanics and architectural boundaries that become visible when one uploaded file has to become a playback-ready video resource.
Parts
- 01I Tried Building a Video Streaming Engine in RustThe assumptions, boundaries, and first architecture behind my experiment with Rust, FFmpeg, and adaptive HLS.
- 02What Happens Between Upload and Adaptive HLSWhat I discovered while turning one uploaded video into metadata, a thumbnail, three HLS renditions, and a master playlist.
- 03Turning the Media Pipeline Into a Rust ServiceHow uploads, background work, video state, local storage, and HLS delivery came together around the media pipeline.
- 04Moving HLS Output to Cloudflare R2Why the streaming engine moved generated playlists, segments, and thumbnails out of local disk and into Cloudflare R2 object storage.