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
├── testapps/ # Test applications
│ └── nvr-client/ # DVRIP file downloader for Xiongmai/Sofia NVR
│ └── src/
│ ├── WatchForge.NVR.Client.TestApp/
│ └── WatchForge.NVR.Client.TestApp.Tests/
├── client/ # Frontend client application
├── db/
│ └── queries/ # Database schema and queries
└── server/ # Dotnet-based server components
└── MotionSentinel/ # Linux Worker Service — OpenCV motion detection
├── WatchForge.MotionSentinel.Server.Core/
├── WatchForge.MotionSentinel.Server.Core.Tests/
├── WatchForge.MotionSentinel.Server.Service/
└── WatchForge.MotionSentinel.Server.Service.Tests/
- 🎯 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 server/MotionSentinel/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 testapps/nvr-client/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.
