SecureGate Docs

Cameras

Camera configuration — RTSP, webcam, and Agora RTC streaming with live detection overlay

Camera Types

Each camera has a type that determines how face detections are processed:

TypeBehaviorUse Case
entryDetections create "entered" timeline entriesDoors, gates, turnstiles
exitDetections create "exited" timeline entriesExit doors, departure gates
in-eventDetections logged but no entry/exit trackingInterior monitoring, stage area

Video Sources

RTSP Streams

Connect any IP camera that exposes an RTSP endpoint:

{
  "room_id": "room_xyz",
  "name": "Entrance Cam 1",
  "type": "entry",
  "source": "rtsp://192.168.1.100:554/stream1"
}

The ingest service connects to the RTSP stream, decodes frames at the configured FPS (default 5), and runs face detection + weapon detection on each frame.

Webcam (Browser)

The operator dashboard can use a device webcam as a camera source. Video frames are captured in the browser, face/weapon detection runs client-side (YOLO26n for weapons, MediaPipe for face landmarks), and frames are sent to the server for full detection and matching.

Agora RTC

For remote or cloud-connected cameras, SecureGate supports Agora RTC streaming. The camera device streams video via Agora's SDK, and the ingest service subscribes to the Agora channel to receive frames.

{
  "room_id": "room_xyz",
  "name": "Remote Cam",
  "type": "entry",
  "source": "agora://channel_name/uid"
}

Agora RTC provides:

  • Low-latency streaming over unreliable networks
  • Automatic bitrate adaptation
  • NAT traversal for cameras behind firewalls

Live Detection Overlay

When viewing a camera in the operator dashboard, detections are rendered in real-time as bounding box overlays:

  • Green box: Recognized attendee (matched above threshold)
  • Yellow box: Detected face, no match (unknown person)
  • Red box: Weapon detected
  • Name label: Displayed for recognized attendees

Browser-side detection (YOLO26n for weapons, MediaPipe for face landmarks) provides instant visual feedback. Server-side detection (InsightFace, YOLOv8n) provides definitive results with a slight delay (~50-100ms round trip).

Frame Processing Pipeline

Camera Stream (RTSP / Webcam / Agora)
    |
    v (decode at configured FPS)
Frame
    |
    +-- Browser: YOLO26n weapon detection (instant overlay)
    +-- Browser: MediaPipe face mesh (468 landmarks, instant overlay)
    |
    +-- Server: Ingest service
    |   +-- InsightFace face detection
    |   +-- Quality filtering
    |   +-- YOLOv8n weapon detection
    |   |
    |   +-- Accepted faces -> Embed service
    |   |   +-- ArcFace embedding extraction
    |   |   +-- sqlite-vec / FAISS search
    |   |   +-- Match result -> Dashboard
    |   |
    |   +-- Weapon detections -> Alert system
    |
    v
Dashboard updates (WebSocket push)

Configuration

VariableDefaultDescription
STREAM_FPS5Frames per second to process from each stream
MAX_CONCURRENT_STREAMS50Maximum simultaneous camera streams per service instance
AGORA_APP_ID(required for Agora)Agora RTC application ID (stored in KMS)
RTSP_TIMEOUT_SEC10Connection timeout for RTSP streams
RTSP_RECONNECT_SEC5Reconnection delay after RTSP stream loss

On this page