Building a Bulk Video Processing Pipeline with Next.js, BullMQ and FFmpeg
How BatchEdits processes 50 videos in parallel: presigned R2 uploads, BullMQ queue orchestration, FFmpeg silence removal and Whisper-powered caption burning explained.
The developer behind BatchEdits, a bulk video editing tool, describes how they built a pipeline that lets users upload 50 videos at once and get them processed in parallel — with silence removal, captions, and platform-specific cropping. After realizing sequential processing would turn a 5-minute-per-video job into nearly two hours for 50 clips, they moved uploads off the Next.js server entirely, using presigned URLs for direct browser-to-R2 uploads (throttled with p-limit and tracked via XHR progress events) to avoid bandwidth and body-size bottlenecks.
On the processing side, BullMQ queues a separate job per video, and workers run with a configurable concurrency (e.g. 10) to process multiple videos simultaneously. Each worker downloads the video from R2, transcribes it with Whisper, strips silence using FFmpeg's silencedetect filter, burns word-level captions via drawtext, applies zoom, crops for the target platform, and re-uploads the result to R2.
Key takeaways include treating BullMQ concurrency as the main tuning lever (since FFmpeg is CPU- and memory-hungry), treating presigned uploads as non-negotiable at scale, and expecting Whisper's transcription accuracy to drop noticeably with background noise or multiple speakers. The write-up offers a concrete blueprint for engineers looking to scale CPU-intensive video workloads with queue-based worker architectures.