WatchForge is a self-hosted video processing for NVR (Network Video Recorder) system to enhance pixel precision motion detection.
watchforge/
├── WatchForge.slnx # Main .NET solution file
├── apps/
│ ├── web/ # Angular frontend
│ ├── api/ # REST API server (.NET)
│ └── services/
│ ├── WatchForge.MotionSentinel.Service/ # Linux Worker Service — OpenCV motion detection
│ ├── WatchForge.MotionSentinel.Service.Tests/
│ └── WatchForge.DVRIP.Service/ # DVRIP file downloader for Xiongmai/Sofia NVR
├── libs/
│ ├── WatchForge.DVRIP.Library/ # DVRIP protocol library (NuGet)
│ ├── WatchForge.DVRIP.Library.Tests/ # Unit tests for DVRIP library
│ ├── WatchForge.MotionSentinel.Library/ # Motion detection library (NuGet)
│ └── WatchForge.MotionSentinel.Library.Tests/ # Unit tests for MotionSentinel library
└── db/
└── queries/ # Database schema and queries
- 🎯 Farneback Dense Optical Flow — per-frame motion region detection using OpenCV
- 📁 Local filesystem — watches NVR recordings folder, writes JSON detection results
- ⚡ FileSystemWatcher + backfill — picks up files written while the service was down
- 🔌 Headless Worker Service — runs as a systemd unit, no UI required
- 🧪 test coverage via TUnit + Moq
See apps/services/WatchForge.MotionSentinel.Service/README.md for full docs.
- 📡 DVRIP protocol — native Xiongmai/Sofia TCP protocol (port 34567)
- 🔐 Sofia MD5 login, file listing, best-effort H.264 file download
- 🖥️ .NET 10, Linux (x64, arm64)
- 🧪 test coverage via TUnit + Moq See apps/services/WatchForge.DVRIP.Service/README.md for full docs.
- Framework: .NET 10
- NVR protocol: DVRIP (raw TCP, Xiongmai/Sofia firmware)
- Motion detection: OpenCV (Farneback optical flow) via OpenCvSharp4
- Platform: Linux (x64);
- Testing: TUnit + Moq with code coverage
- .NET 10 SDK
- Any .NET 10 runtime platform (Linux x64)
git clone https://github.com/StipecMV/watchforge
cd watchforgeWatchForge is an open-source project. See the LICENSE file for details.
