Media Infrastructure
You Own
Video streaming, image optimization, and CDN delivery. Upload, transcode, transform, stream, and analyze — from your own servers.
// 1. Get presigned URL
const { data } = await fetch('/api/mediakit/uploads/presign', {
method: 'POST',
headers: { 'X-API-Key': 'mk_live_...' },
body: JSON.stringify({
filename: 'demo.mp4',
content_type: 'video/mp4',
file_size: 52428800,
asset_type: 'video',
title: 'Product Demo'
})
}).then(r => r.json());
// 2. Upload directly to R2/S3 (bypasses your server)
await fetch(data.upload_url, {
method: 'PUT',
body: videoFile,
headers: { 'Content-Type': 'video/mp4' }
});
// 3. Confirm → auto-transcodes to HLS
await fetch('/api/mediakit/uploads/complete', {
method: 'POST',
headers: { 'X-API-Key': 'mk_live_...' },
body: JSON.stringify({ asset_id: data.asset_id })
});20+
API Endpoints
6
React Components
4
Quality Tiers
∞
Storage (R2/S3)
Everything you need for media
From upload to playback. Every feature is an API endpoint, a React component, and an admin panel page.
Presigned Uploads
Files go directly from browser to R2/S3. Your API server never touches the bytes. Supports up to 10 GB.
HLS Streaming
FFmpeg transcodes to 360p–1080p adaptive bitrate. Master playlist with auto quality switching.
Image Transforms
On-demand resize, crop, format conversion. ?w=800&h=600&fit=cover&format=webp — cached at edge.
React SDK
6 components: VideoPlayer, VideoUploader, MediaImage, ImageUploader, EmbedCode, MediaGallery.
Embed Script
Single <script> tag embeds a video player on any website. WordPress, Ghost, Notion — anywhere.
Private Assets
JWT-signed URLs for paid content. Time-limited access with optional IP locking.
Analytics
Play counts, watch time, top videos. Redis-first ingestion handles thousands of concurrent viewers.
Webhooks
HMAC-SHA256 signed event delivery. asset.ready, video.transcoded — with exponential backoff retries.
AI Analysis
Video summaries, auto-generated chapters, content moderation. Powered by Claude via AI Gateway.
API Keys
mk_live_ prefixed keys with scopes. Server-to-server auth for your backend integrations.
Admin Panel
Dashboard with live transcode progress, video previews, analytics charts, and webhook management.
Background Jobs
Redis-backed job queue. Transcode, sprite generation, webhook delivery — with retry and progress tracking.
How it works
Upload
Client gets a presigned URL, uploads directly to R2/S3. Zero load on your API.
Transcode
FFmpeg creates HLS renditions (360p–1080p), sprites, thumbnails. Background job with progress.
Deliver
CDN-cached HLS streaming. Image transforms on-the-fly. Signed URLs for premium content.
Analyze
Play events flow to Redis, batch to Postgres. AI generates summaries and chapters.
MediaKit vs. the alternatives
| Feature | MediaKit | Mux | Cloudinary |
|---|---|---|---|
| HLS Streaming | ✓ | ✓ | ✗ |
| Image Transforms | ✓ | ✗ | ✓ |
| Self-Hostable | ✓ | ✗ | ✗ |
| Open Source | ✓ | ✗ | ✗ |
| React SDK | ✓ | ✓ | ✓ |
| AI Moderation | ✓ | Paid | Paid |
| Sprite Previews | ✓ | Paid | ✗ |
| Your Data | ✓ | ✗ | ✗ |
| Zero Egress Fees | ✓ | ✗ | ✗ |
| One-time Deploy | ✓ | ✗ | ✗ |
Own your media infrastructure
Deploy on your server. Connect your R2/S3 storage. Keep your data. Pay nothing per view.