Skip to content

Modest-Human-Brands/mdrive

Repository files navigation

Logo

MMDrive

Uptime Status

Landing

An open-source media backend platform for ingesting, transcoding, storing, and delivering video and image assets via a global CDN — with built-in live streaming support over SRT.


What is MMDrive?

MMDrive is a self-hostable media infrastructure layer. It handles the full lifecycle of media assets — from upload or live stream ingest, through transcoding and optimization, to CDN-backed delivery. Built on Motia, it uses an event-driven step architecture making each pipeline stage independently scalable and observable.


Features

Ingest

  • SRT live stream ingest (per stream key, per device)
  • HTTP multipart upload for video and image assets
  • R2 / S3 direct upload with multipart support
  • Webhook emission on ingest completion

Transcode & Optimize

  • Multi-rendition HLS output (360p, 480p, 720p, 1080p)
  • Multi-codec support — H.264, H.265, AV1, VP9
  • Per-codec master playlist generation
  • Thumbnail extraction (by timestamp or percentage)
  • Image resize and optimization (WebP, AVIF)
  • Aspect ratio preservation with letterbox padding
  • Original recording captured alongside HLS output

Storage

  • Cloudflare R2 as primary object store
  • Live segment sync to R2 as segments close
  • Automatic VOD packaging on stream end
  • Asset deduplication via content hash / slug
  • Structured paths: /{slug}/{deviceId}/hls/, /original/, /thumbnails/

CDN & Delivery

  • Signed URL generation with configurable TTL
  • HTTP byte-range streaming support
  • HLS manifest rewriting with CDN base URL injection
  • Image dimension and metadata API
  • Video metadata API (duration, resolution, codec info)
  • Resolution negotiation per request

API

  • Asset CRUD — list, fetch, upload, delete
  • Stream provisioning — start, stop, status
  • Health endpoint for infrastructure monitoring
  • Project-based folder auto-creation
  • Anonymous share links with expiration

Platform

  • Analytics
  • Adaptive Bitrate Streaming (ABR)
  • Containerized via Docker
  • CI/CD via GitHub Actions

Roadmap

v1 — Core Pipeline

  • SRT ingest with FFmpeg
  • Multi-rendition HLS transcoding
  • H.264 / AV1 / VP9 codec support
  • R2 storage sync
  • HLS master playlist generation
  • Thumbnail generation
  • Asset metadata API
  • Stream start / stop / status API
  • VOD finalization on stream end
  • Signed URL delivery
  • Image optimization (WebP / AVIF)

v2 — Platform

  • OAuth 2.0 authentication
  • Project-based organization
  • Anonymous share links with TTL
  • Analytics dashboard
  • Push notifications
  • PWA shell

v3 — Scale & Ops

  • Multi-node Docker Swarm deployment
  • Horizontal FFmpeg worker scaling
  • Segment purge and storage lifecycle policies
  • End-to-end test suite
  • Prometheus + Grafana observability

Deployment

Prerequisites

  • Docker with Swarm mode
  • Cloudflare R2 bucket credentials

1. Initialize Swarm

docker swarm init --advertise-addr <MANAGER-IP>

2. Join Worker Nodes

docker swarm join --token <WORKER-TOKEN> <MANAGER-IP>:2377

3. Verify Nodes

docker node ls

4. Create Volumes

# Mount static and .data into your deployment path upload static, .data into /root/mmdrive

5. Deploy Stack

docker stack deploy --compose-file docker-compose.prod.yml mmdrive

6. Scale Workers

docker service scale mmdrive_app=2

7. Verify

docker service ls docker service ps mmdrive_app

External Dependencies


License

Published under the GNU GPLv3 license.


About

A role-based media asset management service for storing, organizing, and distributing unlimited media via global CDN, with granular access control and signed URL delivery

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors