@scrypted/nvr 0.12.14 → 0.12.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/plugin.zip +0 -0
- package/package.json +2 -1
- package/.clinerules/overview.md +0 -135
- package/dist/724 +0 -1734
- package/dist/main.nodejs.js.LICENSE.txt +0 -7
package/CHANGELOG.md
CHANGED
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrypted/nvr",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.15",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./src/main.ts": "./main.nodejs.js",
|
|
6
6
|
"./src/motion-fork.ts": "./motion-fork.nodejs.js",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"asbuild": "npm run asbuild:debug && npm run asbuild:release"
|
|
28
28
|
},
|
|
29
29
|
"scrypted": {
|
|
30
|
+
"rollup": true,
|
|
30
31
|
"name": "Scrypted NVR",
|
|
31
32
|
"type": "DataSource",
|
|
32
33
|
"interfaces": [
|
package/.clinerules/overview.md
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
# Scrypted NVR Plugin - Technical Overview
|
|
2
|
-
|
|
3
|
-
## Project Purpose
|
|
4
|
-
The Scrypted NVR plugin is a Network Video Recorder (NVR) solution designed for the Scrypted video integration platform. It primarily supports local RTSP cameras. The plugin enables continuous recording, motion detection, object recognition, and remote access to camera footage.
|
|
5
|
-
|
|
6
|
-
## Core Architecture
|
|
7
|
-
The plugin follows a modular, mixin-based architecture that extends Scrypted's core functionality. It's built primarily in TypeScript.
|
|
8
|
-
|
|
9
|
-
### Main Components
|
|
10
|
-
- **NvrPlugin (src/main.ts)**: The core class that manages the plugin lifecycle, handles authentication, and coordinates various services
|
|
11
|
-
- **Mixin System**: Extends camera devices with additional recording and detection capabilities
|
|
12
|
-
|
|
13
|
-
## Key Functional Components
|
|
14
|
-
|
|
15
|
-
### 1. Recording System (src/recording-files.ts)
|
|
16
|
-
Manages the entire recording lifecycle including:
|
|
17
|
-
- Storage allocation across multiple tiers (local, remote, low-resolution)
|
|
18
|
-
- File retention policies based on disk space and configured retention periods
|
|
19
|
-
- Intelligent disk space management that automatically prunes older recordings when necessary
|
|
20
|
-
- Support for multiple storage backends with automatic failover
|
|
21
|
-
|
|
22
|
-
### 2. Motion Detection (src/motion-detection.ts)
|
|
23
|
-
Provides accelerated motion detection capabilities:
|
|
24
|
-
- Uses WebAssembly for high-performance pixel comparison
|
|
25
|
-
- Supports OpenCL acceleration for compatible GPUs
|
|
26
|
-
- Configurable sensitivity and detection zones
|
|
27
|
-
- Integrates with the recording system to trigger recordings on motion events
|
|
28
|
-
|
|
29
|
-
### 3. Object Detection (src/object-detection.ts)
|
|
30
|
-
Integrates with various AI models for object recognition:
|
|
31
|
-
- Supports multiple detection plugins (@scrypted/openvino, @scrypted/ncnn, @scrypted/tensorflow-lite, etc.)
|
|
32
|
-
- Automatic plugin installation based on system capabilities
|
|
33
|
-
- Face recognition and tracking capabilities
|
|
34
|
-
- Vehicle and person detection with configurable sensitivity
|
|
35
|
-
|
|
36
|
-
### 4. Adaptive Streaming (src/adaptive-mixin.ts)
|
|
37
|
-
Handles adaptive bitrate streaming for different clients:
|
|
38
|
-
- Dynamic quality adjustment based on network conditions
|
|
39
|
-
- Support for various streaming protocols (RTSP, HLS)
|
|
40
|
-
- Bandwidth optimization for remote viewing
|
|
41
|
-
- Client-side quality selection
|
|
42
|
-
|
|
43
|
-
### 5. Camera Management
|
|
44
|
-
- **Camera Discovery (src/camera-discovery.ts)**: Automated discovery and setup of compatible cameras
|
|
45
|
-
- **User Management (src/nvr-user.ts)**: Integration with Scrypted's user system for access control
|
|
46
|
-
- **Storage Configuration**: Flexible storage setup with support for multiple drives and network locations
|
|
47
|
-
|
|
48
|
-
## Storage Management
|
|
49
|
-
The plugin implements a sophisticated storage management system with multiple tiers:
|
|
50
|
-
|
|
51
|
-
### Storage Tiers
|
|
52
|
-
- **Local Recorder**: Primary storage for high-resolution recordings
|
|
53
|
-
- **Remote**: Secondary storage for backup and redundancy
|
|
54
|
-
- **Low-Resolution**: Optimized storage for thumbnails and preview streams
|
|
55
|
-
- **Events**: Specialized storage for event-triggered recordings
|
|
56
|
-
|
|
57
|
-
### Retention Policies
|
|
58
|
-
- Configurable retention periods (default: 30 days)
|
|
59
|
-
- Automatic pruning based on disk space thresholds
|
|
60
|
-
- Priority-based retention (important recordings preserved longer)
|
|
61
|
-
- Multi-drive support with automatic load balancing
|
|
62
|
-
|
|
63
|
-
## Integration Points
|
|
64
|
-
|
|
65
|
-
### Device Integration
|
|
66
|
-
- Extends existing camera devices through the mixin system
|
|
67
|
-
- Adds recording, motion detection, and object recognition capabilities
|
|
68
|
-
- Preserves original device functionality while adding NVR features
|
|
69
|
-
|
|
70
|
-
### API Endpoints
|
|
71
|
-
- HTTP endpoints for thumbnail retrieval (`/thumbnail`)
|
|
72
|
-
- Clip generation and streaming (`/clip`)
|
|
73
|
-
- OAuth integration for user authentication
|
|
74
|
-
- Settings interface for configuration
|
|
75
|
-
|
|
76
|
-
### Scrypted Platform Integration
|
|
77
|
-
- Full integration with Scrypted's device management system
|
|
78
|
-
- User permission system for access control
|
|
79
|
-
- Plugin ecosystem integration for extended functionality
|
|
80
|
-
- Cloud synchronization for remote access
|
|
81
|
-
|
|
82
|
-
## Deployment and Configuration
|
|
83
|
-
|
|
84
|
-
### Installation
|
|
85
|
-
- Available for Mac and Windows via the Desktop Application
|
|
86
|
-
- Supports Docker and Proxmox LXC installations
|
|
87
|
-
- Requires subscription through the billing portal
|
|
88
|
-
|
|
89
|
-
### Configuration
|
|
90
|
-
- Web-based interface for setup and management
|
|
91
|
-
- Storage directory configuration with validation
|
|
92
|
-
- Camera-specific settings for recording quality and detection
|
|
93
|
-
- Global settings for retention policies and system behavior
|
|
94
|
-
|
|
95
|
-
### System Requirements
|
|
96
|
-
- Compatible with various hardware acceleration options (Coral TPU, GPU acceleration)
|
|
97
|
-
- Supports multiple storage configurations
|
|
98
|
-
- Network requirements for RTSP streaming and remote access
|
|
99
|
-
|
|
100
|
-
## Technical Implementation Details
|
|
101
|
-
|
|
102
|
-
### WebAssembly Components
|
|
103
|
-
The `assembly/` directory contains performance-critical code compiled to WebAssembly:
|
|
104
|
-
- **blur.ts**: Image blurring and noise reduction algorithms
|
|
105
|
-
- **face-ops.ts**: Face detection and recognition operations
|
|
106
|
-
- **region.ts**: Region-based motion detection
|
|
107
|
-
- Optimized for real-time video processing with minimal CPU overhead
|
|
108
|
-
|
|
109
|
-
### Plugin Architecture
|
|
110
|
-
The plugin follows Scrypted's plugin model with several key aspects:
|
|
111
|
-
- **Mixin Provider**: Extends existing devices with additional capabilities
|
|
112
|
-
- **Buffer Converter**: Handles media format conversion
|
|
113
|
-
- **Settings Interface**: Provides configuration options
|
|
114
|
-
- **OAuth Client**: Handles user authentication
|
|
115
|
-
|
|
116
|
-
### Error Handling and Monitoring
|
|
117
|
-
- Comprehensive logging system
|
|
118
|
-
- Disk space monitoring with alerts
|
|
119
|
-
- Recording failure detection and recovery
|
|
120
|
-
- System health checks
|
|
121
|
-
|
|
122
|
-
## Development and Maintenance
|
|
123
|
-
|
|
124
|
-
### Code Structure
|
|
125
|
-
- **src/**: Main TypeScript source code
|
|
126
|
-
- **assembly/**: WebAssembly components in AssemblyScript
|
|
127
|
-
- **test/**: Test cases for various components
|
|
128
|
-
- Configuration files for build and deployment
|
|
129
|
-
|
|
130
|
-
### Build Process
|
|
131
|
-
- TypeScript compilation with multiple configuration files (tsconfig.json, tsconfig.rollup.json, tsconfig.webpack.json)
|
|
132
|
-
- WebAssembly compilation for performance components
|
|
133
|
-
- Rollup bundling for production deployment
|
|
134
|
-
|
|
135
|
-
This technical overview provides a comprehensive understanding of the Scrypted NVR plugin's architecture, components, and functionality, serving as a foundation for further development and maintenance.
|