Inspiration
A good live stream needs a crew: someone watching for faces and plates that shouldn't be on air, someone swapping sponsor graphics, someone starting and stopping the recording, someone ready to cut the feed. Solo IRL streamers have none of that. They broadcast strangers' faces, street signs, house numbers and license plates to thousands of people, live, and a live leak can't be undone. So we asked: what if the production crew was an AI agent that lives in the camera and edits the stream as it happens?
What it does
Veil is an AI production crew for live video. You talk to it; it edits the stream on the fly.
- Hands-free director. Say "hey veil" and then what you want: "unblur the person on my left, she's with me", "turn on the ads", "start recording", "panic".
- Moderation before broadcast. Everyone but the streamer starts pixelated, and so do license plates, street-name signs, house numbers and storefront signs. Unblurring is a choice you make out loud or with a tap.
- Live sponsor placement. Billboards and posters in the shot are replaced with your own ad images, tracked to the surface, with a different image on each sign.
- Fail closed. If face detection stalls, the whole frame pixelates and the status turns red. A panic button and a spoken "panic" black out the frame at once.
- Private by design. The raw image is never shown, saved or sent. The agent only ever sees a text list of what is in view, and the wake phrase is detected on the device.
How we built it
- Video loop (on-device, 15 FPS): camera, a short delay buffer (a third of a second), YuNet face detection on every frame, YOLOE-26n for signs, plates and ads on its own thread, ByteTrack IDs, SFace to recognise the owner, a policy engine, then pixelation. Only censored frames reach the preview and the recording.
- Voice loop: an on-device wake phrase (Vosk) opens the mic for one turn. Deepgram's Voice Agent API (Flux speech-to-text, an OpenAI model, Aura-2 voice) turns the request into one of nine tool calls that run locally: blur or show a class or a person, panic, replace ads, start and stop recording.
- One rule: the agent can only change policy, never pixels.
- Ad replacement: the sign's corners are found and the image is warped onto them, followed with optical flow, and toned and grained to match the scene. Ads are drawn before censoring, so a face in front of an ad stays pixelated.
- How we worked: Claude Code as an orchestrator, with implementer agents each in their own git worktree, about 30 small work packages merged one by one behind a test suite.
Challenges
- Guaranteeing that a late detection never leaks a face: delay buffer, backfill, hold-over and a watchdog, checked by a leak test on recorded clips.
- Mapping "the person on my left" to a tracked ID reliably.
- Making a replaced ad look like part of the scene instead of a pasted image: jitter, stacked detections, perspective and lighting. Occlusion is still unsolved.
- False faces on printed posters, and telling a street-name sign from a stop sign.
- Hands-free voice without sending room audio off the device before the wake phrase.
What we learned
A production crew is mostly judgement about what must not go out, so privacy is a design problem before a model problem: default to deny, fail closed, and keep the LLM away from the pixels. Detect-every-frame is the wrong approach for editing a moving surface; lock onto it once and track it.
What's next
Streaming straight to OBS and platforms, clips of the last 30 seconds on command, undo, ads that go behind people, audio redaction, and the same architecture on a handheld Raspberry Pi camera, body cams and smart glasses.
Built with
Python, OpenCV, Deepgram Voice Agent API (Flux, Aura-2), OpenAI, Vosk, YuNet, SFace, YOLOE (Ultralytics), ByteTrack, pygame, Claude Code
Built With
- bytetrack
- deepgram-voice-agent-api
- faster-whisper
- openai
- opencv
- pyvirtualcam
- sface
- yoloe
- yunet