Build an automated pipeline that uses Whisper AI to transcribe audio and burn subtitles into videos using SQL triggers, pgmq, and Supabase Storage.
FFmpeg tutorial · ~12 min read · Updated July 2026
Subtitles are essential for accessibility, global reach, and viewer engagement. But generating and burning subtitles manually is tedious and time‑consuming. With AI‑powered speech‑to‑text, you can automate the entire process — from audio transcription to subtitle burn‑in — making your content accessible to a global audience.
This guide shows you how to build a fully automated subtitle generation pipeline that:
Extracts audio from uploaded videos
Transcribes speech using OpenAI Whisper (state‑of‑the‑art multilingual model)
Generates SRT subtitle files with timestamps
Burns subtitles into the video using FFmpeg
Delivers the final video with embedded subtitles
Key takeaways
One SQL script — everything is set up with a single execution against your Supabase database.
Whisper AI — state‑of‑the‑art speech‑to‑text supporting 99 languages.
Zero manual intervention — upload a video, get a subtitled version automatically.
Scalable and reliable — pgmq provides durable, transaction‑safe job queuing.
Configurable — adjust language, model size, and subtitle styling.
The Gap: Accessibility at Scale
Subtitles are no longer optional. They're essential for:
Accessibility — deaf and hard‑of‑hearing viewers
Global reach — viewers who speak different languages
Engagement — videos with subtitles have higher watch time
But generating subtitles manually is expensive and doesn't scale. What if the pipeline could be fully automated — triggered by the upload itself, transcribing and burning subtitles in the background?
This guide shows you exactly how to build that pipeline.
# 2. For each job: # a. Download the input file from private-uploads # b. Parse the 'commands' array from the job payload # c. Execute each command: # - Extract audio (ffmpeg) # - Run Whisper transcription # - Burn subtitles (ffmpeg) # d. Upload outputs to public-processed # e. Update render table with progress and logs # f. Mark job complete and delete from queue
Step 3
Restart the runner
After updating the environment, restart the runner service.
docker compose restart ffmpeglab-runner
Monitor the Pipeline
Step 1
Check queued jobs
Use the helper view to see all queued jobs.
SELECT * FROM subtitle_queue_view;
Step 2
Check render status
Query the existing render table for job status.
SELECT id, title, status, progress, data
FROM"render"WHERE project = 'subtitle-generation'ORDER BY created_at DESC;
Step 3
Listen to notifications
In your application, listen for real‑time updates.
-- In your PostgreSQL client:LISTEN subtitle_generation_channel;
LISTEN render_status_channel;
LISTEN log_channel;
Frequently Asked Questions (FAQ)
How does the automated subtitle pipeline work?
When a video is uploaded, a PostgreSQL trigger fires and pushes a job to pgmq. The ffmpeglab-runner extracts the audio, transcribes it using Whisper AI, generates an SRT subtitle file, and burns it into the video using FFmpeg's subtitles filter. The result is a video with embedded subtitles, stored in a public bucket.
What AI model is used for transcription?
The pipeline uses OpenAI's Whisper model (whisper.cpp implementation) for speech-to-text transcription. Whisper is a state-of-the-art multilingual model that supports 99 languages and runs efficiently on CPU, GPU, or Apple Silicon.
What languages are supported?
Whisper supports 99 languages including English, Spanish, French, German, Chinese, Japanese, Hindi, and many more. You can specify the language in the pipeline configuration or let Whisper auto-detect it.
Can I customize the subtitle styling?
Yes. The FFmpeg subtitles filter supports styling options including font, size, color, shadow, outline, and positioning. You can customize these in the runner's FFmpeg command.
How accurate is the transcription?
Whisper achieves state-of-the-art accuracy, with word error rates (WER) as low as 2-5% for English in clean audio. Accuracy depends on audio quality, background noise, and accents. Using a larger model (medium or large) improves accuracy.
Final Word
You now have a fully automated subtitle generation pipeline that uses Whisper AI to transcribe speech and burn subtitles into videos. With PostgreSQL triggers, pgmq, and Supabase Storage, you get:
AI-powered transcription — state-of-the-art Whisper model
99 language support — global reach
Real‑time notifications — know when processing is complete
Full observability — monitoring views and logs
Scalable architecture — handles any volume of videos
The pipeline is production‑ready, scalable, and configurable. It uses the existing render and logpiece tables from the FFmpegLab server, so there are no table conflicts — just pure, automated subtitle generation.