Prompt
How do I process user-uploaded videos at scale without running my own ffmpeg servers?
Latest observation
If you want to process user-uploaded videos at scale without operating your own ffmpeg fleet, the usual pattern is to offload transcoding and media processing to a managed video pipeline or a serverless workflow.
Good options
1) Use a managed video processing platform
These services handle upload, transcode, thumbnails, adaptive bitrate ladders, captions, and delivery.
Common choices:
- Mux
- Cloudflare Stream
- AWS Elemental MediaConvert + S3/CloudFront
- Google Cloud Transcoder API
- Azure Media Services was the old option, but it’s retired for many use cases; Azure customers often use partner solutions now.
Best when:
- You want the simplest ops
- You need adaptive streaming and thumbnails
- You don’t want to manage encoding workers
Tradeoff:
- Higher per-minute cost than self-hosted encoding
- Less control over unusual encoding settings
2) Use object storage + event-driven serverless processing
A common architecture:
- User uploads video directly to object storage
- S3, GCS, Azure Blob
- Storage event triggers a job
- Lambda, Cloud Run, Cloud Functions, queue consumer
- Job sends the video to a managed transcoding API
- Result files go back to storage/CDN
- Your app tracks status in a database
This avoids running ffmpeg servers yourself, but you still orchestrate the workflow.
Best when:
- You need custom pipeline logic
- You want to mix multiple processing steps
- You have bursty traffic and want elastic scaling
3) Use a streaming/encoding API
If your needs are narrower, you can use APIs that do specific steps:
- thumbnail extraction
- GIF generation
- scene detection
- clipping
- watermarking
- subtitle burning
This is useful when you only need a subset of video processing rather than full VOD transcoding.
Recommended architecture
A scalable pattern looks like this:
- Frontend requests an upload URL
- Client uploads directly to storage using a signed URL
- Upload event creates a processing job
- Managed transcoder creates outputs:
- HLS/DASH renditions
- thumbnails
- poster images
- Webhook updates job status
- CDN serves the processed media
This avoids bottlenecks and keeps your app servers out of the heavy lifting.
Important design tips
Upload directly from the client
Don’t proxy video uploads through your app server unless you must. It saves bandwidth and avoids timeouts.
Use resumable uploads
Videos are large and uploads fail. Support:
- multipart uploads
- resumable/chunked uploads
- retries
Track jobs asynchronously
Never make the user wait on the upload request itself. Use:
- job queue
- status table
- webhook callbacks
Separate storage from processing
Store originals and outputs separately:
originals/processed/thumbnails/
Use a CDN for playback
Serve processed video through a CDN, not your app servers.
When to self-host ffmpeg anyway
Self-hosting can make sense if:
- you need very custom filters
- you have high and predictable volume
- cost is a bigger concern than ops complexity
- you need full control over codecs/settings
If that’s the case, you’d typically run ffmpeg in containers on:
- Kubernetes
- ECS/Fargate
- Cloud Run jobs
- batch workers on autoscaling VMs
Practical “best default” recommendation
If you want the least operational burden, I’d start with:
- Mux or Cloudflare Stream if you want a productized video platform
- S3 + MediaConvert if you want more AWS control
- GCS + Transcoder API if you’re on GCP
If you want, I can also give you:
- a reference architecture diagram,
- a cost comparison of Mux vs AWS vs self-hosted ffmpeg, or
- a step-by-step implementation for a specific cloud.