NTUTHUKO.MDUNGE

Software · AI · 2026

Live AI camera detector

A self-hosted camera server that streams live video to the browser, runs YOLO11 on every frame, records continuously, and stays usable over a Cloudflare tunnel.

Role
Solo build: server, streaming, front end, deployment
Year
2026
Discipline
Software, AI
Status
Running · bench and site monitoring
Index
04 / 10
Inference pipeline: capture, letterbox, YOLO11 forward pass, box overlay, dual transport.

80classes

COCO object vocabulary

640px

Inference input resolution

2paths

MJPEG on LAN, WebSocket through tunnels

24/7

Continuous frame recording

What it does

The server captures frames with OpenCV, draws YOLO11 detections on the stream, and serves the result to any browser on the network. It started as a stream from an ESP32-CAM and grew into a general USB webcam server once the microcontroller's frame rate became the limit.

  • Live video over MJPEG on the local network, with an authenticated web UI.
  • YOLO11 ONNX inference at 640 px, with boxes, labels and per-class counts on frame.
  • Continuous recording to disk, plus per-session playback at real-time pacing.
  • Brightness, contrast and saturation controls that write straight to the camera.
  • Single JPEG and WebSocket endpoints for clients that buffer or block MJPEG.

The tunnel problem

Cloudflare quick tunnels buffer multipart MJPEG, so a stream that is smooth on the LAN turns into a slideshow the moment it leaves the building. The page detects a trycloudflare.com hostname and switches to pushing individual JPEG frames over a WebSocket, with a polling fallback if the socket cannot connect.

That single decision is the difference between the camera being useful remotely and being useless, and it is the part that needed the most measurement rather than guesswork.

Detection tuning

Detection settings sit at the top of the server file so they can be changed without reading the pipeline: confidence 0.30, NMS 0.45, 640 px input, JPEG quality 70. YOLO11s at 640 px is noticeably more accurate on small objects; YOLO11n runs about three times faster and is the better choice when the machine is doing other work.

Every endpoint sits behind HTTP basic auth, with the credentials and model path supplied as environment variables so nothing sensitive is committed.

All projects
Studying · happy to help with projects
SAST --:--:--v2026.10