minimal-video-streaming-app Svelte Themes

Minimal Video Streaming App

Minimal video streaming app built with Rust and Svelte

Minimal Private Video Streaming Service

This is a lightweight, decoupled client-server application for uploading and streaming videos using HTTP Live Streaming (HLS). It features a Rust (Axum) backend for fast, concurrent video processing and a Svelte frontend for a reactive user interface.

Prerequisites

Before running this application locally, ensure you have the following installed on your system:

  1. Rust & Cargo: The backend is written in Rust.
    • Install via rustup: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Node.js & npm: Required to build and run the Svelte frontend.
  3. FFmpeg: The backend relies on FFmpeg to transcode uploaded videos into HLS segments on the fly.
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: sudo apt update && sudo apt install ffmpeg
    • Windows: Download from gyan.dev or use winget install ffmpeg, and ensure it is added to your system's PATH.

Getting Started

Assuming you have extracted the project files from the provided ZIP archive, follow these steps to run the application:

1. Start the Rust Backend

The backend handles file uploads, orchestrates FFmpeg, and serves the video segments.

  1. Open a terminal and navigate to the backend directory:
    cd backend
    
  2. Run the server using Cargo:
    cargo run --release
    
    (Note: --release is recommended for better video processing performance. The backend will start on http://127.0.0.1:8000)

2. Start the Svelte Frontend

The frontend provides the UI for uploading videos and the player for streaming them.

  1. Open a new terminal window and navigate to the frontend directory:
    cd frontend
    
  2. Install the Node dependencies:
    npm install
    
  3. Start the Vite development server:
    npm run dev
    
    (The frontend will start on http://localhost:3000 and automatically proxy API requests to the backend)

3. Access the Application

Open your web browser and navigate to: http://localhost:3000

You can now upload a video file (up to 1GB). The system will immediately begin transcoding it into HLS segments, and you can start watching the stream while it processes in the background!

Architecture

For a detailed breakdown of the system design, performance optimizations, and proxy routing decisions, please refer to the architecture.md file included in this repository.

Top categories

Loading Svelte Themes