Video Labeling with DNN Filters – Object Detection & Classification Pipeline
Build an automated video labeling pipeline that detects objects, faces, and scenes using FFmpeg's DNN filters. SQL triggers + pgmq + Supabase Storage.
FFmpeg tutorial · ~12 min read · Updated July 2026
Video understanding is one of the most powerful applications of AI. Being able to automatically detect objects, faces, and scenes in videos opens up a world of possibilities — from content moderation and search to analytics and accessibility.
FFmpeg's DNN filters — dnn_detect and dnn_classify — make this possible. With pre‑trained models like YOLO, ResNet, and face detection models, you can label every frame of your video with rich metadata.
This guide shows you how to build a fully automated video labeling pipeline that:
Detects objects and faces in uploaded videos
Classifies scenes and emotions
Generates JSON metadata with bounding boxes and labels
Stores results alongside the original video
Key takeaways
dnn_detect — object and face detection with bounding boxes
dnn_classify — classification of scenes, emotions, and more
YOLO, ResNet, and face detection — proven models for video understanding
JSON metadata — results stored for search, analytics, and further processing
One SQL script — everything is set up with a single execution
The Gap: Video Understanding at Scale
Video is the most data‑rich medium we have. But without understanding what's in the video, it's just pixels. Manually labeling videos is impossible at scale. Automated video labeling using DNN filters makes it practical:
# 2. For each job: # a. Download the input file # b. Parse the 'commands' array # c. Execute each command: # - Run dnn_detect (extract JSON metadata) # - Run dnn_classify (extract JSON metadata) # - Run overlay (generate labeled video) # d. Upload outputs to public-processed # e. Update render table
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 labeling_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 = 'video-labeling'ORDER BY created_at DESC;
Step 3
Listen to notifications
In your application, listen for real‑time updates.
-- In your PostgreSQL client:LISTEN labeling_channel;
LISTEN render_status_channel;
LISTEN log_channel;
Frequently Asked Questions (FAQ)
What does the video labeling pipeline do?
The pipeline automatically detects and labels objects, faces, and scenes in uploaded videos using FFmpeg's dnn_detect and dnn_classify filters. It generates bounding boxes, labels, and confidence scores, and stores them as JSON metadata alongside the video.
What models are used?
The pipeline supports multiple models including YOLO for object detection, ResNet for classification, and face detection models. The default configuration uses OpenVINO models for face detection (face-detection-adas-0001), classification (emotions-recognition-retail-0003), and can be extended for general object detection.
What is the output format?
The pipeline outputs a JSON file containing all detection results: frame number, bounding box coordinates, label/class name, confidence score, and timestamp. This can be used for search, analytics, or further processing.
Can I use custom models?
Yes. You can use any OpenVINO or TensorFlow model that works with FFmpeg's dnn_detect or dnn_classify filters. You'll need to provide the model files and configure the input/output tensor names.
Final Word
You now have a fully automated video labeling pipeline that uses FFmpeg's DNN filters to detect objects, faces, and scenes in videos. With PostgreSQL triggers, pgmq, and Supabase Storage, you get:
Object and face detection — bounding boxes with confidence scores
Scene classification — labels for what's in the video
JSON metadata — rich, structured data for search and analytics
Labeled video output — visual overlay of detection results
Real‑time notifications — know when processing is complete
Full observability — monitoring views and logs
The pipeline is production‑ready, scalable, and extensible — you can swap in any DNN model for your specific use case.