suzuran0y/CCTV-Smartphone-AI-Monitoring

本地监控 + AI 视觉 — LAN-based smartphone-powered AI monitoring framework with structured event output for data acquisition and analysis.

Sentinel – Real‑time LAN‑based Vision Monitoring System

What it is – Sentinel is an open‑source framework that turns ordinary Android smartphones into network‑camera nodes and a PC‑side Flask server into a live‑preview, recording, and AI‑analysis dashboard. All video traffic stays inside a local LAN; no cloud services are required unless you plug in an external inference API.

Key components

Component Role Main tech
CamFlow (Android app) Captures the phone’s camera, compresses each frame to JPEG and POSTs it to the server. Java/Kotlin, Android SDK
PC Dashboard Receives frames, buffers the latest image, serves an MJPEG stream, records segmented MP4/AVI files, and runs optional AI modules. Python 3.9+, Flask, OpenCV, ffmpeg
Browser UI Shows live video, lets you start/stop recording, tweak parameters, view logs and AI event JSON. HTML/JS (static assets)

How it works

  1. Data‑acquisition layer – CamFlow continuously uploads single‑frame JPEGs via HTTP POST /upload.
  2. Service‑processing layer – The Flask server stores the newest frame in a FrameBuffer. Separate workers read from this buffer for:
    • MJPEG streaming (/stream),
    • Segmented video recording, and
    • Optional AI monitoring.
  3. Presentation layer – The browser dashboard reads the MJPEG stream and exposes controls for stream FPS, JPEG quality, recording codec, motion‑trigger thresholds, and AI prompt templates.

AI‑triggered monitoring

  • A lightweight motion detector (traditional CV) runs on every frame.
  • When motion exceeds a configurable threshold, the system switches to OBSERVE state and calls a pluggable vision model (e.g., OpenAI, Claude, or any HTTP‑based inference service).
  • The model’s response is parsed into a fixed JSON schema (has_person, risk_level, confidence, summary, …) and logged for later analysis.
  • Prompt‑template, scene‑profile, and extra‑rule parameters are editable from the dashboard, making the model’s behaviour programmable.

Why it’s useful

  • Privacy‑first: all video and logs stay on the local PC; no SD cards or third‑party cloud storage are needed.
  • Low cost: any spare Android phone becomes a camera node—no dedicated IP cameras.
  • Extensible: the AI module is an interface; you can swap in any vision model or add custom CV pipelines.
  • Research‑ready: structured JSON event logs make it easy to collect datasets for later model training or statistical studies.

Current maturity

  • Version v1.1.3 (2026‑08‑20) – stable release with Windows‑compatible codec fallback, API‑key redaction, improved address validation, and expanded test suite.
  • Core features (real‑time preview, segmented recording, motion trigger, AI hook) are production‑ready for LAN deployments.
  • Documentation includes a step‑by‑step deployment guide, Android user guide, and a roadmap for future features (e.g., multi‑camera aggregation, on‑device inference).

Getting started

  1. Clone the repo and install Python dependencies from requirements.txt.
  2. Run server.py on a PC (Python 3.9+). The console prints the address (IP:PORT) for the Android client.
  3. Install CamFlow on an Android device (APK provided in PhoneCamSender/ or build from source) and enter the printed address.
  4. Open the printed URL in a browser to see the live MJPEG feed, start recording, or enable the AI monitor.
  5. (Optional) Configure config/config.json via the dashboard to adjust stream FPS, recording codec, motion threshold, or AI prompt templates.

License – MIT (see LICENSE).


Bottom line – Sentinel is a genuine, self‑contained vision‑monitoring framework that leverages smartphones as cheap cameras and provides a Python‑based server with optional large‑model inference. It fits squarely within the AI/ML/LLM‑enabled monitoring space and can serve both hobbyist home‑security setups and research prototypes for multimodal visual data collection.

Related

  • Project
  • Project
  • Project
  • Dispatch