MediaKit Documentation

Self-hosted video streaming + image optimization. The open-source Mux + Cloudinary alternative.

What is MediaKit?

MediaKit is a complete media infrastructure platform you deploy on your own servers. It handles:

  • Video uploads — Presigned URL uploads directly to S3/R2 (bypasses your server)
  • HLS transcoding — FFmpeg pipeline creates 360p/480p/720p/1080p renditions with adaptive bitrate
  • Image transforms — On-demand resize, crop, format conversion with CDN caching
  • React SDK — Drop-in components for video players, uploaders, and galleries
  • Embed script — Single <script> tag to embed videos anywhere
  • Analytics — Play counts, watch time, viewer insights
  • AI analysis — Video summaries, chapter generation, content moderation
  • Webhooks — HMAC-signed event delivery for integration

Architecture

text
┌─────────────┐     ┌──────────────┐     ┌───────────┐
│  React SDK  │────▶│   Go API     │────▶│ PostgreSQL│
│  or Embed   │     │  (Gin+GORM)  │     └───────────┘
└─────────────┘     │              │     ┌───────────┐
                    │  FFmpeg jobs  │────▶│   Redis   │
┌─────────────┐     │  Image proxy  │     └───────────┘
│ Admin Panel │────▶│  Webhooks     │     ┌───────────┐
│  (Next.js)  │     │  Analytics    │────▶│  R2 / S3  │
└─────────────┘     └──────────────┘     └───────────┘

Tech Stack

LayerTechnology
APIGo 1.24 + Gin + GORM
DatabasePostgreSQL 16
Cache & JobsRedis 7 + asynq
StorageCloudflare R2 / AWS S3 / Backblaze B2
VideoFFmpeg (HLS transcoding)
FrontendNext.js 16 + React 19 + Tailwind CSS
React SDKVite library mode → npm package
EmbedVite IIFE → single script
MonorepoTurborepo + pnpm workspaces
AIVercel AI Gateway (Claude)

API Base URL

All API endpoints are prefixed with your API domain. Throughout these docs we use:

text
https://mediakitapi.gritcms.com

Replace with your own domain when self-hosting.