Skip to content

Raad-Labs/raad-video-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RAAD Video Server

High-performance video streaming service built on QUIC/HTTP3 with WebGPU acceleration. Handles proxying and real-time transcoding of video content from S3, optimized for multi-client scenarios.

Implementation Details

Network Stack

  • QUIC-based transport (aioquic) with multiplexed streams, ~40% lower latency vs HTTP/2
  • HTTP/3 support via Hypercorn, enabling 0-RTT connection establishment
  • Async I/O throughout, built on FastAPI/Starlette (~30k concurrent connections tested)

Video Processing

  • WebGPU compute shaders for frame processing (8x8 workgroups)
  • Hardware-accelerated AV1 encoding via WebCodecs API
  • WASM-based parallel processing using Rust + Rayon
  • Adaptive bitrate switching with <100ms detection time

ML Pipeline

  • Real-time quality prediction using 2-layer LSTM (64 hidden units)
  • Network condition analysis using 7-feature input vector
  • Inference latency <5ms on CPU, <1ms on GPU
  • Pre-trained models for common resolution scaling (240p-4K)

Development Setup

  1. Install dependencies:

    pip install -r requirements.txt
  2. Generate SSL certs for HTTP/3:

    mkdir certs
    openssl req -x509 -newkey rsa:4096 -keyout certs/key.pem -out certs/cert.pem -days 365 -nodes
  3. Run with HTTP/3 support:

    hypercorn app.main:app --bind 0.0.0.0:8443 --certfile certs/cert.pem --keyfile certs/key.pem --quic-bind 0.0.0.0:8443

API Reference

HTTP/3 Endpoints

  • GET /videos

    • Lists available videos from S3 bucket
    • Returns: {"videos": [{"key": string, "size": int, "last_modified": string}]}
  • GET /videos/{key}

    • Streams video with adaptive quality
    • Supports byte-range requests
    • Returns: StreamingResponse with quality-adapted video chunks

WebTransport Endpoints

  • WS /ws/video/{key}
    • Bidirectional video streaming with real-time control
    • Supports multiple concurrent streams per connection
    • Protocol: Custom binary format (see docs/protocol.md)

Performance Metrics

  • Startup latency: <100ms (with 0-RTT)
  • GPU utilization: ~60% at 4K/60fps
  • Memory usage: ~200MB base, ~50MB per active stream
  • Network overhead: 2-5% vs raw video size

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors