|
|
|
|
@@ -1,9 +1,43 @@
|
|
|
|
|
# Feature Specification: Geutebruck Video Surveillance API
|
|
|
|
|
# Feature Specification: Geutebruck Unified Video Surveillance API
|
|
|
|
|
|
|
|
|
|
**Feature Branch**: `001-surveillance-api`
|
|
|
|
|
**Created**: 2025-11-13
|
|
|
|
|
**Status**: Draft
|
|
|
|
|
**Input**: User description: "Complete RESTful API for Geutebruck GeViScope/GeViSoft video surveillance system control"
|
|
|
|
|
**Updated**: 2025-12-16 (Configuration Management + Critical Bug Fixes)
|
|
|
|
|
**Status**: In Progress
|
|
|
|
|
**Input**: "Complete RESTful API for Geutebruck GeViSoft/GeViScope unified video surveillance system control with multi-instance support"
|
|
|
|
|
|
|
|
|
|
## Architecture Overview
|
|
|
|
|
|
|
|
|
|
This API provides a **unified interface** to control both GeViSoft (management platform) and multiple GeViScope instances (video servers):
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
Geutebruck Unified API
|
|
|
|
|
│
|
|
|
|
|
├── GeViSoft Layer (Management)
|
|
|
|
|
│ └── GeViServer Connection
|
|
|
|
|
│ ├── System-wide alarm management
|
|
|
|
|
│ ├── Event coordination across GeViScope instances
|
|
|
|
|
│ ├── Action mapping and automation
|
|
|
|
|
│ └── Cross-system orchestration
|
|
|
|
|
│
|
|
|
|
|
└── GeViScope Layer (Video Operations)
|
|
|
|
|
├── GeViScope Instance "main" (GSCServer - localhost)
|
|
|
|
|
│ ├── Cameras: 101027-101041
|
|
|
|
|
│ └── Monitors: 1-256
|
|
|
|
|
├── GeViScope Instance "parking" (GSCServer - 192.168.1.100)
|
|
|
|
|
│ ├── Cameras: 201001-201020
|
|
|
|
|
│ └── Monitors: 1-64
|
|
|
|
|
└── GeViScope Instance "warehouse" (GSCServer - 192.168.1.101)
|
|
|
|
|
├── Cameras: 301001-301050
|
|
|
|
|
└── Monitors: 1-128
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**Key Concepts:**
|
|
|
|
|
- **GeViSoft** = Management platform controlling multiple GeViScope instances (1 per system)
|
|
|
|
|
- **GeViScope** = Video server instances handling cameras, monitors, video routing (N per system)
|
|
|
|
|
- **Monitors (Video Outputs)** = Logical display channels (NOT physical displays, require viewer apps)
|
|
|
|
|
- **CrossSwitch** = Video routing command (camera → monitor at server level)
|
|
|
|
|
- **GSCView** = Viewer application that displays video outputs
|
|
|
|
|
|
|
|
|
|
## User Scenarios & Testing *(mandatory)*
|
|
|
|
|
|
|
|
|
|
@@ -24,7 +58,41 @@ As a developer integrating a custom surveillance application, I need to authenti
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### User Story 2 - Live Video Stream Access (Priority: P1)
|
|
|
|
|
### User Story 2 - Multi-Instance GeViScope Management (Priority: P1)
|
|
|
|
|
|
|
|
|
|
As a system administrator, I need to manage multiple GeViScope instances through a single API so that I can control video operations across different locations and servers.
|
|
|
|
|
|
|
|
|
|
**Why this priority**: Multi-instance support is core to the unified architecture. Without it, the API can only control one GeViScope server, limiting scalability.
|
|
|
|
|
|
|
|
|
|
**Independent Test**: Can be fully tested by configuring multiple GeViScope instances, querying available instances, and executing operations on specific instances.
|
|
|
|
|
|
|
|
|
|
**Acceptance Scenarios**:
|
|
|
|
|
|
|
|
|
|
1. **Given** three GeViScope instances configured (main, parking, warehouse), **When** a user requests `/api/v1/geviscope/instances`, **Then** they receive a list of all instances with status, camera count, and connection state
|
|
|
|
|
2. **Given** operations targeting a specific instance, **When** a user calls `/api/v1/geviscope/parking/cameras`, **Then** they receive only cameras from the parking instance
|
|
|
|
|
3. **Given** a default instance configured, **When** a user calls `/api/v1/cameras` without instance ID, **Then** the request routes to the default instance
|
|
|
|
|
4. **Given** one GeViScope instance is offline, **When** operations target that instance, **Then** the API returns clear error messages while other instances remain operational
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### User Story 3 - Video CrossSwitch and Monitor Control (Priority: P1)
|
|
|
|
|
|
|
|
|
|
As a security operator, I need to route camera video feeds to specific monitors via CrossSwitch commands so that I can dynamically control what video appears on display systems.
|
|
|
|
|
|
|
|
|
|
**Why this priority**: CrossSwitch is the core video routing mechanism in GeViScope systems. Without it, operators cannot control video distribution to displays.
|
|
|
|
|
|
|
|
|
|
**Independent Test**: Can be fully tested by executing CrossSwitch commands to route cameras to monitors, verifying routes in the routing table, and clearing monitor assignments.
|
|
|
|
|
|
|
|
|
|
**Acceptance Scenarios**:
|
|
|
|
|
|
|
|
|
|
1. **Given** camera 101038 and monitor 1 exist, **When** an operator sends `POST /api/v1/crossswitch` with `{camera_id: 101038, monitor_id: 1}`, **Then** the camera video is routed to monitor 1 at the server level and a route record is created
|
|
|
|
|
2. **Given** an active route exists, **When** an operator queries `/api/v1/crossswitch/routing`, **Then** they receive a list of all active camera→monitor routes with timestamps and user who created them
|
|
|
|
|
3. **Given** a monitor displaying video, **When** an operator sends `DELETE /api/v1/crossswitch/{monitor_id}`, **Then** the monitor is cleared and the route is marked inactive
|
|
|
|
|
4. **Given** multiple monitors in a monitor group, **When** an alarm triggers CrossSwitch actions, **Then** all designated cameras are routed to their assigned monitors automatically
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### User Story 4 - Live Video Stream Access (Priority: P1)
|
|
|
|
|
|
|
|
|
|
As a security operator, I need to view live video streams from surveillance cameras through the API so that I can monitor locations in real-time from a custom dashboard.
|
|
|
|
|
|
|
|
|
|
@@ -34,14 +102,14 @@ As a security operator, I need to view live video streams from surveillance came
|
|
|
|
|
|
|
|
|
|
**Acceptance Scenarios**:
|
|
|
|
|
|
|
|
|
|
1. **Given** an authenticated user with camera view permissions, **When** they request a live stream for camera channel 5, **Then** they receive a stream URL or WebSocket connection that delivers live video within 2 seconds
|
|
|
|
|
1. **Given** an authenticated user with camera view permissions, **When** they request a live stream for camera 101038, **Then** they receive a stream URL that delivers live video within 2 seconds
|
|
|
|
|
2. **Given** a camera that is offline, **When** a user requests its stream, **Then** they receive a clear error message indicating the camera is unavailable
|
|
|
|
|
3. **Given** multiple concurrent users, **When** they request the same camera stream, **Then** all users can view the stream simultaneously without degradation (up to 100 concurrent streams)
|
|
|
|
|
4. **Given** a user without permission for a specific camera, **When** they request its stream, **Then** they receive a 403 Forbidden response
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### User Story 3 - Camera PTZ Control (Priority: P1)
|
|
|
|
|
### User Story 5 - Camera PTZ Control (Priority: P1)
|
|
|
|
|
|
|
|
|
|
As a security operator, I need to control pan-tilt-zoom cameras remotely via the API so that I can adjust camera angles to investigate incidents or track movement.
|
|
|
|
|
|
|
|
|
|
@@ -51,14 +119,14 @@ As a security operator, I need to control pan-tilt-zoom cameras remotely via the
|
|
|
|
|
|
|
|
|
|
**Acceptance Scenarios**:
|
|
|
|
|
|
|
|
|
|
1. **Given** an authenticated operator with PTZ permissions, **When** they send a pan-left command to camera 3, **Then** the camera begins moving left within 500ms and they receive confirmation
|
|
|
|
|
1. **Given** an authenticated operator with PTZ permissions, **When** they send a pan-left command to camera 101038, **Then** the camera begins moving left within 500ms and they receive confirmation
|
|
|
|
|
2. **Given** a camera that doesn't support PTZ, **When** a user attempts PTZ control, **Then** they receive a clear error indicating PTZ is not available for this camera
|
|
|
|
|
3. **Given** two operators controlling the same PTZ camera, **When** they send conflicting commands simultaneously, **Then** the system queues commands and notifies operators of the conflict
|
|
|
|
|
4. **Given** a PTZ command in progress, **When** the user sends a stop command, **Then** the camera movement stops immediately
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### User Story 4 - Real-time Event Notifications (Priority: P1)
|
|
|
|
|
### User Story 6 - Real-time Event Notifications (Priority: P1)
|
|
|
|
|
|
|
|
|
|
As a security operator, I need to receive instant notifications when surveillance events occur (motion detection, alarms, sensor triggers) so that I can respond quickly to security incidents.
|
|
|
|
|
|
|
|
|
|
@@ -68,14 +136,48 @@ As a security operator, I need to receive instant notifications when surveillanc
|
|
|
|
|
|
|
|
|
|
**Acceptance Scenarios**:
|
|
|
|
|
|
|
|
|
|
1. **Given** an authenticated user with event subscription permissions, **When** they connect to the WebSocket endpoint `/api/v1/events/stream`, **Then** they receive a connection confirmation and can subscribe to specific event types
|
|
|
|
|
2. **Given** a motion detection event occurs on camera 7, **When** a subscribed user is listening for video analytics events, **Then** they receive a notification within 100ms containing event type, camera channel, timestamp, and relevant data
|
|
|
|
|
3. **Given** a network disconnection, **When** the WebSocket reconnects, **Then** the user automatically re-subscribes to their previous event types and receives any missed critical events
|
|
|
|
|
4. **Given** 1000+ concurrent WebSocket connections, **When** an event occurs, **Then** all subscribed users receive notifications without system degradation
|
|
|
|
|
1. **Given** an authenticated user with event subscription permissions, **When** they connect to `/api/v1/events/stream`, **Then** they receive a connection confirmation and can subscribe to specific event types
|
|
|
|
|
2. **Given** a motion detection event occurs on camera 101038, **When** a subscribed user is listening for video analytics events, **Then** they receive a notification within 100ms containing event type, camera ID, GeViScope instance, timestamp, and relevant data
|
|
|
|
|
3. **Given** a network disconnection, **When** the WebSocket reconnects, **Then** the user automatically re-subscribes and receives any missed critical events
|
|
|
|
|
4. **Given** events from multiple GeViScope instances, **When** subscribed users receive notifications, **Then** each event clearly indicates which instance it originated from
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### User Story 5 - Recording Management (Priority: P2)
|
|
|
|
|
### User Story 7 - GeViSoft Alarm Management (Priority: P2)
|
|
|
|
|
|
|
|
|
|
As a security administrator, I need to configure and manage alarms in GeViSoft so that I can automate responses to security events across multiple GeViScope instances.
|
|
|
|
|
|
|
|
|
|
**Why this priority**: Important for advanced automation but basic video operations must work first. Alarms coordinate actions across the system.
|
|
|
|
|
|
|
|
|
|
**Independent Test**: Can be fully tested by creating an alarm configuration, triggering the alarm via an event, and verifying that configured actions (CrossSwitch, notifications) execute correctly.
|
|
|
|
|
|
|
|
|
|
**Acceptance Scenarios**:
|
|
|
|
|
|
|
|
|
|
1. **Given** an authenticated administrator, **When** they create an alarm with start/stop/acknowledge actions, **Then** the alarm is saved in GeViSoft and can be triggered by configured events
|
|
|
|
|
2. **Given** an alarm configured to route cameras 101038 and 101039 to monitors 1-2, **When** the alarm triggers, **Then** CrossSwitch actions execute and cameras appear on designated monitors
|
|
|
|
|
3. **Given** an active alarm, **When** an operator acknowledges it via `/api/v1/gevisoft/alarms/{alarm_id}/acknowledge`, **Then** acknowledge actions execute and alarm state updates
|
|
|
|
|
4. **Given** multiple GeViScope instances, **When** an alarm spans instances (e.g., camera from instance A to monitor in instance B), **Then** the API coordinates cross-instance operations
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### User Story 8 - Monitor and Viewer Management (Priority: P2)
|
|
|
|
|
|
|
|
|
|
As a system administrator, I need to query and manage video output monitors so that I can understand system topology and configure video routing.
|
|
|
|
|
|
|
|
|
|
**Why this priority**: Enhances system visibility and configuration but video operations can work without detailed monitor management initially.
|
|
|
|
|
|
|
|
|
|
**Independent Test**: Can be fully tested by querying monitor lists, checking monitor status, and understanding which cameras are currently routed to which monitors.
|
|
|
|
|
|
|
|
|
|
**Acceptance Scenarios**:
|
|
|
|
|
|
|
|
|
|
1. **Given** 256 monitors configured in a GeViScope instance, **When** an administrator queries `/api/v1/geviscope/main/monitors`, **Then** they receive a list of all monitors with IDs, names, status, and current camera assignments
|
|
|
|
|
2. **Given** a monitor displaying video, **When** queried for current assignment, **Then** the API returns which camera is currently routed to that monitor
|
|
|
|
|
3. **Given** multiple GeViScope instances, **When** listing monitors, **Then** each instance's monitors are clearly identified by instance ID
|
|
|
|
|
4. **Given** GSCView viewers connected to monitors, **When** administrators query viewer status, **Then** they can see which viewers are active and what they're displaying
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### User Story 9 - Recording Management (Priority: P2)
|
|
|
|
|
|
|
|
|
|
As a security administrator, I need to manage video recording settings and query recorded footage so that I can configure retention policies and retrieve historical video for investigations.
|
|
|
|
|
|
|
|
|
|
@@ -85,14 +187,14 @@ As a security administrator, I need to manage video recording settings and query
|
|
|
|
|
|
|
|
|
|
**Acceptance Scenarios**:
|
|
|
|
|
|
|
|
|
|
1. **Given** an authenticated administrator, **When** they request recording start on camera 2, **Then** the camera begins recording and they receive confirmation with recording ID
|
|
|
|
|
2. **Given** a time range query for 2025-11-12 14:00 to 16:00 on camera 5, **When** an investigator searches for recordings, **Then** they receive a list of available recording segments with download URLs
|
|
|
|
|
1. **Given** an authenticated administrator, **When** they request recording start on camera 101038, **Then** the camera begins recording and they receive confirmation with recording ID
|
|
|
|
|
2. **Given** a time range query for 2025-11-12 14:00 to 16:00 on camera 101038, **When** an investigator searches for recordings, **Then** they receive a list of available recording segments with playback URLs
|
|
|
|
|
3. **Given** the ring buffer is at 90% capacity, **When** an administrator checks recording capacity, **Then** they receive an alert indicating low storage and oldest recordings that will be overwritten
|
|
|
|
|
4. **Given** scheduled recording configured for nighttime hours, **When** the schedule time arrives, **Then** recording automatically starts and stops according to the schedule
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### User Story 6 - Video Analytics Configuration (Priority: P2)
|
|
|
|
|
### User Story 10 - Video Analytics Configuration (Priority: P2)
|
|
|
|
|
|
|
|
|
|
As a security administrator, I need to configure video content analysis features (motion detection, object tracking, perimeter protection) so that the system can automatically detect security-relevant events.
|
|
|
|
|
|
|
|
|
|
@@ -102,259 +204,282 @@ As a security administrator, I need to configure video content analysis features
|
|
|
|
|
|
|
|
|
|
**Acceptance Scenarios**:
|
|
|
|
|
|
|
|
|
|
1. **Given** an authenticated administrator, **When** they configure motion detection zones on camera 4, **Then** the configuration is saved and motion detection activates within those zones
|
|
|
|
|
1. **Given** an authenticated administrator, **When** they configure motion detection zones on camera 101038, **Then** the configuration is saved and motion detection activates within those zones
|
|
|
|
|
2. **Given** motion detection configured with sensitivity level 7, **When** motion occurs in the detection zone, **Then** a motion detection event is generated and sent to event subscribers
|
|
|
|
|
3. **Given** object tracking enabled on camera 6, **When** a person enters the frame, **Then** the system assigns a tracking ID and sends position updates for the duration they remain visible
|
|
|
|
|
3. **Given** object tracking enabled on camera 101038, **When** a person enters the frame, **Then** the system assigns a tracking ID and sends position updates for the duration they remain visible
|
|
|
|
|
4. **Given** multiple analytics enabled on one camera (VMD + OBTRACK), **When** events occur, **Then** all configured analytics generate appropriate events without interfering with each other
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### User Story 7 - Multi-Camera Management (Priority: P2)
|
|
|
|
|
### User Story 11 - Action Mapping and Automation (Priority: P3)
|
|
|
|
|
|
|
|
|
|
As a security operator, I need to view and manage multiple cameras simultaneously via the API so that I can coordinate surveillance across different locations and camera views.
|
|
|
|
|
As a security administrator, I need to configure action mappings in GeViSoft so that specific events automatically trigger corresponding actions across the system.
|
|
|
|
|
|
|
|
|
|
**Why this priority**: Enhances operational efficiency but single-camera operations must work first. Important for professional surveillance operations managing multiple sites.
|
|
|
|
|
**Why this priority**: Valuable for automation but requires basic event and action functionality to be working first.
|
|
|
|
|
|
|
|
|
|
**Independent Test**: Can be fully tested by retrieving a list of all available cameras, requesting multiple streams simultaneously, and grouping cameras by location, delivering multi-camera coordination.
|
|
|
|
|
**Independent Test**: Can be fully tested by creating an action mapping (e.g., motion detected → CrossSwitch), triggering the input action, and verifying the mapped actions execute.
|
|
|
|
|
|
|
|
|
|
**Acceptance Scenarios**:
|
|
|
|
|
|
|
|
|
|
1. **Given** an authenticated user, **When** they request the camera list from `/api/v1/cameras`, **Then** they receive all cameras they have permission to view with status, channel ID, capabilities, and location metadata
|
|
|
|
|
2. **Given** multiple cameras in the same location, **When** a user requests grouped camera data, **Then** cameras are organized by configured location/zone for easy navigation
|
|
|
|
|
3. **Given** a user viewing 16 camera streams, **When** they request streams via the API, **Then** all 16 streams initialize and display without individual stream degradation
|
|
|
|
|
4. **Given** a camera goes offline while being viewed, **When** the API detects the disconnection, **Then** the camera status updates and subscribers receive a notification
|
|
|
|
|
1. **Given** an action mapping configured (InputContact closed → CrossSwitch cameras to monitors), **When** the input contact event occurs, **Then** the mapped CrossSwitch actions execute automatically
|
|
|
|
|
2. **Given** multiple output actions mapped to one input, **When** the input event triggers, **Then** all output actions execute in sequence
|
|
|
|
|
3. **Given** action mappings spanning GeViScope instances, **When** triggered, **Then** the API coordinates actions across instances correctly
|
|
|
|
|
4. **Given** an action mapping fails (e.g., target camera offline), **When** execution occurs, **Then** errors are logged and administrators are notified without blocking other actions
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### User Story 8 - License Plate Recognition Integration (Priority: P3)
|
|
|
|
|
### User Story 12 - GeViSoft Configuration Management (Priority: P1) ✅ IMPLEMENTED
|
|
|
|
|
|
|
|
|
|
As a security operator monitoring vehicle access, I need to receive automatic license plate recognition events so that I can track vehicle entry/exit and match against watchlists.
|
|
|
|
|
As a system administrator, I need to manage GeViSoft configuration (G-Core servers, action mappings) via the API so that I can programmatically configure and maintain the surveillance system without manual GeViSet operations.
|
|
|
|
|
|
|
|
|
|
**Why this priority**: Valuable for specific use cases (parking, access control) but not universal. Only relevant if NPR hardware is available and configured.
|
|
|
|
|
**Why this priority**: Configuration management is essential for automation, infrastructure-as-code, and maintaining consistent configurations across environments.
|
|
|
|
|
|
|
|
|
|
**Independent Test**: Can be fully tested by configuring NPR zones, driving a test vehicle through the zone, and verifying plate recognition events with captured plate numbers, delivering automated vehicle tracking.
|
|
|
|
|
**Independent Test**: Can be fully tested by creating/reading/updating/deleting servers and action mappings, verifying changes persist in GeViSoft, and confirming no data loss occurs.
|
|
|
|
|
|
|
|
|
|
**Acceptance Scenarios**:
|
|
|
|
|
|
|
|
|
|
1. **Given** NPR configured on camera 9 with recognition zone defined, **When** a vehicle with readable plate enters the zone, **Then** an NPR event is generated containing plate number, country code, timestamp, confidence score, and image snapshot
|
|
|
|
|
2. **Given** a watchlist of plates configured, **When** a matching plate is recognized, **Then** a high-priority alert is sent to subscribers with match details
|
|
|
|
|
3. **Given** poor lighting or plate obstruction, **When** recognition fails or confidence is low (<70%), **Then** the event includes the best-guess plate and confidence level so operators can manually verify
|
|
|
|
|
4. **Given** continuous vehicle traffic, **When** multiple vehicles pass through rapidly, **Then** each vehicle generates a separate NPR event with unique tracking ID
|
|
|
|
|
1. **Given** an authenticated administrator, **When** they create a new G-Core server via `POST /api/v1/configuration/servers`, **Then** the server is added to GeViSoft configuration with correct bool types and appears in GeViSet
|
|
|
|
|
2. **Given** existing servers in configuration, **When** an administrator queries `/api/v1/configuration/servers`, **Then** they receive a list of all servers with IDs, aliases, hosts, and connection settings
|
|
|
|
|
3. **Given** multiple action mappings to delete, **When** deletion occurs in reverse order (highest ID first), **Then** only intended mappings are deleted without cascade deletion
|
|
|
|
|
4. **Given** a server ID auto-increment requirement, **When** creating servers, **Then** the system automatically assigns the next available numeric ID based on existing servers
|
|
|
|
|
|
|
|
|
|
**Implementation Status** (2025-12-16):
|
|
|
|
|
- ✅ Server CRUD: CREATE, READ, DELETE working; UPDATE has known bug
|
|
|
|
|
- ✅ Action Mapping CRUD: CREATE, READ, UPDATE, DELETE all working
|
|
|
|
|
- ✅ Critical Fix: Cascade deletion bug fixed (delete in reverse order)
|
|
|
|
|
- ✅ Configuration tree navigation and parsing
|
|
|
|
|
- ✅ SetupClient integration for configuration download/upload
|
|
|
|
|
- ✅ Bool type handling for server fields (Enabled, DeactivateEcho, DeactivateLiveCheck)
|
|
|
|
|
- ⚠️ Known Issue: Server UpdateServer method requires bug fix for "Server ID is required" error
|
|
|
|
|
|
|
|
|
|
**Documentation**:
|
|
|
|
|
- SERVER_CRUD_IMPLEMENTATION.md
|
|
|
|
|
- CRITICAL_BUG_FIX_DELETE.md
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### User Story 9 - Video Export and Backup (Priority: P3)
|
|
|
|
|
|
|
|
|
|
As a security investigator, I need to export specific video segments for evidence or sharing so that I can provide footage to law enforcement or use in incident reports.
|
|
|
|
|
|
|
|
|
|
**Why this priority**: Useful for investigations but not needed for live monitoring or basic recording. Can be added as an enhancement after core features are stable.
|
|
|
|
|
|
|
|
|
|
**Independent Test**: Can be fully tested by requesting export of a 10-minute segment from camera 3, receiving a download URL, and verifying the exported file plays correctly, delivering evidence export capability.
|
|
|
|
|
|
|
|
|
|
**Acceptance Scenarios**:
|
|
|
|
|
|
|
|
|
|
1. **Given** an authenticated investigator, **When** they request export of camera 8 footage from 10:00-10:15 on 2025-11-12, **Then** they receive an export job ID and can poll for completion status
|
|
|
|
|
2. **Given** an export job in progress, **When** the investigator checks job status, **Then** they receive progress percentage and estimated completion time
|
|
|
|
|
3. **Given** a completed export, **When** the investigator downloads the file, **Then** they receive a standard video format (MP4/AVI) playable in common media players with embedded timestamps
|
|
|
|
|
4. **Given** an export request for a time range with no recordings, **When** processing occurs, **Then** the user receives a clear message indicating no footage available for that timeframe
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### User Story 10 - System Health Monitoring (Priority: P3)
|
|
|
|
|
### User Story 13 - System Health Monitoring (Priority: P3)
|
|
|
|
|
|
|
|
|
|
As a system administrator, I need to monitor API and surveillance system health status so that I can proactively identify and resolve issues before they impact operations.
|
|
|
|
|
|
|
|
|
|
**Why this priority**: Important for production systems but not required for initial deployment. Health monitoring is an operational enhancement that can be added incrementally.
|
|
|
|
|
|
|
|
|
|
**Independent Test**: Can be fully tested by querying the health endpoint, checking SDK connectivity status, and verifying alerts when components fail, delivering system observability.
|
|
|
|
|
**Independent Test**: Can be fully tested by querying the health endpoint, checking SDK connectivity status for all instances, and verifying alerts when components fail.
|
|
|
|
|
|
|
|
|
|
**Acceptance Scenarios**:
|
|
|
|
|
|
|
|
|
|
1. **Given** the API is running, **When** an unauthenticated user requests `/api/v1/health`, **Then** they receive system status including API uptime, SDK connectivity, database status, and overall health score
|
|
|
|
|
2. **Given** the GeViScope SDK connection fails, **When** health is checked, **Then** the health endpoint returns degraded status with specific SDK error details
|
|
|
|
|
1. **Given** the API is running, **When** an unauthenticated user requests `/api/v1/health`, **Then** they receive system status including API uptime, GeViSoft connectivity, all GeViScope instance statuses, and overall health score
|
|
|
|
|
2. **Given** one GeViScope instance fails, **When** health is checked, **Then** the health endpoint returns degraded status with specific instance error details while other instances show healthy
|
|
|
|
|
3. **Given** disk space for recordings drops below 10%, **When** monitoring checks run, **Then** a warning is included in health status and administrators receive notification
|
|
|
|
|
4. **Given** an administrator monitoring performance, **When** they request detailed metrics, **Then** they receive statistics on request throughput, average response times, active WebSocket connections, and concurrent streams
|
|
|
|
|
4. **Given** an administrator monitoring performance, **When** they request detailed metrics, **Then** they receive statistics on request throughput, active streams per instance, and connection status for all instances
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### Edge Cases
|
|
|
|
|
|
|
|
|
|
- What happens when a camera is physically disconnected while being actively viewed by 20 users?
|
|
|
|
|
- How does the system handle authentication when the GeViScope SDK is temporarily unavailable?
|
|
|
|
|
- What occurs when a user requests PTZ control on a camera that another user is already controlling?
|
|
|
|
|
- How does recording behave when the ring buffer reaches capacity during an active alarm event?
|
|
|
|
|
- What happens when network latency causes event notifications to queue up - does the system batch or drop old events?
|
|
|
|
|
- How does the API respond when a user has permission for 50 cameras but only 30 are currently online?
|
|
|
|
|
- What occurs when a WebSocket connection drops mid-event notification?
|
|
|
|
|
- How does the system handle time zone differences between the API server, GeViScope SDK, and client applications?
|
|
|
|
|
- What happens when an export request spans a time range that crosses a recording gap (camera was off)?
|
|
|
|
|
- How does analytics configuration respond when applied to a camera that doesn't support the requested analytics type (e.g., NPR on a camera without NPR hardware)?
|
|
|
|
|
- What happens when a GeViScope instance disconnects while operators are viewing cameras from that instance?
|
|
|
|
|
- How does CrossSwitch behave when routing a camera from one GeViScope instance to a monitor on a different instance (if supported)?
|
|
|
|
|
- What occurs when GeViSoft connection fails but GeViScope instances remain online?
|
|
|
|
|
- How does the API handle monitor IDs that overlap across different GeViScope instances?
|
|
|
|
|
- What happens when a GSCView viewer is configured to display a monitor that has no active camera route?
|
|
|
|
|
- How does the system respond when CrossSwitch commands execute successfully at the server but no viewer is displaying the monitor?
|
|
|
|
|
- What occurs when an alarm in GeViSoft references cameras or monitors from a GeViScope instance that is offline?
|
|
|
|
|
- How does the API handle time synchronization issues between GeViSoft, multiple GeViScope instances, and the API server?
|
|
|
|
|
- What happens when monitor enumeration returns different results than expected (e.g., 256 monitors vs 16 actual video outputs)?
|
|
|
|
|
- How does the system handle authentication when GeViSoft credentials differ from GeViScope credentials?
|
|
|
|
|
|
|
|
|
|
## Requirements *(mandatory)*
|
|
|
|
|
|
|
|
|
|
### Functional Requirements
|
|
|
|
|
|
|
|
|
|
- **FR-001**: System MUST authenticate all API requests using JWT tokens with configurable expiration (default 1 hour for access tokens, 7 days for refresh tokens)
|
|
|
|
|
- **FR-002**: System MUST implement role-based access control with at least three roles: viewer (read-only camera access), operator (camera control + viewing), administrator (full system configuration)
|
|
|
|
|
- **FR-003**: System MUST provide granular permissions allowing access restriction per camera channel
|
|
|
|
|
- **FR-004**: System MUST expose live video streams for all configured GeViScope channels with initialization time under 2 seconds
|
|
|
|
|
- **FR-005**: System MUST support PTZ control operations (pan, tilt, zoom, preset positions) with command response time under 500ms
|
|
|
|
|
- **FR-006**: System MUST provide WebSocket endpoint for real-time event notifications with delivery latency under 100ms
|
|
|
|
|
- **FR-007**: System MUST support event subscriptions by type (alarms, analytics, system events) and by camera channel
|
|
|
|
|
- **FR-008**: System MUST translate all GeViScope SDK actions to RESTful API endpoints following the pattern `/api/v1/{resource}/{id}/{action}`
|
|
|
|
|
- **FR-009**: System MUST handle concurrent video stream requests from minimum 100 simultaneous users without degradation
|
|
|
|
|
- **FR-010**: System MUST support WebSocket connections from minimum 1000 concurrent clients for event notifications
|
|
|
|
|
- **FR-011**: System MUST provide recording management including start/stop recording, schedule configuration, and recording status queries
|
|
|
|
|
- **FR-012**: System MUST expose recording capacity metrics including total capacity, free space, recording depth in hours, and oldest recording timestamp
|
|
|
|
|
- **FR-013**: System MUST support video analytics configuration for VMD (Video Motion Detection), OBTRACK (object tracking and people counting), NPR (license plate recognition), and G-Tect (perimeter protection) where hardware supports these features
|
|
|
|
|
- **FR-014**: System MUST provide query capabilities for recorded footage by channel, time range, and event association
|
|
|
|
|
- **FR-015**: System MUST export video segments in standard formats (MP4 or AVI) with embedded timestamps and metadata
|
|
|
|
|
- **FR-016**: System MUST log all authentication attempts (successful and failed) with username, source IP, and timestamp
|
|
|
|
|
- **FR-017**: System MUST audit log all privileged operations including PTZ control, recording management, configuration changes, and user management with operator ID, action, target, and timestamp
|
|
|
|
|
- **FR-018**: System MUST gracefully handle camera offline scenarios by returning appropriate error codes and status information
|
|
|
|
|
- **FR-019**: System MUST implement retry logic for transient SDK communication failures (3 attempts with exponential backoff)
|
|
|
|
|
- **FR-020**: System MUST provide health check endpoint returning API status, SDK connectivity, database availability, and system resource usage
|
|
|
|
|
- **FR-021**: System MUST serve auto-generated OpenAPI/Swagger documentation at `/docs` endpoint
|
|
|
|
|
- **FR-022**: System MUST return meaningful error messages with error codes for all failure scenarios without exposing internal stack traces
|
|
|
|
|
- **FR-023**: System MUST support API versioning in URL path (v1, v2) to allow backward-compatible evolution
|
|
|
|
|
- **FR-024**: System MUST rate limit authentication attempts to prevent brute force attacks (max 5 attempts per IP per minute)
|
|
|
|
|
- **FR-025**: System MUST enforce TLS 1.2+ for all API communication in production environments
|
|
|
|
|
- **FR-026**: System MUST translate Windows error codes from GeViScope SDK to appropriate HTTP status codes with user-friendly messages
|
|
|
|
|
- **FR-027**: System MUST support filtering and pagination for endpoints returning lists (camera lists, recording lists, event histories)
|
|
|
|
|
- **FR-028**: System MUST handle GeViScope SDK ring buffer architecture by exposing recording depth and capacity warnings when storage approaches limits
|
|
|
|
|
- **FR-029**: System MUST support event correlation using ForeignKey parameter to link events with external system identifiers
|
|
|
|
|
- **FR-030**: System MUST allow configuration of pre-alarm and post-alarm recording duration for event-triggered recordings
|
|
|
|
|
**Architecture & Multi-Instance:**
|
|
|
|
|
- **FR-001**: System MUST support connecting to one GeViSoft instance (GeViServer) for management operations
|
|
|
|
|
- **FR-002**: System MUST support connecting to multiple GeViScope instances (GSCServer) with configurable instance IDs, hostnames, and credentials
|
|
|
|
|
- **FR-003**: System MUST provide instance discovery endpoint listing all configured GeViScope instances with connection status
|
|
|
|
|
- **FR-004**: System MUST support default instance configuration for convenience endpoints without instance ID
|
|
|
|
|
- **FR-005**: System MUST clearly identify which GeViScope instance each resource (camera, monitor, event) belongs to
|
|
|
|
|
|
|
|
|
|
**Authentication & Authorization:**
|
|
|
|
|
- **FR-006**: System MUST authenticate all API requests using JWT tokens with configurable expiration (default 1 hour for access, 7 days for refresh)
|
|
|
|
|
- **FR-007**: System MUST implement role-based access control with roles: viewer (read-only), operator (control), administrator (full configuration)
|
|
|
|
|
- **FR-008**: System MUST provide granular permissions allowing access restriction per camera, monitor, and GeViScope instance
|
|
|
|
|
- **FR-009**: System MUST audit log all authentication attempts and privileged operations
|
|
|
|
|
|
|
|
|
|
**CrossSwitch & Monitor Management:**
|
|
|
|
|
- **FR-010**: System MUST provide CrossSwitch endpoint to route cameras to monitors: `POST /api/v1/crossswitch` and instance-specific variant
|
|
|
|
|
- **FR-011**: System MUST track active CrossSwitch routes in database with camera ID, monitor ID, mode, timestamp, and user
|
|
|
|
|
- **FR-012**: System MUST provide endpoint to clear monitor assignments: `DELETE /api/v1/crossswitch/{monitor_id}`
|
|
|
|
|
- **FR-013**: System MUST provide routing status endpoint showing all active camera→monitor routes
|
|
|
|
|
- **FR-014**: System MUST use typed SDK actions (GeViAct_CrossSwitch) instead of string-based commands for reliable execution
|
|
|
|
|
- **FR-015**: System MUST enumerate and expose all video output monitors with IDs, names, status, and current assignments
|
|
|
|
|
- **FR-016**: System MUST support monitor grouping and bulk operations on monitor groups
|
|
|
|
|
|
|
|
|
|
**Video Operations:**
|
|
|
|
|
- **FR-017**: System MUST expose live video streams for all cameras with initialization time under 2 seconds
|
|
|
|
|
- **FR-018**: System MUST support PTZ control operations with command response time under 500ms
|
|
|
|
|
- **FR-019**: System MUST handle concurrent video stream requests from minimum 100 simultaneous users
|
|
|
|
|
- **FR-020**: System MUST gracefully handle camera offline scenarios with appropriate error codes
|
|
|
|
|
|
|
|
|
|
**Event Management:**
|
|
|
|
|
- **FR-021**: System MUST provide WebSocket endpoint for real-time event notifications with delivery latency under 100ms
|
|
|
|
|
- **FR-022**: System MUST support event subscriptions by type, camera, and GeViScope instance
|
|
|
|
|
- **FR-023**: System MUST handle events from multiple GeViScope instances with clear instance identification
|
|
|
|
|
- **FR-024**: System MUST support WebSocket connections from minimum 1000 concurrent clients
|
|
|
|
|
|
|
|
|
|
**GeViSoft Integration:**
|
|
|
|
|
- **FR-025**: System MUST provide alarm management endpoints for GeViSoft alarm configuration and triggering
|
|
|
|
|
- **FR-026**: System MUST support action mapping configuration and execution
|
|
|
|
|
- **FR-027**: System MUST coordinate cross-instance operations when alarms or actions span multiple GeViScope instances
|
|
|
|
|
- **FR-028**: System MUST provide endpoints for querying and managing GeViSoft system configuration
|
|
|
|
|
|
|
|
|
|
**Configuration Management:** ✅ IMPLEMENTED (2025-12-16)
|
|
|
|
|
- **FR-039**: System MUST provide CRUD operations for G-Core server management with proper bool type handling
|
|
|
|
|
- **FR-040**: System MUST provide CRUD operations for action mapping management
|
|
|
|
|
- **FR-041**: System MUST delete multiple action mappings in reverse order (highest ID first) to prevent cascade deletion
|
|
|
|
|
- **FR-042**: System MUST auto-increment server IDs based on highest existing numeric ID
|
|
|
|
|
- **FR-043**: System MUST persist configuration changes to GeViSoft and verify changes are visible in GeViSet
|
|
|
|
|
- **FR-044**: System MUST parse and navigate GeViSoft configuration tree structure (.set file format)
|
|
|
|
|
- **FR-045**: System MUST use SetupClient for reliable configuration download/upload operations
|
|
|
|
|
|
|
|
|
|
**Recording & Analytics:**
|
|
|
|
|
- **FR-029**: System MUST provide recording management including start/stop, queries, and capacity metrics
|
|
|
|
|
- **FR-030**: System MUST support video analytics configuration (VMD, OBTRACK, NPR, G-Tect) where hardware supports
|
|
|
|
|
- **FR-031**: System MUST provide query capabilities for recorded footage by channel, time range, and event association
|
|
|
|
|
- **FR-032**: System MUST export video segments in standard formats (MP4/AVI) with metadata
|
|
|
|
|
|
|
|
|
|
**System Management:**
|
|
|
|
|
- **FR-033**: System MUST provide health check endpoint returning status for GeViSoft, all GeViScope instances, database, and SDK bridges
|
|
|
|
|
- **FR-034**: System MUST implement retry logic for transient SDK communication failures (3 attempts with exponential backoff)
|
|
|
|
|
- **FR-035**: System MUST serve auto-generated OpenAPI/Swagger documentation at `/docs`
|
|
|
|
|
- **FR-036**: System MUST support API versioning in URL path (v1, v2) for backward compatibility
|
|
|
|
|
- **FR-037**: System MUST rate limit authentication attempts (max 5/minute per IP)
|
|
|
|
|
- **FR-038**: System MUST enforce TLS 1.2+ for all API communication in production
|
|
|
|
|
|
|
|
|
|
### Key Entities
|
|
|
|
|
|
|
|
|
|
- **Camera**: Represents a video input channel with properties including channel ID, name, location, capabilities (PTZ support, analytics support), current status (online/offline/recording), stream URL, and permissions
|
|
|
|
|
- **User**: Authentication entity with username, hashed password, assigned role, permissions list, JWT tokens, and audit trail of actions
|
|
|
|
|
- **Event**: Surveillance occurrence with type ID (motion, alarm, analytics), event ID (instance), channel, timestamp, severity, associated data (e.g., NPR plate number, object tracking ID), and foreign key for external correlation
|
|
|
|
|
- **Recording**: Video footage segment with channel, start time, end time, file size, recording trigger (scheduled, event, manual), and retention policy
|
|
|
|
|
- **Stream**: Active video stream session with channel, user, start time, format, quality level, and connection status
|
|
|
|
|
- **Analytics Configuration**: Video content analysis settings with type (VMD, NPR, OBTRACK, G-Tect, CPA), channel, enabled zones/regions, sensitivity parameters, and alert thresholds
|
|
|
|
|
- **PTZ Preset**: Saved camera position with preset ID, channel, name, pan/tilt/zoom values
|
|
|
|
|
- **Audit Log Entry**: Security and operations record with timestamp, user, action type, target resource, outcome (success/failure), and detailed parameters
|
|
|
|
|
- **GeViScope Instance**: Configuration for a GSCServer connection with ID, hostname, credentials, status, camera count, monitor count
|
|
|
|
|
- **Camera**: Video input channel with ID, global ID, name, GeViScope instance, capabilities, status, stream URL
|
|
|
|
|
- **Monitor (Video Output)**: Logical display channel with ID, name, GeViScope instance, status, current camera assignment
|
|
|
|
|
- **CrossSwitch Route**: Video routing record with camera ID, monitor ID, mode, GeViScope instance, created timestamp, created by user, active status
|
|
|
|
|
- **User**: Authentication entity with username, password hash, role, permissions, JWT tokens, audit trail
|
|
|
|
|
- **Event**: Surveillance occurrence with type, event ID, camera, GeViScope instance, timestamp, severity, data, foreign key
|
|
|
|
|
- **Alarm (GeViSoft)**: System-wide alarm with ID, name, priority, monitor group, cameras, trigger actions, active status
|
|
|
|
|
- **Action Mapping**: Automation rule with input action, output actions, GeViScope instance scope
|
|
|
|
|
- **Recording**: Video footage segment with camera, GeViScope instance, start/end time, file size, trigger type
|
|
|
|
|
- **Audit Log Entry**: Security record with timestamp, user, action, target resource, GeViScope instance, outcome
|
|
|
|
|
|
|
|
|
|
## Success Criteria *(mandatory)*
|
|
|
|
|
|
|
|
|
|
### Measurable Outcomes
|
|
|
|
|
|
|
|
|
|
- **SC-001**: Developers can authenticate and make their first successful API call within 10 minutes of reading the quick start documentation
|
|
|
|
|
- **SC-002**: Security operators can view live video from any authorized camera with video appearing on screen within 2 seconds of request
|
|
|
|
|
- **SC-003**: PTZ camera movements respond to operator commands within 500ms, providing responsive control for incident investigation
|
|
|
|
|
- **SC-004**: Real-time event notifications are delivered to subscribed clients within 100ms of event occurrence, enabling rapid incident response
|
|
|
|
|
- **SC-005**: System supports 100 concurrent video streams without any individual stream experiencing frame drops or quality degradation
|
|
|
|
|
- **SC-006**: System handles 1000+ concurrent WebSocket connections for event notifications with message delivery rates exceeding 99.9%
|
|
|
|
|
- **SC-007**: API metadata queries (camera lists, status checks, user info) return results in under 200ms for 95% of requests
|
|
|
|
|
- **SC-008**: System maintains 99.9% uptime during production operation, measured as availability of the health check endpoint
|
|
|
|
|
- **SC-009**: Operators can successfully complete all primary surveillance tasks (view cameras, control PTZ, receive alerts, query recordings) without requiring technical support
|
|
|
|
|
- **SC-010**: API documentation is sufficiently complete that 90% of integration questions can be answered by reading the OpenAPI specification and examples
|
|
|
|
|
- **SC-011**: Failed authentication attempts are logged and administrators receive alerts for potential security threats within 5 minutes of detection
|
|
|
|
|
- **SC-012**: Video export requests for segments up to 1 hour complete within 5 minutes and produce files playable in standard media players
|
|
|
|
|
- **SC-013**: System gracefully handles camera failures, with offline cameras clearly indicated and the API remaining operational for all other cameras
|
|
|
|
|
- **SC-014**: Recording capacity warnings are provided when storage reaches 80% capacity, allowing administrators to take action before recordings are lost
|
|
|
|
|
- **SC-015**: During peak load (500 requests/second), the system maintains response time targets with no more than 0.1% of requests timing out or failing
|
|
|
|
|
- **SC-001**: Developers can authenticate and make their first successful API call within 10 minutes
|
|
|
|
|
- **SC-002**: Operators can execute CrossSwitch to route cameras to monitors with routes visible in system within 1 second
|
|
|
|
|
- **SC-003**: Multi-instance operations work correctly with 3+ GeViScope instances configured
|
|
|
|
|
- **SC-004**: Security operators can view live video from any authorized camera with video appearing within 2 seconds
|
|
|
|
|
- **SC-005**: PTZ camera movements respond to commands within 500ms
|
|
|
|
|
- **SC-006**: Real-time event notifications delivered within 100ms across all GeViScope instances
|
|
|
|
|
- **SC-007**: System supports 100 concurrent video streams across all instances without degradation
|
|
|
|
|
- **SC-008**: System handles 1000+ concurrent WebSocket connections with 99.9% message delivery
|
|
|
|
|
- **SC-009**: CrossSwitch routes created via API are visible in GeViAPI Test Client and affect GSCView displays
|
|
|
|
|
- **SC-010**: API maintains 99.9% uptime with automatic failover if one GeViScope instance fails
|
|
|
|
|
|
|
|
|
|
### Business Impact
|
|
|
|
|
|
|
|
|
|
- **BI-001**: Custom surveillance applications can be developed and deployed in under 1 week using the API, compared to 4-6 weeks with direct SDK integration
|
|
|
|
|
- **BI-002**: Reduction in support requests by 60% compared to direct SDK usage, as API abstracts SDK complexity and provides clear error messages
|
|
|
|
|
- **BI-003**: Enable integration with third-party systems (access control, building management, alarm systems) that previously couldn't interface with GeViScope
|
|
|
|
|
- **BI-004**: Support mobile and web-based surveillance clients that can't run Windows SDK, expanding platform compatibility
|
|
|
|
|
- **BI-001**: Custom surveillance applications can be developed in under 1 week using the API
|
|
|
|
|
- **BI-002**: Support for multiple GeViScope instances enables scalable multi-site deployments
|
|
|
|
|
- **BI-003**: Unified API reduces integration complexity by 70% compared to separate GeViSoft/GeViScope integrations
|
|
|
|
|
- **BI-004**: CrossSwitch automation reduces operator workload for video routing by 80%
|
|
|
|
|
|
|
|
|
|
## Dependencies *(mandatory)*
|
|
|
|
|
|
|
|
|
|
### External Dependencies
|
|
|
|
|
|
|
|
|
|
- **GeViScope SDK 7.9.975.68+**: Core surveillance system SDK providing video streams, camera control, and event management
|
|
|
|
|
- **Windows Server 2016+** or **Windows 10/11**: Required platform for GeViScope SDK operation
|
|
|
|
|
- **Active Geutebruck Surveillance System**: Physical cameras, recording servers, and network infrastructure must be configured and operational
|
|
|
|
|
- **GeViScope SDK 7.9.975.68+**: Core SDK for video operations
|
|
|
|
|
- **GeViSoft SDK 6.0.1.5+**: Management platform SDK
|
|
|
|
|
- **Windows Server 2016+** or **Windows 10/11**: Required for both SDKs
|
|
|
|
|
- **Active GeViSoft System**: Configured with GeViScope instances
|
|
|
|
|
- **Active GeViScope Instances**: One or more GSCServer instances with cameras and monitors
|
|
|
|
|
|
|
|
|
|
### Assumptions
|
|
|
|
|
|
|
|
|
|
- GeViScope SDK is already installed and configured with cameras connected and functional
|
|
|
|
|
- Network connectivity exists between API server and GeViScope SDK service
|
|
|
|
|
- Sufficient storage capacity available for ring buffer recording as configured in GeViScope
|
|
|
|
|
- Client applications can consume RESTful APIs and WebSocket connections
|
|
|
|
|
- Authentication credentials for GeViScope SDK are available for API integration
|
|
|
|
|
- Standard industry retention and performance expectations apply unless otherwise specified by regulations
|
|
|
|
|
- JWT-based authentication is acceptable for client applications (OAuth2 flow not required initially)
|
|
|
|
|
- Video streaming will use existing GeViScope streaming protocols (direct URL or stream proxy to be determined during technical planning)
|
|
|
|
|
- Redis or similar in-memory database available for session management and caching
|
|
|
|
|
- SSL/TLS certificates can be obtained and configured for production deployment
|
|
|
|
|
- GeViSoft and GeViScope instances are installed, configured, and operational
|
|
|
|
|
- Network connectivity exists between API server and all GeViScope/GeViSoft instances
|
|
|
|
|
- Authentication credentials available for all instances
|
|
|
|
|
- Sufficient storage for ring buffer recording
|
|
|
|
|
- CrossSwitch commands execute at server level, viewer applications (GSCView) required for actual video display
|
|
|
|
|
- Monitor IDs may not be unique across instances (scoped by instance ID in API)
|
|
|
|
|
|
|
|
|
|
### Out of Scope
|
|
|
|
|
|
|
|
|
|
- Direct camera hardware management (firmware updates, network configuration) - handled by GeViScope
|
|
|
|
|
- Video storage architecture changes - API uses existing GeViScope ring buffer
|
|
|
|
|
- Custom video codec development - API uses GeViScope's supported formats
|
|
|
|
|
- Mobile native SDKs - this specification covers REST API only, client SDKs are separate future work
|
|
|
|
|
- Video wall display management - API provides data, UI implementation is client responsibility
|
|
|
|
|
- Bi-directional audio communication - audio monitoring may be included but two-way audio is deferred
|
|
|
|
|
- Access control system integration - API provides data interfaces but integration logic is external
|
|
|
|
|
- Custom analytics algorithm development - API configures existing GeViScope analytics, custom algorithms are separate work
|
|
|
|
|
- Direct camera hardware management (firmware, network config)
|
|
|
|
|
- GSCView configuration and deployment
|
|
|
|
|
- Custom video codec development
|
|
|
|
|
- Mobile native SDKs (REST API only)
|
|
|
|
|
- Video wall display management UI
|
|
|
|
|
- Bi-directional audio communication
|
|
|
|
|
- Custom analytics algorithm development
|
|
|
|
|
|
|
|
|
|
## Constraints
|
|
|
|
|
|
|
|
|
|
### Technical Constraints
|
|
|
|
|
|
|
|
|
|
- API must run on Windows platform due to GeViScope SDK dependency
|
|
|
|
|
- All video operations must use GeViScope's channel-based architecture (Channel ID parameter required)
|
|
|
|
|
- Event notifications limited to events supported by GeViScope SDK action system
|
|
|
|
|
- Recording capabilities bounded by GeViScope SDK's ring buffer architecture
|
|
|
|
|
- Analytics features only available for cameras with hardware support (cannot enable NPR on camera without NPR hardware)
|
|
|
|
|
- API must run on Windows platform due to SDK dependencies
|
|
|
|
|
- All video operations use GeViScope's channel-based architecture
|
|
|
|
|
- Event notifications limited to SDK-supported events
|
|
|
|
|
- Recording capabilities bounded by ring buffer architecture
|
|
|
|
|
- CrossSwitch routes video at server level, does NOT control physical displays (requires viewers)
|
|
|
|
|
- Monitor enumeration may return more monitors than physically exist (SDK implementation detail)
|
|
|
|
|
|
|
|
|
|
### Performance Constraints
|
|
|
|
|
|
|
|
|
|
- Maximum concurrent streams limited by GeViScope SDK license and hardware capacity
|
|
|
|
|
- WebSocket connection limits determined by operating system socket limits and available memory
|
|
|
|
|
- API response times dependent on GeViScope SDK response characteristics
|
|
|
|
|
- Video stream initialization time includes SDK processing delay (targeted under 2 seconds total)
|
|
|
|
|
- Maximum concurrent streams limited by GeViScope SDK licenses and hardware
|
|
|
|
|
- WebSocket connection limits determined by OS socket limits
|
|
|
|
|
- Multi-instance operations may have higher latency than single-instance
|
|
|
|
|
- CrossSwitch execution time depends on SDK response (typically <100ms)
|
|
|
|
|
|
|
|
|
|
### Security Constraints
|
|
|
|
|
|
|
|
|
|
- All API communication must use TLS 1.2+ in production
|
|
|
|
|
- JWT tokens must have configurable expiration to balance security and usability
|
|
|
|
|
- Audit logging must be tamper-evident (append-only, with checksums or write to immutable storage)
|
|
|
|
|
- Credentials for GeViScope SDK must be stored securely (environment variables, key vault)
|
|
|
|
|
- JWT tokens must have configurable expiration
|
|
|
|
|
- Audit logging must be tamper-evident
|
|
|
|
|
- Credentials for GeViSoft and GeViScope instances must be stored securely
|
|
|
|
|
|
|
|
|
|
## Risk Analysis
|
|
|
|
|
|
|
|
|
|
### High Impact Risks
|
|
|
|
|
|
|
|
|
|
1. **GeViScope SDK Stability**: If SDK crashes or becomes unresponsive, API loses all functionality
|
|
|
|
|
- *Mitigation*: Implement circuit breaker pattern, health monitoring, automatic SDK reconnection logic
|
|
|
|
|
1. **Multi-Instance Complexity**: Managing connections to multiple GeViScope instances increases failure modes
|
|
|
|
|
- *Mitigation*: Circuit breaker per instance, independent health monitoring, graceful degradation
|
|
|
|
|
|
|
|
|
|
2. **Performance Under Load**: Concurrent stream limits may be lower than target (100 streams)
|
|
|
|
|
- *Mitigation*: Load testing early in development, potentially implement stream quality adaptation
|
|
|
|
|
2. **CrossSwitch Verification**: Confirming routes are active requires viewer applications
|
|
|
|
|
- *Mitigation*: Document viewer requirements, provide route tracking in database, API-level route verification
|
|
|
|
|
|
|
|
|
|
3. **Windows Platform Dependency**: Restricts deployment options and increases operational complexity
|
|
|
|
|
- *Mitigation*: Document Windows container approach, design SDK bridge for potential future Linux support via proxy
|
|
|
|
|
3. **GeViSoft/GeViScope Coordination**: Cross-system operations may have complex failure scenarios
|
|
|
|
|
- *Mitigation*: Transaction-like patterns, compensating actions, clear error reporting
|
|
|
|
|
|
|
|
|
|
### Medium Impact Risks
|
|
|
|
|
|
|
|
|
|
4. **SDK Version Compatibility**: Future GeViScope SDK updates may break API integration
|
|
|
|
|
- *Mitigation*: Version testing before SDK upgrades, maintain SDK abstraction layer
|
|
|
|
|
4. **Instance Configuration Management**: Adding/removing instances requires careful config management
|
|
|
|
|
- *Mitigation*: Configuration validation, instance health checks, hot-reload support
|
|
|
|
|
|
|
|
|
|
5. **WebSocket Scalability**: 1000+ concurrent connections may stress resources
|
|
|
|
|
- *Mitigation*: Connection pooling, message batching, load testing, potential horizontal scaling
|
|
|
|
|
5. **SDK Version Compatibility**: Different GeViScope instances may run different SDK versions
|
|
|
|
|
- *Mitigation*: Version detection, compatibility matrix, graceful feature detection
|
|
|
|
|
|
|
|
|
|
6. **Network Latency**: Event notifications and video streams sensitive to network conditions
|
|
|
|
|
- *Mitigation*: Document network requirements, implement connection quality monitoring
|
|
|
|
|
|
|
|
|
|
### Low Impact Risks
|
|
|
|
|
|
|
|
|
|
7. **Documentation Drift**: API changes may outpace documentation updates
|
|
|
|
|
- *Mitigation*: Auto-generated OpenAPI specs from code, documentation review in PR process
|
|
|
|
|
6. **Monitor ID Confusion**: Monitor IDs overlap across instances
|
|
|
|
|
- *Mitigation*: Always scope monitors by instance ID in API, clear documentation
|
|
|
|
|
|
|
|
|
|
## Notes
|
|
|
|
|
|
|
|
|
|
This specification focuses on **WHAT** the API enables users to do and **WHY** it's valuable, avoiding **HOW** it will be implemented. Technical decisions about Python/FastAPI, specific database choices, video streaming protocols, and SDK integration mechanisms will be made during the `/speckit.plan` phase.
|
|
|
|
|
This updated specification reflects the **unified architecture** supporting both GeViSoft management and multiple GeViScope instances. The API serves as a central control plane for the entire Geutebruck surveillance ecosystem.
|
|
|
|
|
|
|
|
|
|
The user stories are prioritized for iterative development:
|
|
|
|
|
- **P1 stories** (1-4) form the MVP: authentication, live viewing, PTZ control, event notifications
|
|
|
|
|
- **P2 stories** (5-7) add operational capabilities: recording management, analytics configuration, multi-camera coordination
|
|
|
|
|
- **P3 stories** (8-10) provide enhancements: specialized analytics (NPR), evidence export, system monitoring
|
|
|
|
|
**Key Architectural Decisions:**
|
|
|
|
|
- Single API with two layers: GeViSoft (management) and GeViScope (operations)
|
|
|
|
|
- Instance-based routing for GeViScope operations
|
|
|
|
|
- CrossSwitch implemented with typed SDK actions for reliability
|
|
|
|
|
- Monitor management reflects SDK's video output concept (logical channels, not physical displays)
|
|
|
|
|
- Database tracks routes and provides audit trail
|
|
|
|
|
|
|
|
|
|
Each story is independently testable and delivers standalone value, enabling flexible development sequencing and incremental delivery to users.
|
|
|
|
|
**Priority Sequencing:**
|
|
|
|
|
- **P1** (Stories 1-6): MVP with auth, multi-instance, CrossSwitch, live video, PTZ, events
|
|
|
|
|
- **P2** (Stories 7-10): GeViSoft integration, monitor management, recording, analytics
|
|
|
|
|
- **P3** (Stories 11-12): Automation, advanced monitoring
|
|
|
|
|
|