### Start, View Logs, and Stop Strix with Docker Compose Source: https://github.com/eduard256/strix/blob/main/DOCKER.md This snippet demonstrates basic Docker Compose commands to manage the Strix service. It includes starting the service in detached mode, following its logs in real-time, and stopping all associated services. ```bash docker-compose up -d docker-compose logs -f strix docker-compose down ``` -------------------------------- ### Configure Strix with Environment Variables via Docker Run Source: https://github.com/eduard256/strix/blob/main/DOCKER.md This example shows how to run the Strix container and configure its behavior using environment variables. It maps port 8080 and sets the API listen address and log level for the Strix application. ```bash docker run -d \ --name strix \ -p 8080:8080 \ -e STRIX_API_LISTEN=:8080 \ -e STRIX_LOG_LEVEL=debug \ eduard256/strix:latest ``` -------------------------------- ### Build Strix Docker Image Locally Source: https://github.com/eduard256/strix/blob/main/DOCKER.md These commands show how to build the Strix Docker image. The first builds the image for the current platform, while the second uses Docker Buildx to build for multiple platforms (amd64 and arm64). ```bash # Build for your platform docker build -t strix:local . # Build for multiple platforms docker buildx build --platform linux/amd64,linux/arm64 -t strix:multi . ``` -------------------------------- ### Deploy Full Stack (Strix + go2rtc + Frigate) with Docker Compose Source: https://github.com/eduard256/strix/blob/main/DOCKER.md This command deploys a full-stack environment including Strix, go2rtc, and Frigate using a pre-defined Docker Compose file. It starts all services in detached mode. ```bash docker-compose -f docker-compose.full.yml up -d ``` -------------------------------- ### Install Strix using Docker Compose Source: https://github.com/eduard256/strix/blob/main/README.md Installs Strix using Docker Compose. This script ensures Docker and Docker Compose are installed, downloads the docker-compose.yml file, and then starts the Strix service in detached mode. ```bash sudo apt update && command -v docker >/dev/null 2>&1 || curl -fsSL https://get.docker.com | sudo sh && command -v docker-compose >/dev/null 2>&1 || { sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose; } && curl -fsSL https://raw.githubusercontent.com/eduard256/Strix/main/docker-compose.yml -o docker-compose.yml && docker-compose up -d ``` -------------------------------- ### Complete Brand File Example (JSON) Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md An example of a complete brand file in JSON format, detailing camera models, connection types, protocols, ports, and URLs for a specific brand (Foscam). This file serves as a template for other brand configurations. ```json { "brand": "Foscam", "brand_id": "foscam", "last_updated": "2025-10-17", "source": "ispyconnect.com", "website": "https://www.foscam.com", "entries": [ { "models": ["FI9821P", "FI9826P", "FI9821W"], "type": "FFMPEG", "protocol": "rtsp", "port": 554, "url": "videoMain", "notes": "Main stream HD" }, { "models": ["FI9821P", "FI9826P"], "type": "FFMPEG", "protocol": "rtsp", "port": 554, "url": "videoSub", "notes": "Sub stream SD" }, { "models": ["FI9821P", "FI9826P", "FI9821W", "C1"], "type": "MJPEG", "protocol": "http", "port": 88, "url": "cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr={username}&pwd={password}", "notes": "MJPEG fallback" }, { "models": ["FI9821P", "C1", "C2"], "type": "JPEG", "protocol": "http", "port": 88, "url": "cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr={username}&pwd={password}", "notes": "Snapshot" } ] } ``` -------------------------------- ### Verify ffprobe Installation within Strix Container Source: https://github.com/eduard256/strix/blob/main/DOCKER.md This command checks if the `ffprobe` utility is correctly installed and accessible within the Strix container. It's a useful step for troubleshooting stream validation issues. ```bash docker exec strix ffprobe -version ``` -------------------------------- ### Configure Strix with a Mounted Config File via Docker Run Source: https://github.com/eduard256/strix/blob/main/DOCKER.md This snippet illustrates running Strix with a custom configuration file mounted into the container. It first creates a `strix.yaml` file and then runs the container, mapping the local file to `/app/strix.yaml` within the container. ```bash # Create strix.yaml cat > strix.yaml </dev/null 2>&1 || curl -fsSL https://get.docker.com | sudo sh && docker run -d --name strix --network host --restart unless-stopped eduard256/strix:latest ``` -------------------------------- ### Construct RTSP URL (Python) Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md Builds a Real-Time Streaming Protocol (RTSP) URL using provided entry details, IP address, username, and password. Includes an example format. ```python def build_rtsp_url(entry, ip, username, password): return f"rtsp://{username}:{password}@{ip}:{entry['port']}/{entry['url']}" # Example: # rtsp://admin:12345@192.168.1.100:554/live3.sdp ``` -------------------------------- ### Run Strix Container with Docker Run Source: https://github.com/eduard256/strix/blob/main/DOCKER.md This command starts the Strix container in detached mode, assigning it a name and mapping port 4567 on the host to port 4567 in the container. It uses the latest official Strix image from Docker Hub. ```bash docker run -d \ --name strix \ -p 4567:4567 \ eduard256/strix:latest ``` -------------------------------- ### Restart Strix Container Source: https://github.com/eduard256/strix/blob/main/DOCKER.md This command gracefully restarts the Strix Docker container. It's a common troubleshooting step to apply configuration changes or recover from temporary issues. ```bash docker restart strix ``` -------------------------------- ### Access Strix Container Shell for Debugging Source: https://github.com/eduard256/strix/blob/main/DOCKER.md This command opens an interactive shell session inside the running Strix container. This is invaluable for inspecting the container's file system, running diagnostic commands, and troubleshooting issues directly within the container's environment. ```bash docker exec -it strix sh ``` -------------------------------- ### Strix REST API Reference Source: https://github.com/eduard256/strix/blob/main/README.md Examples of interacting with the Strix REST API for health checks, camera searching, and stream discovery. ```http GET /api/v1/health ``` ```http POST /api/v1/cameras/search { "query": "hikvision", "limit": 10 } ``` ```http POST /api/v1/streams/discover { "target": "192.168.1.100", "username": "admin", "password": "12345", "model": "DS-2CD2xxx", "timeout": 240, "max_streams": 10 } ``` -------------------------------- ### Generate Frigate Configuration Source: https://github.com/eduard256/strix/blob/main/README.md Example Frigate configuration generated by Strix. It includes settings for go2rtc streams and camera configurations for detection and recording, optimizing CPU usage. ```yaml go2rtc: streams: '192_168_1_100_main': - http://admin:pass@192.168.1.100:8000/video.mjpg '192_168_1_100_sub': - http://admin:pass@192.168.1.100:8000/video2.mjpg cameras: camera_192_168_1_100: ffmpeg: inputs: - path: rtsp://127.0.0.1:8554/192_168_1_100_sub roles: [detect] # CPU 8% instead of 70% - path: rtsp://127.0.0.1:8554/192_168_1_100_main roles: [record] # HD recording objects: track: [person, car, cat, dog] record: enabled: true ``` -------------------------------- ### Docker Compose Management (Bash) Source: https://context7.com/eduard256/strix/llms.txt These commands manage the Strix service deployed via Docker Compose. They are used to start the services in detached mode and view the logs. ```bash docker-compose up -d docker-compose logs -f strix ``` -------------------------------- ### Convert JPEG to RTSP Stream Source: https://github.com/eduard256/strix/blob/main/README.md Example go2rtc configuration to convert a static JPEG snapshot into an RTSP stream for use with Frigate. ```yaml go2rtc: streams: camera_main: - exec:ffmpeg -loop 1 -framerate 10 -i http://192.168.1.100/snapshot.jpg -c:v libx264 -f rtsp {output} ``` -------------------------------- ### Stream Discovery Progress and Results (SSE) Source: https://context7.com/eduard256/strix/llms.txt This example shows the Server-Sent Events (SSE) output during a stream discovery process. It includes progress updates, found streams with their details, and a final completion message. ```text event: progress data: {"type":"progress","data":{"tested":50,"found":0,"remaining":150}} event: stream_found data: {"type":"stream_found","stream":{"url":"rtsp://admin:password123@192.168.1.100:554/Streaming/Channels/101","type":"FFMPEG","protocol":"rtsp","port":554,"working":true,"resolution":"1920x1080","codec":"H264","fps":25,"bitrate":4096,"has_audio":true,"test_time_ms":1250}} event: stream_found data: {"type":"stream_found","stream":{"url":"rtsp://admin:password123@192.168.1.100:554/Streaming/Channels/102","type":"FFMPEG","protocol":"rtsp","port":554,"working":true,"resolution":"640x480","codec":"H264","fps":15,"bitrate":512,"has_audio":false,"test_time_ms":980}} event: complete data: {"type":"complete","data":{"total_tested":200,"total_found":3,"duration":45.5}} ``` -------------------------------- ### Build Strix from Source Source: https://context7.com/eduard256/strix/llms.txt Commands to compile the Strix binary locally or build custom Docker images for multi-platform deployment. ```bash git clone https://github.com/eduard256/Strix cd Strix make build ./bin/strix go build -o strix ./cmd/strix ./strix ``` ```bash docker build -t strix:local . docker buildx build \ --platform linux/amd64,linux/arm64 \ -t strix:multi \ --push . ``` -------------------------------- ### Apply URL Template Variables Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md Demonstrates how to replace template placeholders like {username}, {password}, and {ip} within a raw URL string to generate a functional connection string. ```text Template: rtsp://{username}:{password}@{ip}:{port}/live3.sdp Result: rtsp://admin:12345@192.168.1.100:554/live3.sdp ``` -------------------------------- ### Build Strix from Source Source: https://github.com/eduard256/strix/blob/main/README.md Commands to clone the repository and compile the Strix binary from source code. ```bash git clone https://github.com/eduard256/Strix cd Strix make build ./bin/strix ``` -------------------------------- ### Check Strix Container Health Status Source: https://github.com/eduard256/strix/blob/main/DOCKER.md This snippet provides two methods for checking the health of the Strix container. The first uses `docker inspect` to retrieve the health status directly from the Docker daemon, and the second performs a manual health check by executing a command inside the container. ```bash # Check container health docker inspect --format='{{.State.Health.Status}}' strix # Manual health check docker exec strix wget -q -O- http://localhost:4567/api/v1/health ``` -------------------------------- ### Deploy Strix with Docker Source: https://context7.com/eduard256/strix/llms.txt Command to run the Strix container using a local configuration file mounted as a read-only volume. ```bash docker run -d \ --name strix \ --network host \ -v $(pwd)/strix.yaml:/app/strix.yaml:ro \ eduard256/strix:latest ``` -------------------------------- ### Construct URL with Template Variables (Python) Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md Builds a URL by replacing template variables within the URL path, including standard credentials and IP, as well as additional keyword arguments like channel or resolution. ```python def build_url(entry, ip, username, password, **kwargs): url_path = entry["url"] # Replace template variables replacements = { "username": username, "password": password, "ip": ip, "port": str(entry["port"]), **kwargs # Additional variables (channel, width, height, etc.) } for key, value in replacements.items(): url_path = url_path.replace(f"{{{key}}}", value) # Build full URL if entry["protocol"] == "rtsp": return f"rtsp://{username}:{password}@{ip}:{entry['port']}/{url_path}" else: return f"{entry['protocol']}://{username}:{password}@{ip}:{entry['port']}/{url_path}" ``` -------------------------------- ### Construct HTTP URL (Python) Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md Builds an HTTP or HTTPS URL using provided entry details, IP address, username, and password. Dynamically sets the protocol based on the entry configuration. ```python def build_http_url(entry, ip, username, password): protocol = entry["protocol"] # "http" or "https" return f"{protocol}://{username}:{password}@{ip}:{entry['port']}/{entry['url']}" # Example: # http://admin:12345@192.168.1.100:80/video.cgi?resolution=VGA ``` -------------------------------- ### Configure Strix via Docker and YAML Source: https://github.com/eduard256/strix/blob/main/README.md Configuration options for Strix using environment variables in Docker or a local strix.yaml configuration file. ```yaml environment: - STRIX_API_LISTEN=:8080 # Custom port - STRIX_LOG_LEVEL=debug # Detailed logs - STRIX_LOG_FORMAT=json # JSON logging ``` ```yaml api: listen: ":8080" ``` -------------------------------- ### Load Brand Data (Python) Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md Loads brand-specific configuration data from a JSON file. Assumes the file path is constructed using the brand ID. ```python # Load brand file with open(f"data/brands/{brand_id}.json") as f: brand_data = json.load(f) ``` -------------------------------- ### Search Camera Database (Bash) Source: https://context7.com/eduard256/strix/llms.txt This POST request searches the Strix camera database for models matching a query string. It returns a list of matching cameras, including their URL patterns and metadata. ```bash curl -X POST http://localhost:4567/api/v1/cameras/search \ -H "Content-Type: application/json" \ -d '{ "query": "hikvision DS-2CD2032", "limit": 10 }' ``` -------------------------------- ### Custom Configuration File (YAML) Source: https://context7.com/eduard256/strix/llms.txt This YAML file demonstrates how to create a custom configuration for Strix. It allows overriding default settings such as the API listen address. ```yaml # strix.yaml api: listen: ":8080" # Custom port ``` -------------------------------- ### Discover Camera Streams via SSE (Bash) Source: https://context7.com/eduard256/strix/llms.txt This POST request initiates a camera stream discovery process using Server-Sent Events (SSE) for real-time progress updates. It requires camera credentials and target IP address. ```bash curl -X POST http://localhost:4567/api/v1/streams/discover \ -H "Content-Type: application/json" \ -H "Accept: text/event-stream" \ -d '{ "target": "192.168.1.100", "username": "admin", "password": "password123", "model": "DS-2CD2032-I", "channel": 0, "timeout": 240, "max_streams": 10, "model_limit": 6 }' ``` -------------------------------- ### Configure Frigate Camera YAML Source: https://github.com/eduard256/strix/blob/main/webui/CONFIG_GENERATORS.md Defines the camera structure including FFmpeg input roles for detection and recording, live stream settings, and object tracking parameters. ```yaml cameras: camera_192_168_1_100: ffmpeg: inputs: - path: rtsp://127.0.0.1:8554/192_168_1_100_sub input_args: preset-rtsp-restream roles: - detect - path: rtsp://127.0.0.1:8554/192_168_1_100_main input_args: preset-rtsp-restream roles: - record live: streams: Main Stream: 192_168_1_100_main Sub Stream: 192_168_1_100_sub objects: track: - person - car - cat - dog record: enabled: true ``` -------------------------------- ### Configure Frigate Camera Streams Source: https://context7.com/eduard256/strix/llms.txt YAML configurations for integrating cameras into Frigate, including single stream, dual-stream (main/sub) optimization, and JPEG-to-RTSP conversion via FFmpeg. ```yaml mqtt: enabled: false record: enabled: true retain: days: 7 mode: motion go2rtc: streams: '192_168_1_100_main': - rtsp://admin:password@192.168.1.100:554/Streaming/Channels/101 cameras: camera_192_168_1_100: ffmpeg: inputs: - path: rtsp://127.0.0.1:8554/192_168_1_100_main input_args: preset-rtsp-restream roles: - detect - record objects: track: - person - car - cat - dog record: enabled: true version: 0.16-0 ``` ```yaml mqtt: enabled: false record: enabled: true retain: days: 7 mode: motion go2rtc: streams: '192_168_1_100_main': - rtsp://admin:password@192.168.1.100:554/Streaming/Channels/101 '192_168_1_100_sub': - rtsp://admin:password@192.168.1.100:554/Streaming/Channels/102 cameras: camera_192_168_1_100: ffmpeg: inputs: - path: rtsp://127.0.0.1:8554/192_168_1_100_sub input_args: preset-rtsp-restream roles: - detect - path: rtsp://127.0.0.1:8554/192_168_1_100_main input_args: preset-rtsp-restream roles: - record objects: track: - person - car - cat - dog record: enabled: true version: 0.16-0 ``` ```yaml go2rtc: streams: '192_168_1_100_main': - exec:ffmpeg -loglevel quiet -f image2 -loop 1 -framerate 10 -i http://admin:pass@192.168.1.100/snapshot.jpg -c:v libx264 -preset ultrafast -tune zerolatency -g 20 -f rtsp {output} cameras: camera_192_168_1_100: ffmpeg: inputs: - path: rtsp://127.0.0.1:8554/192_168_1_100_main input_args: preset-rtsp-restream roles: - detect - record ``` -------------------------------- ### Fuzzy Search for Camera Models (Python) Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md Performs a case-insensitive, partial match search across all model names within the brand data. Returns entries where the query matches any part of a model name. ```python # Search across all models (case-insensitive, partial match) def search_model(brand_data, query): query = query.upper() results = [] for entry in brand_data["entries"]: if any(query in model.upper() for model in entry["models"]): results.append(entry) return results ``` -------------------------------- ### Docker Compose Deployment (YAML) Source: https://context7.com/eduard256/strix/llms.txt This docker-compose configuration defines a persistent deployment for Strix. It allows for environment variable configuration and volume mounting for custom settings. ```yaml # docker-compose.yml version: '3.8' services: strix: image: eduard256/strix:latest container_name: strix network_mode: host restart: unless-stopped environment: - STRIX_API_LISTEN=:4567 - STRIX_LOG_LEVEL=info - STRIX_LOG_FORMAT=json volumes: - ./strix.yaml:/app/strix.yaml:ro # Optional custom config ``` -------------------------------- ### Configure Frigate with Sub and Main Streams Source: https://github.com/eduard256/strix/blob/main/README.md Optimizes CPU usage by using a lower-resolution sub-stream for detection and a high-resolution main stream for recording. This configuration reduces CPU load by 5-10x. ```yaml inputs: - path: rtsp://127.0.0.1:8554/camera_sub # 640x480 for detect roles: [detect] - path: rtsp://127.0.0.1:8554/camera_main # 1920x1080 for record roles: [record] ``` -------------------------------- ### Find Camera Entries by Model Name (Python) Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md Filters brand data to find all entries associated with a specific model name. The search is case-insensitive. ```python # Find all entries for a specific model def find_model_entries(brand_data, model_name): return [ entry for entry in brand_data["entries"] if model_name.upper() in [m.upper() for m in entry["models"]] ] ``` -------------------------------- ### Prioritize Camera URLs by Type (Python) Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md Sorts camera model entries based on a predefined priority order for URL types (FFMPEG, MJPEG, JPEG, VLC). This ensures the best quality stream is attempted first. ```python def get_urls_for_model(brand_data, model_name): entries = [e for e in brand_data["entries"] if model_name in e["models"]] # Sort by priority priority = {"FFMPEG": 1, "MJPEG": 2, "JPEG": 3, "VLC": 4} entries.sort(key=lambda e: priority.get(e["type"], 99)) return entries ``` -------------------------------- ### Verify Network Connectivity Source: https://github.com/eduard256/strix/blob/main/README.md A simple command to verify if the camera is reachable on the local network. ```bash ping 192.168.1.100 ``` -------------------------------- ### Define Brand Index Structure Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md The index.json file serves as the master directory for all supported camera brands. It provides metadata including the brand identifier, display label, and counts of available models and entries. ```json [ { "value": "d-link", "label": "D-Link", "models_count": 250, "entries_count": 85, "logo": "/assets/brands/d-link.svg" }, { "value": "hikvision", "label": "Hikvision", "models_count": 320, "entries_count": 95, "logo": "/assets/brands/hikvision.svg" } ] ``` -------------------------------- ### Parse Brand Page Script (Python) Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md A Python script that scrapes camera information from a given brand's page on ispyconnect.com and formats it into a JSON structure compatible with the Strix project. It uses BeautifulSoup for HTML parsing and requests for fetching web content. ```python # scripts/parse_ispyconnect.py import requests from bs4 import BeautifulSoup import json def parse_brand_page(brand_id): url = f"https://www.ispyconnect.com/camera/{brand_id}" response = requests.get(url) soup = BeautifulSoup(response.text, 'html.parser') table = soup.find('table', class_='table-striped') entries = [] for row in table.find_all('tr')[1:]: cols = row.find_all('td') if len(cols) < 4: continue models_text = cols[0].get_text() models = [m.strip() for m in models_text.split(',')] entry = { "models": models, "type": cols[1].get_text(strip=True), "protocol": cols[2].get_text(strip=True).replace('://', ''), "port": int(row.get('data-port', 0)), "url": cols[3].get_text(strip=True) } entries.append(entry) return { "brand": brand_id.title(), "brand_id": brand_id, "last_updated": "2025-10-17", "source": "ispyconnect.com", "entries": entries } ``` -------------------------------- ### Validate Camera Entry Configuration (Python) Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md Validates a camera entry dictionary against required fields, data types, valid protocol and type values, and common port ranges for RTSP and HTTP. ```python def validate_entry(entry): # Required fields assert "models" in entry and isinstance(entry["models"], list) assert len(entry["models"]) > 0 assert "type" in entry and entry["type"] in ["FFMPEG", "MJPEG", "JPEG", "VLC", "H264"] assert "protocol" in entry and entry["protocol"] in ["rtsp", "http", "https"] assert "port" in entry and isinstance(entry["port"], int) assert "url" in entry and isinstance(entry["url"], str) # Port ranges assert 1 <= entry["port"] <= 65535 # Common ports check if entry["protocol"] == "rtsp": assert entry["port"] in [554, 8554, 7447] # Common RTSP ports elif entry["protocol"] == "http": assert entry["port"] in [80, 8080, 8000, 8081] # Common HTTP ports ``` -------------------------------- ### Define Brand Camera Database Structure Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md Each brand-specific JSON file contains detailed connection information and a list of entries. Each entry maps specific camera models to their respective streaming protocols and URL paths. ```json { "brand": "D-Link", "brand_id": "d-link", "last_updated": "2025-10-17", "source": "ispyconnect.com", "website": "https://www.dlink.com", "entries": [ { "models": ["DCS-930L", "DCS-930LB", "DCS-930LB1"], "type": "FFMPEG", "protocol": "rtsp", "port": 554, "url": "live3.sdp", "notes": "Main HD stream" } ] } ``` -------------------------------- ### Define URL Pattern Entry Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md An entry object defines the technical requirements for a camera stream, including the protocol, port, and URL path. It also specifies if authentication is required and which models are supported. ```json { "models": ["DCS-930L", "DCS-930LB", "DCS-930LB1"], "type": "FFMPEG", "protocol": "rtsp", "port": 554, "url": "live3.sdp", "auth_required": true, "notes": "Main HD stream with audio" } ``` -------------------------------- ### Enable Continuous Recording Source: https://github.com/eduard256/strix/blob/main/webui/CONFIG_GENERATORS.md Configures the record block to enable 24/7 continuous recording instead of the default motion-based mode. ```yaml record: enabled: true retain: days: 7 mode: all ``` -------------------------------- ### Generate Frigate and go2rtc Unified Configuration Source: https://github.com/eduard256/strix/blob/main/webui/CONFIG_GENERATORS.md Generates a unified Frigate configuration that integrates go2rtc. It intelligently routes detection to sub-streams to save CPU while using main-streams for high-quality recording. ```yaml mqtt: enabled: false record: enabled: true retain: days: 7 mode: motion go2rtc: streams: '192_168_1_100_main': - rtsp://admin:password@192.168.1.100/stream1 cameras: camera_192_168_1_100: ffmpeg: inputs: - path: rtsp://127.0.0.1:8554/192_168_1_100_main input_args: preset-rtsp-restream roles: - detect - record objects: track: - person - car - cat - dog record: enabled: true version: 0.16-0 ``` -------------------------------- ### Validate Brand File Script (Python) Source: https://github.com/eduard256/strix/blob/main/data/DATABASE_FORMAT.md A Python script designed to validate the structure and required fields of brand JSON files within the Strix project. It iterates through specified directories, loads JSON files, and asserts the presence of essential keys like 'brand', 'brand_id', and 'entries'. ```python # scripts/validate_database.py import json import os def validate_brand_file(filepath): with open(filepath) as f: data = json.load(f) assert "brand" in data assert "brand_id" in data assert "entries" in data for i, entry in enumerate(data["entries"]): assert "models" in entry, f"Entry {i} missing models" assert "type" in entry, f"Entry {i} missing type" assert "protocol" in entry, f"Entry {i} missing protocol" assert "port" in entry, f"Entry {i} missing port" assert "url" in entry, f"Entry {i} missing url" print(f"✅ {filepath} is valid") for file in os.listdir('data/brands/'): if file.endswith('.json') and file != 'index.json': validate_brand_file(f'data/brands/{file}') ```