975 lines
31 KiB
Markdown
975 lines
31 KiB
Markdown
# Spécification — Détection & Découverte de Caméras
|
|||
|
|
|
||
|
|
> **Inspiré de**: [Strix](https://github.com/eduard256/Strix) v2.1 — Moteur de découverte de flux IP
|
||
|
|
> **Date**: 2026-07-18
|
||
|
|
> **Statut**: Proposition d'architecture
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 1. Résumé Exécutif
|
||
|
|
|
||
|
|
Heimdall a besoin d'un système de **découverte automatique de caméras** sur le réseau local
|
||
|
|
pour remplacer la configuration manuelle actuelle (IP + URL RTSP saisis à la main).
|
||
|
|
|
||
|
|
L'architecture s'inspire directement de **Strix** (Go), un moteur de découverte de flux
|
||
|
|
éprouvé qui supporte 3600+ marques, 100 000+ patterns d'URL et 20 protocoles — mais
|
||
|
|
réimplémenté en **.NET 10 Clean Architecture** avec une intégration profonde dans l'écosystème
|
||
|
|
Heimdall (PostgreSQL, Hangfire, SignalR, Blazor).
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 2. Pipeline de Découverte
|
||
|
|
|
||
|
|
```
|
||
|
|
┌─────────────────────────────────────────────────────────────────────┐
|
||
|
|
│ PIPELINE DE DÉCOUVERTE │
|
||
|
|
│ │
|
||
|
|
│ 1. SCAN RÉSEAU 2. PROBE DEVICE 3. RECHERCHE DB 4. TEST FLUX │
|
||
|
|
│ ┌─────────┐ ┌──────────┐ ┌───────────┐ ┌─────────┐ │
|
||
|
|
│ │ Nmap │────→│ ONVIF │────→│ Heimdall │────→│ RTSP │ │
|
||
|
|
│ │ ARP │ │ WS-Disc │ │ CamDB │ │ HTTP │ │
|
||
|
|
│ │ mDNS │ │ HTTP │ │ (brands │ │ ONVIF │ │
|
||
|
|
│ │ (sous- │ │ mDNS/HAP │ │ + modèles)│ │ profil │ │
|
||
|
|
│ │ réseau │ │ ARP/OUI │ │ │ │ capture │ │
|
||
|
|
│ │ local) │ │ (100ms) │ │ │ │ écran │ │
|
||
|
|
│ └─────────┘ └──────────┘ └───────────┘ └─────────┘ │
|
||
|
|
│ │ │ │ │ │
|
||
|
|
│ ▼ ▼ ▼ ▼ │
|
||
|
|
│ ┌─────────────────────────────────────────────────────────┐ │
|
||
|
|
│ │ SYNTHÈSE │ │
|
||
|
|
│ │ - IP + MAC + Fabricant + Modèle │ │
|
||
|
|
│ │ - Protocoles detectés (ONVIF, RTSP, HTTP, HomeKit) │ │
|
||
|
|
│ │ - URL de flux testées + codecs + résolution │ │
|
||
|
|
│ │ - Statut (en ligne/hors ligne/type détecté) │ │
|
||
|
|
│ └─────────────────────────────────────────────────────────┘ │
|
||
|
|
│ │
|
||
|
|
│ ▼ │
|
||
|
|
│ ┌─────────────────────────────────────────────────────────┐ │
|
||
|
|
│ │ INTÉGRATION HEIMDALL │ │
|
||
|
|
│ │ - Création automatique de l'entité Camera │ │
|
||
|
|
│ │ - Sauvegarde des credentials (chiffrés) │ │
|
||
|
|
│ │ - Envoi config à l'Agent via SignalR │ │
|
||
|
|
│ │ - Notification UI (Blazor Hub) │ │
|
||
|
|
│ └─────────────────────────────────────────────────────────┘ │
|
||
|
|
└─────────────────────────────────────────────────────────────────────┘
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 3. Scan Réseau (NetworkScanner)
|
||
|
|
|
||
|
|
### 3.1. Découverte des hôtes
|
||
|
|
|
||
|
|
Stratégie progressive avec timeouts agressifs :
|
||
|
|
|
||
|
|
| Méthode | Port/Protocole | Timeout | Informations obtenues |
|
||
|
|
|---------|---------------|---------|----------------------|
|
||
|
|
| **ARP lookup** (table ARP locale) | Niveau 2 | 5ms | MAC, fabricant via OUI |
|
||
|
|
| **mDNS multicast** (`_hap._tcp.local`) | UDP 5353 | 1.5s | Caméras HomeKit (nom, modèle, device_id, catégorie) |
|
||
|
|
| **Ping ICMP** | ICMP | 500ms | Hôte joignable (nécessite `CAP_NET_RAW`) |
|
||
|
|
| **Scan ports ciblé** | 554,80,443,8080,34567,1935,81,88,8090,5544,10554,7070,7447,3702,8554,8001,8081,51826 | 100ms par port (parallèle 20 workers) | Ports ouverts typiques caméra |
|
||
|
|
| **WS-Discovery ONVIF** | UDP 3702 (unicast) | 100ms | Détection ONVIF — nom, hardware, XAddrs (URL device_service) |
|
||
|
|
|
||
|
|
> **Note**: Le scan réseau est exécuté **uniquement** sur les sous-réseaux configurés
|
||
|
|
> dans le Site (site.NetworkCidr) par le **Heimdall.Workers** (pas l'Agent).
|
||
|
|
> Un background job Hangfire planifié (`NetworkScanJob`) lance le scan périodiquement.
|
||
|
|
|
||
|
|
### 3.2. Architecture du scan
|
||
|
|
|
||
|
|
```
|
||
|
|
NetworkScanJob (Hangfire)
|
||
|
|
│
|
||
|
|
├── NetworkScannerService
|
||
|
|
│ ├── ArpLookup() → (MAC, Vendor)
|
||
|
|
│ ├── MulticastMdnsQuery() → (HomeKit cameras)
|
||
|
|
│ ├── PingSweep(cidr) → list<IP> joignables
|
||
|
|
│ └── PortScan(ip, ports) → list<int> ports ouverts
|
||
|
|
│
|
||
|
|
├── OnvifProbeService
|
||
|
|
│ └── ProbeDevice(ip) → ONVIFResult (XAddrs, name, hardware)
|
||
|
|
│
|
||
|
|
├── HttpProbeService
|
||
|
|
│ └── Probe(ip, ports) → HTTPResult (status, server header)
|
||
|
|
│
|
||
|
|
├── StreamTestService
|
||
|
|
│ ├── TestRtsp(url, creds) → codecs, résolution, latence, screenshot
|
||
|
|
│ ├── TestHttp(url, creds) → MJPEG snapshot
|
||
|
|
│ └── TestOnvifProfile(url) → résolution profils → test RTSP
|
||
|
|
│
|
||
|
|
└── DiscoveryResultProcessor
|
||
|
|
├── MergeResults() → fusionne toutes les données
|
||
|
|
└── CreateOrUpdateCamera() → persiste l'entité Camera
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 4. Probe Device (ProbeService)
|
||
|
|
|
||
|
|
### 4.1. ONVIF WS-Discovery
|
||
|
|
|
||
|
|
Envoi d'un message SOAP `Probe` en UDP unicast sur le port 3702 :
|
||
|
|
|
||
|
|
```xml
|
||
|
|
<?xml version="1.0" ?>
|
||
|
|
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
|
||
|
|
<s:Header xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing">
|
||
|
|
<a:Action>http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe</a:Action>
|
||
|
|
<a:MessageID>urn:uuid:{uuid}</a:MessageID>
|
||
|
|
<a:To>urn:schemas-xmlsoap-org:ws:2005:04:discovery</a:To>
|
||
|
|
</s:Header>
|
||
|
|
<s:Body>
|
||
|
|
<d:Probe xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery">
|
||
|
|
<d:Types/>
|
||
|
|
<d:Scopes/>
|
||
|
|
</d:Probe>
|
||
|
|
</s:Body>
|
||
|
|
</s:Envelope>
|
||
|
|
```
|
||
|
|
|
||
|
|
**Parsing de la réponse** — extraction depuis le XML SOAP :
|
||
|
|
- `XAddrs` → URL du `device_service` (correction bug `0.0.0.0` → IP réelle)
|
||
|
|
- `Scopes` → `name`, `hardware` (ex: `onvif://www.onvif.org/name/DS-2CD2032`)
|
||
|
|
- Port extrait du XAddrs (ou 80 par défaut)
|
||
|
|
|
||
|
|
**Résultat**:
|
||
|
|
```csharp
|
||
|
|
public record OnvifProbeResult(
|
||
|
|
string DeviceServiceUrl, // ex: "http://192.168.1.100:8080/onvif/device_service"
|
||
|
|
int Port, // port du service
|
||
|
|
string? Name, // nom ONVIF du device
|
||
|
|
string? Hardware, // modèle matériel
|
||
|
|
string? Location); // emplacement (optionnel)
|
||
|
|
```
|
||
|
|
|
||
|
|
### 4.2. Détection HomeKit (mDNS/HAP)
|
||
|
|
|
||
|
|
**Recherche** : Interrogation multicast `_hap._tcp.local` (PTR) sur UDP 5353.
|
||
|
|
**Filtre** : Ne conserve que les réponses avec `ci=17` (camera) ou `ci=18` (doorbell).
|
||
|
|
|
||
|
|
**Parsing** des enregistrements TXT :
|
||
|
|
|
||
|
|
| Clé TXT | Champ | Exemple |
|
||
|
|
|---------|-------|---------|
|
||
|
|
| `ci` | Category | `17` (camera), `18` (doorbell) |
|
||
|
|
| `id` | Device ID | `90:8C:0F:F2:EC:F3` |
|
||
|
|
| `md` | Model | `HomeKit Camera v2` |
|
||
|
|
| `sf` | Status Flags | `0` (non paired), `1` (paired) |
|
||
|
|
| `s#` | SRV port | `51826` ou dynamique |
|
||
|
|
|
||
|
|
**Résultat**:
|
||
|
|
```csharp
|
||
|
|
public record HomeKitProbeResult(
|
||
|
|
string Name,
|
||
|
|
string DeviceId,
|
||
|
|
string Model,
|
||
|
|
string Category, // "camera" | "doorbell"
|
||
|
|
bool IsPaired,
|
||
|
|
int Port);
|
||
|
|
```
|
||
|
|
|
||
|
|
### 4.3. HTTP Probe
|
||
|
|
|
||
|
|
HEAD/GET sur les ports HTTP courants (80, 8080, 443, 81, 88, 8090) :
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
public record HttpProbeResult(
|
||
|
|
int Port,
|
||
|
|
int StatusCode,
|
||
|
|
string? ServerHeader, // ex: "Hikvision-Webs", "DVRDVS-Webs"
|
||
|
|
bool SupportsDigestAuth);
|
||
|
|
```
|
||
|
|
|
||
|
|
Le `Server` header identifie le fabricant : `Hikvision-Webs` = Hikvision,
|
||
|
|
`DVRDVS-Webs` = Dahua, `Kguard` = Kguard, etc.
|
||
|
|
|
||
|
|
### 4.4. ARP + OUI Lookup
|
||
|
|
|
||
|
|
Consultation de la table ARP locale (`/proc/net/arp` ou `ip neigh show`) :
|
||
|
|
```
|
||
|
|
192.168.1.100 dev eth0 lladdr c0:56:e3:aa:bb:cc REACHABLE
|
||
|
|
```
|
||
|
|
|
||
|
|
Extraction OUI (3 premiers octets) → lookup dans table SQLite intégrée :
|
||
|
|
- `C0:56:E3` → `Hikvision`
|
||
|
|
- `00:23:6A` → `Hikvision`
|
||
|
|
- `3C:08:F6` → `Dahua`
|
||
|
|
- `AC:CC:8E` → `Dahua`
|
||
|
|
- `00:12:1B` → `ACTi`
|
||
|
|
- `F4:08:8C` → `Reolink`
|
||
|
|
|
||
|
|
**Résultat**:
|
||
|
|
```csharp
|
||
|
|
public record ArpProbeResult(
|
||
|
|
string MacAddress,
|
||
|
|
string? Vendor);
|
||
|
|
```
|
||
|
|
|
||
|
|
### 4.5. Port Scan Ciblé
|
||
|
|
|
||
|
|
Scan de 17 ports connus des caméras, en parallèle (20 workers, 100ms timeout par port) :
|
||
|
|
|
||
|
|
| Port | Protocole | Usage typique |
|
||
|
|
|------|-----------|---------------|
|
||
|
|
| 554 | RTSP | Flux vidéo standard |
|
||
|
|
| 80 | HTTP | Interface web, MJPEG, API ONVIF |
|
||
|
|
| 443 | HTTPS | Chiffré |
|
||
|
|
| 8080 | HTTP | Alternative, API ONVIF |
|
||
|
|
| 34567 | DVRIP | Dahua/Sofia protocol |
|
||
|
|
| 1935 | RTMP | Streaming, NVR chinois |
|
||
|
|
| 3702 | UDP | WS-Discovery ONVIF |
|
||
|
|
| 8554 | RTSP | Alternative |
|
||
|
|
| 5544 | RTSP | Alternative |
|
||
|
|
| 10554 | RTSP | Alternative |
|
||
|
|
| 81 | HTTP | Alternative |
|
||
|
|
| 88 | HTTP | Alternative |
|
||
|
|
| 8090 | HTTP | Alternative |
|
||
|
|
| 8001 | HTTP | Alternative |
|
||
|
|
| 8081 | HTTP | Alternative |
|
||
|
|
| 7070 | HTTP | Alternative |
|
||
|
|
| 7447 | HTTP | Alternative |
|
||
|
|
| 51826 | TCP | HomeKit (HAP) |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 5. Recherche Base de Données (CameraDatabase)
|
||
|
|
|
||
|
|
### 5.1. Structure de la base
|
||
|
|
|
||
|
|
Base SQLite intégrée au Central (téléchargée depuis StrixCamDB ou maintenue localement) :
|
||
|
|
|
||
|
|
```sql
|
||
|
|
-- Marques
|
||
|
|
CREATE TABLE brands (
|
||
|
|
brand_id TEXT PRIMARY KEY, -- ex: "hikvision"
|
||
|
|
brand TEXT NOT NULL -- ex: "Hikvision"
|
||
|
|
);
|
||
|
|
|
||
|
|
-- Patterns d'URL par marque
|
||
|
|
CREATE TABLE streams (
|
||
|
|
id INTEGER PRIMARY KEY,
|
||
|
|
brand_id TEXT NOT NULL REFERENCES brands(brand_id),
|
||
|
|
url TEXT NOT NULL, -- pattern avec placeholders
|
||
|
|
protocol TEXT NOT NULL, -- "rtsp", "http", "rtmp", "dvrip", "bubble"
|
||
|
|
port INTEGER DEFAULT 0 -- 0 = port par défaut du protocole
|
||
|
|
);
|
||
|
|
|
||
|
|
-- Modèles spécifiques
|
||
|
|
CREATE TABLE stream_models (
|
||
|
|
stream_id INTEGER REFERENCES streams(id),
|
||
|
|
model TEXT NOT NULL -- ex: "DS-2CD2032"
|
||
|
|
);
|
||
|
|
|
||
|
|
-- Presets (collections curated)
|
||
|
|
CREATE TABLE presets (
|
||
|
|
preset_id TEXT PRIMARY KEY, -- ex: "onvif", "popular-rtsp"
|
||
|
|
name TEXT NOT NULL
|
||
|
|
);
|
||
|
|
|
||
|
|
CREATE TABLE preset_streams (
|
||
|
|
preset_id TEXT REFERENCES presets(preset_id),
|
||
|
|
url TEXT NOT NULL,
|
||
|
|
protocol TEXT NOT NULL,
|
||
|
|
port INTEGER DEFAULT 0
|
||
|
|
);
|
||
|
|
|
||
|
|
-- Table OUI pour lookup MAC → Fabricant
|
||
|
|
CREATE TABLE oui (
|
||
|
|
mac_prefix TEXT PRIMARY KEY, -- ex: "C056E3"
|
||
|
|
vendor TEXT NOT NULL
|
||
|
|
);
|
||
|
|
```
|
||
|
|
|
||
|
|
### 5.2. Types de résultats
|
||
|
|
|
||
|
|
| Type | ID | Description | Exemple |
|
||
|
|
|------|-----|-------------|---------|
|
||
|
|
| `preset` | `p:{preset_id}` | Collection de patterns (ex: "ONVIF standard") | `p:onvif-global` |
|
||
|
|
| `brand` | `b:{brand_id}` | Tous les patterns d'une marque | `b:hikvision` |
|
||
|
|
| `model` | `m:{brand_id}:{model}` | Patterns d'un modèle spécifique | `m:hikvision:DS-2CD2032` |
|
||
|
|
|
||
|
|
### 5.3. API Recherche
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
// Recherche textuelle (marque, modèle)
|
||
|
|
Task<SearchResult[]> SearchAsync(string query, CancellationToken ct);
|
||
|
|
|
||
|
|
// Construction des URL de flux à partir d'un ID
|
||
|
|
Task<StreamUrl[]> BuildStreamsAsync(StreamRequest request, CancellationToken ct);
|
||
|
|
```
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
public record StreamRequest(
|
||
|
|
string[] Ids, // IDs de recherche (ex: "b:hikvision", "p:onvif")
|
||
|
|
string Ip,
|
||
|
|
string? Username,
|
||
|
|
string? Password,
|
||
|
|
int Channel = 0,
|
||
|
|
int[]? PortFilter = null);
|
||
|
|
```
|
||
|
|
|
||
|
|
**Placeholders supportés** (substitution dans les patterns SQLite) :
|
||
|
|
|
||
|
|
| Placeholder | Remplacé par |
|
||
|
|
|---|---|
|
||
|
|
| `[CHANNEL]` / `[channel]` | Numéro de canal |
|
||
|
|
| `[USERNAME]` / `[user]` | Nom d'utilisateur (URL-encoded) |
|
||
|
|
| `[PASSWORD]` / `[pass]` / `[pwd]` | Mot de passe (URL-encoded) |
|
||
|
|
| `[IP]` / `[ip]` | Adresse IP |
|
||
|
|
| `[PORT]` / `[port]` | Port |
|
||
|
|
| `[WIDTH]` / `[width]` | `640` (défaut) |
|
||
|
|
| `[HEIGHT]` / `[height]` | `480` (défaut) |
|
||
|
|
| `[AUTH]` / `[auth]` | Basic auth base64 |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 6. Test de Flux (StreamTester)
|
||
|
|
|
||
|
|
### 6.1. Architecture
|
||
|
|
|
||
|
|
20 workers parallèles. Chaque worker :
|
||
|
|
|
||
|
|
1. Reçoit une URL de flux (pool de workers)
|
||
|
|
2. Sélectionne le handler selon le protocole
|
||
|
|
3. Se connecte et négocie (timeout 10s)
|
||
|
|
4. Capture une image clé (keyframe) → screenshot JPEG
|
||
|
|
5. Extrait codecs, résolution, latence
|
||
|
|
6. Retourne le résultat
|
||
|
|
|
||
|
|
### 6.2. Protocoles supportés
|
||
|
|
|
||
|
|
| Protocole | Handler | Lib .NET | Exemple d'URL |
|
||
|
|
|-----------|---------|----------|---------------|
|
||
|
|
| **RTSP** | `RtspHandler` | `LibVLC` / `FFmpeg.Autogen` / `RtspClient` | `rtsp://admin:pass@192.168.1.100/Streaming/Channels/101` |
|
||
|
|
| **HTTP MJPEG** | `HttpMjpegHandler` | `HttpClient` + `ImageSharp` | `http://admin:pass@192.168.1.100/ISAPI/Streaming/channels/101/picture` |
|
||
|
|
| **HTTP JPEG** | `HttpJpegHandler` | `HttpClient` | `http://admin:pass@192.168.1.100/ snapshot.jpg` |
|
||
|
|
| **ONVIF** | `OnvifProfileHandler` | `Onvif.Client` (NuGet) | `onvif://admin:pass@192.168.1.100` |
|
||
|
|
| **DVRIP** | `DvripHandler` | Implémentation TCP/Sofia | `dvrip://admin:pass@192.168.1.100:34567` |
|
||
|
|
| **RTMP** | `RtmpHandler` | `FFmpeg.Autogen` | `rtmp://admin:pass@192.168.1.100:1935/live` |
|
||
|
|
| **HomeKit** | `HomeKitHandler` | HAP lib | `homekit://...?device_id=...&pin=...` |
|
||
|
|
|
||
|
|
### 6.3. Résultat de test
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
public record StreamTestResult(
|
||
|
|
string SourceUrl, // URL testée (credentials masqués dans les logs)
|
||
|
|
string[] Codecs, // eg. ["H264", "PCMA"]
|
||
|
|
int Width, // Résolution largeur
|
||
|
|
int Height, // Résolution hauteur
|
||
|
|
long LatencyMs, // Latence de connexion
|
||
|
|
byte[]? ScreenshotJpeg, // Screenshot JPEG (optionnel)
|
||
|
|
bool IsAlive); // Flux fonctionnel
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 7. Modèle de Données — Entités Domain
|
||
|
|
|
||
|
|
### 7.1. Nouveaux enums
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
// Dans Heimdall.Domain/Enums/
|
||
|
|
|
||
|
|
/// <summary>Méthode par laquelle la caméra a été détectée.</summary>
|
||
|
|
public enum CameraDiscoveryMethod
|
||
|
|
{
|
||
|
|
Manual = 0, // Saisie manuelle (actuel)
|
||
|
|
OnvifWsDiscovery = 1, // WS-Discovery ONVIF
|
||
|
|
MdnsHomeKit = 2, // mDNS HomeKit
|
||
|
|
NetworkScan = 3, // Scan réseau générique
|
||
|
|
HttpProbe = 4, // Détection par en-tête HTTP
|
||
|
|
ArpProbe = 5, // ARP + OUI
|
||
|
|
Imported = 6 // Import depuis fichier
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>Protocoles de flux supportés.</summary>
|
||
|
|
public enum StreamProtocol
|
||
|
|
{
|
||
|
|
Rtsp,
|
||
|
|
Rtsps,
|
||
|
|
Http,
|
||
|
|
Https,
|
||
|
|
Rtmp,
|
||
|
|
Rtmps,
|
||
|
|
Dvrip,
|
||
|
|
Bubble,
|
||
|
|
HomeKit
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>Type de caméra détecté.</summary>
|
||
|
|
public enum DetectedCameraType
|
||
|
|
{
|
||
|
|
Standard, // Caméra IP standard
|
||
|
|
HomeKit, // Apple HomeKit
|
||
|
|
Nvr, // NVR (multiple canaux)
|
||
|
|
Doorbell, // Sonnette vidéo
|
||
|
|
Unknown
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### 7.2. Entité Camera — Modifications
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
// Ajouts à Camera.cs existant
|
||
|
|
|
||
|
|
// Méthode de découverte
|
||
|
|
public CameraDiscoveryMethod DiscoveryMethod { get; private set; }
|
||
|
|
public DetectedCameraType DetectedType { get; private set; }
|
||
|
|
|
||
|
|
// MAC + Fabricant (ARP/OUI)
|
||
|
|
public string? MacAddress { get; private set; }
|
||
|
|
|
||
|
|
// Protocoles supportés (flags)
|
||
|
|
public StreamProtocol SupportedProtocols { get; private set; }
|
||
|
|
|
||
|
|
// Réseau
|
||
|
|
public string? IpAddress { get; private set; } // IP fixe si statique
|
||
|
|
public int? RtspPort { get; private set; }
|
||
|
|
public int? HttpPort { get; private set; }
|
||
|
|
public int? OnvifPort { get; private set; }
|
||
|
|
|
||
|
|
// Dernière découverte
|
||
|
|
public DateTime? LastDiscoveredAt { get; private set; }
|
||
|
|
|
||
|
|
// Dernier test de flux
|
||
|
|
public DateTime? LastStreamTestAt { get; private set; }
|
||
|
|
public string? LastTestedCodecs { get; private set; } // JSON array
|
||
|
|
public int? LastTestedWidth { get; private set; }
|
||
|
|
public int? LastTestedHeight { get; private set; }
|
||
|
|
public long? LastTestedLatencyMs { get; private set; }
|
||
|
|
|
||
|
|
// Nouveaux sous-flux
|
||
|
|
public string? SubRtspUrl { get; private set; } // Flux secondaire (détection)
|
||
|
|
|
||
|
|
// Méthodes
|
||
|
|
public void SetDiscoveryInfo(
|
||
|
|
CameraDiscoveryMethod method,
|
||
|
|
DetectedCameraType type,
|
||
|
|
string? macAddress,
|
||
|
|
string ipAddress);
|
||
|
|
|
||
|
|
public void SetStreamTestResult(
|
||
|
|
string? subRtspUrl,
|
||
|
|
string codecsJson,
|
||
|
|
int width,
|
||
|
|
int height,
|
||
|
|
long latencyMs);
|
||
|
|
|
||
|
|
public void SetPorts(
|
||
|
|
int? rtspPort,
|
||
|
|
int? httpPort,
|
||
|
|
int? onvifPort);
|
||
|
|
```
|
||
|
|
|
||
|
|
### 7.3. Nouvelles entités
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
/// <summary>
|
||
|
|
/// Résultat de probe — stocké temporairement pour le pipeline de découverte.
|
||
|
|
/// </summary>
|
||
|
|
public class CameraDiscoveryResult : Entity<Guid>
|
||
|
|
{
|
||
|
|
public Guid SiteId { get; private set; }
|
||
|
|
public string IpAddress { get; private set; }
|
||
|
|
public string? MacAddress { get; private set; }
|
||
|
|
public string? Vendor { get; private set; }
|
||
|
|
public string? Hostname { get; private set; }
|
||
|
|
public DetectedCameraType DetectedType { get; private set; }
|
||
|
|
public CameraDiscoveryMethod DiscoveryMethod { get; private set; }
|
||
|
|
|
||
|
|
// Résultats des probes
|
||
|
|
public int[] OpenPorts { get; private set; } = [];
|
||
|
|
public string? OnvifDeviceServiceUrl { get; private set; }
|
||
|
|
public string? OnvifName { get; private set; }
|
||
|
|
public string? OnvifHardware { get; private set; }
|
||
|
|
public string? HttpServerHeader { get; private set; }
|
||
|
|
public int? HttpStatusCode { get; private set; }
|
||
|
|
public bool IsReachable { get; private set; }
|
||
|
|
|
||
|
|
// Timestamp
|
||
|
|
public DateTime ProbedAt { get; private set; } = DateTime.UtcNow;
|
||
|
|
|
||
|
|
// Navigation
|
||
|
|
public Site Site { get; private set; } = null!;
|
||
|
|
public ICollection<DiscoveredStream> DiscoveredStreams { get; private set; } = [];
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Flux vidéo découvert lors du test.
|
||
|
|
/// </summary>
|
||
|
|
public class DiscoveredStream
|
||
|
|
{
|
||
|
|
public Guid Id { get; private set; }
|
||
|
|
public Guid DiscoveryResultId { get; private set; }
|
||
|
|
public string Url { get; private set; }
|
||
|
|
public StreamProtocol Protocol { get; private set; }
|
||
|
|
public string[] Codecs { get; private set; } = [];
|
||
|
|
public int Width { get; private set; }
|
||
|
|
public int Height { get; private set; }
|
||
|
|
public long LatencyMs { get; private set; }
|
||
|
|
public bool IsMainStream { get; private set; }
|
||
|
|
public bool IsAlive { get; private set; }
|
||
|
|
|
||
|
|
public CameraDiscoveryResult DiscoveryResult { get; private set; } = null!;
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 8. API REST — Endpoints de Découverte
|
||
|
|
|
||
|
|
### 8.1. Probe (découverte initiale)
|
||
|
|
|
||
|
|
```
|
||
|
|
POST /api/discovery/probe
|
||
|
|
```
|
||
|
|
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"siteId": "guid",
|
||
|
|
"ip": "192.168.1.100",
|
||
|
|
"subnetCidr": "192.168.1.0/24"
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
**Sans IP** → scan du sous-réseau entier :
|
||
|
|
```
|
||
|
|
POST /api/discovery/scan
|
||
|
|
```
|
||
|
|
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"siteId": "guid",
|
||
|
|
"subnetCidr": "192.168.1.0/24",
|
||
|
|
"timeoutMs": 30000
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### 8.2. Search database
|
||
|
|
|
||
|
|
```
|
||
|
|
GET /api/discovery/search?q=hikvision
|
||
|
|
```
|
||
|
|
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"results": [
|
||
|
|
{ "type": "brand", "id": "b:hikvision", "name": "Hikvision" },
|
||
|
|
{ "type": "model", "id": "m:hikvision:DS-2CD2032", "name": "Hikvision: DS-2CD2032" }
|
||
|
|
]
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### 8.3. Build streams
|
||
|
|
|
||
|
|
```
|
||
|
|
POST /api/discovery/streams
|
||
|
|
```
|
||
|
|
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"ids": ["b:hikvision", "p:onvif"],
|
||
|
|
"ip": "192.168.1.100",
|
||
|
|
"username": "admin",
|
||
|
|
"password": "pass",
|
||
|
|
"channel": 0
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### 8.4. Test streams
|
||
|
|
|
||
|
|
```
|
||
|
|
POST /api/discovery/test
|
||
|
|
```
|
||
|
|
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"sourceId": "guid",
|
||
|
|
"streams": [
|
||
|
|
"rtsp://admin:pass@192.168.1.100/Streaming/Channels/101",
|
||
|
|
"rtsp://admin:pass@192.168.1.100/Streaming/Channels/102"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
**Réponse**:
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"sessionId": "uuid",
|
||
|
|
"status": "running",
|
||
|
|
"total": 2,
|
||
|
|
"tested": 0
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
**Polling** → `GET /api/discovery/test/{sessionId}`
|
||
|
|
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"sessionId": "uuid",
|
||
|
|
"status": "done",
|
||
|
|
"total": 2,
|
||
|
|
"tested": 2,
|
||
|
|
"alive": 2,
|
||
|
|
"results": [
|
||
|
|
{
|
||
|
|
"source": "rtsp://admin:***@192.168.1.100/Streaming/Channels/101",
|
||
|
|
"codecs": ["H264", "PCMA"],
|
||
|
|
"width": 1920,
|
||
|
|
"height": 1080,
|
||
|
|
"latencyMs": 45,
|
||
|
|
"screenshotUrl": "/api/discovery/test/{sessionId}/screenshot/0"
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### 8.5. Add discovered camera
|
||
|
|
|
||
|
|
```
|
||
|
|
POST /api/discovery/confirm
|
||
|
|
```
|
||
|
|
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"siteId": "guid",
|
||
|
|
"name": "Entrée principale",
|
||
|
|
"discoveryResultId": "guid",
|
||
|
|
"mainStreamUrl": "rtsp://admin:pass@192.168.1.100/Streaming/Channels/101",
|
||
|
|
"subStreamUrl": "rtsp://admin:pass@192.168.1.100/Streaming/Channels/102",
|
||
|
|
"username": "admin",
|
||
|
|
"password": "encrypted",
|
||
|
|
"detectionProfile": { ... }
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 9. Interfaces Application
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
/// <summary>Service de découverte réseau pour les caméras.</summary>
|
||
|
|
public interface ICameraDiscoveryService
|
||
|
|
{
|
||
|
|
// Probe une IP unique → résultats complets
|
||
|
|
Task<CameraDiscoveryResult> ProbeIpAsync(
|
||
|
|
Guid siteId, string ip, CancellationToken ct);
|
||
|
|
|
||
|
|
// Scan d'un sous-réseau → liste de résultats
|
||
|
|
Task<IReadOnlyList<CameraDiscoveryResult>> ScanSubnetAsync(
|
||
|
|
Guid siteId, string cidr, int timeoutMs, CancellationToken ct,
|
||
|
|
IProgress<ScanProgress>? progress = null);
|
||
|
|
|
||
|
|
// Recherche dans la base de caméras
|
||
|
|
Task<SearchResult[]> SearchDatabaseAsync(string query, CancellationToken ct);
|
||
|
|
|
||
|
|
// Construction des URL de flux
|
||
|
|
Task<string[]> BuildStreamUrlsAsync(
|
||
|
|
StreamRequest request, CancellationToken ct);
|
||
|
|
|
||
|
|
// Test de flux
|
||
|
|
Task<StreamTestSession> TestStreamsAsync(
|
||
|
|
Guid sourceId, string[] urls, CancellationToken ct);
|
||
|
|
|
||
|
|
// Confirmation et création de la caméra
|
||
|
|
Task<CameraResponse> ConfirmDiscoveryAsync(
|
||
|
|
ConfirmDiscoveryRequest request, CancellationToken ct);
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>Test de flux en temps réel.</summary>
|
||
|
|
public interface IStreamTesterService
|
||
|
|
{
|
||
|
|
Task<StreamTestSession> CreateSessionAsync(
|
||
|
|
string[] urls, CancellationToken ct);
|
||
|
|
|
||
|
|
Task<StreamTestSession?> GetSessionAsync(
|
||
|
|
Guid sessionId, CancellationToken ct);
|
||
|
|
|
||
|
|
Task<byte[]?> GetScreenshotAsync(
|
||
|
|
Guid sessionId, int index, CancellationToken ct);
|
||
|
|
|
||
|
|
Task CancelSessionAsync(Guid sessionId, CancellationToken ct);
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 10. Services Infrastructure
|
||
|
|
|
||
|
|
### 10.1. NetworkScannerService
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
public class NetworkScannerService : INetworkScannerService
|
||
|
|
{
|
||
|
|
// ARP table lookup (multi-plateforme)
|
||
|
|
Task<ArpResult?> LookupArpAsync(string ip, CancellationToken ct);
|
||
|
|
|
||
|
|
// mDNS HomeKit query
|
||
|
|
Task<MdnsResult?> QueryMdnsAsync(string ip, CancellationToken ct);
|
||
|
|
|
||
|
|
// Ping ICMP
|
||
|
|
Task<bool> PingAsync(string ip, int timeoutMs, CancellationToken ct);
|
||
|
|
|
||
|
|
// Port scan parallélisé
|
||
|
|
Task<int[]> ScanPortsAsync(string ip, int[] ports, int timeoutMs, CancellationToken ct);
|
||
|
|
|
||
|
|
// Sweep sous-réseau
|
||
|
|
IAsyncEnumerable<ScanProgress> SweepSubnetAsync(
|
||
|
|
string cidr, int timeoutMs, CancellationToken ct);
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### 10.2. OnvifProbeService
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
public class OnvifProbeService : IOnvifProbeService
|
||
|
|
{
|
||
|
|
// WS-Discovery unicast probe
|
||
|
|
Task<OnvifProbeResult?> ProbeDeviceAsync(string ip, int timeoutMs, CancellationToken ct);
|
||
|
|
|
||
|
|
// Résolution des profils ONVIF
|
||
|
|
Task<OnvifProfile[]> GetProfilesAsync(string deviceServiceUrl,
|
||
|
|
string? username, string? password, CancellationToken ct);
|
||
|
|
|
||
|
|
// Obtention de l'URI RTSP pour un profil
|
||
|
|
Task<string?> GetStreamUriAsync(string deviceServiceUrl,
|
||
|
|
string profileToken, string? username, string? password, CancellationToken ct);
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### 10.3. StreamTesterService
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
public class StreamTesterService : IStreamTesterService
|
||
|
|
{
|
||
|
|
// Pool de workers parallèles (configurable)
|
||
|
|
// Support: RTSP, HTTP MJPEG/JPEG, ONVIF, RTMP, DVRIP
|
||
|
|
// Capture de screenshot via FFmpeg ou implémentation pure .NET
|
||
|
|
// Timeout par flux : 10s
|
||
|
|
// Session TTL : 30min après completion
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### 10.4. OnvifClient (implémentation SOAP/XML)
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
public class OnvifClient
|
||
|
|
{
|
||
|
|
// GetCapabilities()
|
||
|
|
// GetDeviceInformation() → manufacturer, model, firmware, serial
|
||
|
|
// GetProfiles() → liste des profils media
|
||
|
|
// GetStreamUri(token) → URI RTSP pour un profil
|
||
|
|
// GetServices() → services ONVIF disponibles
|
||
|
|
// SystemReboot() → si autorisé
|
||
|
|
// GetHostname() → nom d'hôte configuré
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
**NuGet candidates**:
|
||
|
|
- `Onvif.Client` (community) — basique
|
||
|
|
- `MJPEGStreamDecoder` — décodage MJPEG (HTTP)
|
||
|
|
- `FFmpeg.Autogen` — capture d'écran H264/H265 → JPEG
|
||
|
|
- `SharpPcap` ou `PacketDotNet` — ARP (Linux `CAP_NET_RAW`)
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 11. Intégration Workers (Hangfire)
|
||
|
|
|
||
|
|
### 11.1. NetworkScanJob
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
/// <summary>Job Hangfire planifié — scanne les sous-réseaux des sites actifs.</summary>
|
||
|
|
public class NetworkScanJob : IJob
|
||
|
|
{
|
||
|
|
// Planifié toutes les 6h par site (cron)
|
||
|
|
// Découvre les nouvelles caméras
|
||
|
|
// Met à jour le statut des caméras existantes (Online/Offline)
|
||
|
|
// Envoie notification SignalR si nouveaux devices
|
||
|
|
|
||
|
|
public async Task ExecuteAsync(CancellationToken ct)
|
||
|
|
{
|
||
|
|
var sites = await _db.Sites
|
||
|
|
.Where(s => s.IsActive && !s.IsDeleted)
|
||
|
|
.ToListAsync(ct);
|
||
|
|
|
||
|
|
foreach (var site in sites.Where(s => s.NetworkCidr != null))
|
||
|
|
{
|
||
|
|
var discovered = await _discoveryService.ScanSubnetAsync(
|
||
|
|
site.Id, site.NetworkCidr, 60000, ct);
|
||
|
|
|
||
|
|
foreach (var result in discovered.Where(r => r.IsReachable))
|
||
|
|
{
|
||
|
|
await _processor.ProcessDiscoveryResultAsync(result, ct);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### 11.2. CameraHealthCheckJob
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
/// <summary>Job Hangfire — vérifie l'état des flux toutes les 5min.</summary>
|
||
|
|
public class CameraHealthCheckJob : IJob
|
||
|
|
{
|
||
|
|
// Pour chaque caméra Online : ping + RTSP describe (timeout 3s)
|
||
|
|
// Si échec → marque Offline, notifie
|
||
|
|
// Si succès après Offline → marque Online, notifie
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### 11.3. StreamTestJob
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
/// <summary>Job Hangfire — test périodique des flux (codecs, résolution).</summary>
|
||
|
|
public class StreamTestJob : IJob
|
||
|
|
{
|
||
|
|
// Planifié quotidiennement
|
||
|
|
// Re-test des flux découverts automatiquement
|
||
|
|
// Met à jour les métriques (latence, résolution, codecs)
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 12. Nouveaux Flags Camera (Enum)
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
[Flags]
|
||
|
|
public enum CameraCapability
|
||
|
|
{
|
||
|
|
None = 0,
|
||
|
|
RtspStreaming = 1 << 0, // RTSP stream
|
||
|
|
HttpMjpeg = 1 << 1, // MJPEG over HTTP
|
||
|
|
HttpSnapshot = 1 << 2, // JPEG snapshot
|
||
|
|
Onvif = 1 << 3, // ONVIF protocol
|
||
|
|
OnvifPtz = 1 << 4, // PTZ over ONVIF
|
||
|
|
OnvifAudioIn = 1 << 5, // Audio input
|
||
|
|
OnvifAudioOut = 1 << 6, // Audio output
|
||
|
|
HomeKit = 1 << 7, // Apple HomeKit
|
||
|
|
Dvrip = 1 << 8, // Dahua DVRIP/Sofia
|
||
|
|
Rtmp = 1 << 9, // RTMP streaming
|
||
|
|
SubStream = 1 << 10, // Second flux (sous-flux)
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 13. DTOs Application
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
// Request/Response DTOs à ajouter
|
||
|
|
|
||
|
|
public record ProbeRequest(Guid SiteId, string Ip);
|
||
|
|
public record ScanRequest(Guid SiteId, string SubnetCidr, int TimeoutMs = 30000);
|
||
|
|
|
||
|
|
public record ProbeResponse(
|
||
|
|
string Ip,
|
||
|
|
bool IsReachable,
|
||
|
|
DetectedCameraType CameraType,
|
||
|
|
ArpInfo? Arp,
|
||
|
|
int[] OpenPorts,
|
||
|
|
OnvifInfo? Onvif,
|
||
|
|
HttpProbeInfo? Http,
|
||
|
|
HomeKitInfo? HomeKit,
|
||
|
|
string[]? MatchedBrands);
|
||
|
|
|
||
|
|
public record ArpInfo(string MacAddress, string? Vendor);
|
||
|
|
|
||
|
|
public record OnvifInfo(
|
||
|
|
string DeviceServiceUrl,
|
||
|
|
int Port,
|
||
|
|
string? Name,
|
||
|
|
string? Hardware,
|
||
|
|
string? Location);
|
||
|
|
|
||
|
|
public record HttpProbeInfo(int Port, int StatusCode, string? ServerHeader);
|
||
|
|
|
||
|
|
public record HomeKitInfo(
|
||
|
|
string Name, string DeviceId, string Model,
|
||
|
|
string Category, bool IsPaired, int Port);
|
||
|
|
|
||
|
|
public record StreamTestSession(
|
||
|
|
Guid SessionId,
|
||
|
|
string Status, // "running" | "done"
|
||
|
|
int Total,
|
||
|
|
int Tested,
|
||
|
|
int Alive,
|
||
|
|
StreamTestResult[] Results);
|
||
|
|
|
||
|
|
public record ConfirmDiscoveryRequest(
|
||
|
|
Guid SiteId,
|
||
|
|
string Name,
|
||
|
|
Guid DiscoveryResultId,
|
||
|
|
string MainStreamUrl,
|
||
|
|
string? SubStreamUrl,
|
||
|
|
string? Username,
|
||
|
|
string? Password,
|
||
|
|
CameraDetectionProfile? DetectionProfile);
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 14. Sécurité
|
||
|
|
|
||
|
|
| Risque | Mitigation |
|
||
|
|
|--------|-----------|
|
||
|
|
| **Scan réseau non autorisé** | Limit aux sous-réseaux du Site ; nécessite rôle `Admin` ou `Supervisor` |
|
||
|
|
| **Credentials en clair dans les logs** | `ICredentialProtector` appliqué systématiquement ; masquage `****` dans logs |
|
||
|
|
| **WS-Discovery flood** | Rate limiting (10 probes/min/IP) ; timeout 100ms par requête |
|
||
|
|
| **Données OUI/StrixCamDB** | Base SQLite intégrée, pas d'appels réseau pour la résolution |
|
||
|
|
| **mDNS spoofing** | Validation de l'IP source ; ne fait pas confiance aux réponses non sollicitées |
|
||
|
|
| **RTSP brute force** | 3 tentatives max par IP + credentials ; cooldown 60s |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 15. Priorisation & Roadmap
|
||
|
|
|
||
|
|
### Phase 1 — Probe & Découverte (🔴 P1)
|
||
|
|
- [ ] `NetworkScannerService` — ARP lookup, port scan, ping
|
||
|
|
- [ ] `OnvifProbeService` — WS-Discovery UDP
|
||
|
|
- [ ] `HttpProbeService` — détection par en-têtes HTTP
|
||
|
|
- [ ] Entités `CameraDiscoveryResult`, `DiscoveredStream`
|
||
|
|
- [ ] API `POST /api/discovery/probe` + `POST /api/discovery/scan`
|
||
|
|
- [ ] Nouveaux champs Camera (DiscoveryMethod, IpAddress, ports, MAC, capabilities)
|
||
|
|
- [ ] CameraCapability flags enum
|
||
|
|
|
||
|
|
### Phase 2 — Base de Données Caméras (🟠 P2)
|
||
|
|
- [ ] Intégration de la base SQLite StrixCamDB (3600+ marques)
|
||
|
|
- [ ] Service de recherche `ICameraSearchService`
|
||
|
|
- [ ] API `GET /api/discovery/search`
|
||
|
|
- [ ] API `POST /api/discovery/streams` (construction URL)
|
||
|
|
- [ ] Substitution de placeholders (CHANNEL, USERNAME, IP, etc.)
|
||
|
|
|
||
|
|
### Phase 3 — Test de Flux (🟠 P2)
|
||
|
|
- [ ] `StreamTesterService` — workers parallèles
|
||
|
|
- [ ] Handlers RTSP, HTTP MJPEG, HTTP snapshot
|
||
|
|
- [ ] Capture d'écran via FFmpeg
|
||
|
|
- [ ] API `POST /api/discovery/test` + polling
|
||
|
|
- [ ] API `GET /api/discovery/test/{id}/screenshot/{index}`
|
||
|
|
|
||
|
|
### Phase 4 — Intégration Hangfire (🟡 P3)
|
||
|
|
- [ ] `NetworkScanJob` — scan planifié des sites
|
||
|
|
- [ ] `CameraHealthCheckJob` — heartbeat des flux
|
||
|
|
- [ ] `StreamTestJob` — re-test périodique
|
||
|
|
- [ ] Notification SignalR vers UI Blazor
|
||
|
|
|
||
|
|
### Phase 5 — Fonctionnalités Avancées (🟡 P3)
|
||
|
|
- [ ] ONVIF profile resolution → RTSP URI extraction
|
||
|
|
- [ ] HomeKit pairing (`POST /api/discovery/homekit/pair`)
|
||
|
|
- [ ] DVRIP/Sofia protocol support
|
||
|
|
- [ ] ONVIF PTZ capabilities detection
|
||
|
|
- [ ] Export config Frigate/go2rtc
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 16. Références
|
||
|
|
|
||
|
|
- [Strix](https://github.com/eduard256/Strix) — Moteur de découverte Go (MIT)
|
||
|
|
- [ONVIF Feature Discovery Spec](https://www.onvif.org/wp-content/uploads/2016/12/ONVIF_Feature_Discovery_Specification_16.07.pdf)
|
||
|
|
- [ONVIF Core Spec](https://www.onvif.org/specs/core/ONVIF-Core-Specification-v221.pdf) — GetProfiles, GetStreamUri
|
||
|
|
- [go2rtc](https://github.com/AlexxIT/go2rtc) — Lib de streaming multi-protocole
|
||
|
|
- [StrixCamDB](https://github.com/eduard256/StrixCamDB) — Base SQLite 3600+ marques, 100K+ patterns
|
||
|
|
- [Strix HTTP API](https://github.com/eduard256/Strix/blob/main/DEVELOPERS.md) — Référence API REST
|
||
|
|
- [HAP Spec](https://developer.apple.com/homekit/) — HomeKit Accessory Protocol (mDNS)
|
||
|
|
- [RFC 6762](https://datatracker.ietf.org/doc/html/rfc6762) — Multicast DNS
|
||
|
|
- [OUI Database](https://standards-oui.ieee.org/) — IEEE Organizationally Unique Identifier
|