From e228e291589e2f546a407970800697f73277604d Mon Sep 17 00:00:00 2001 From: Rui Alves Date: Sat, 28 Sep 2024 21:28:52 +0100 Subject: [PATCH 01/15] Updated documentation --- docs/README.md | 2 +- docs/docs/development/contributing.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/README.md b/docs/README.md index bd4aded51f..29191980fe 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,5 +1,5 @@ # Website -This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator. +This website is built using [Docusaurus 3.5](https://docusaurus.io/docs), a modern static website generator. For installation and contributing instructions, please follow the [Contributing Docs](https://docs.frigate.video/development/contributing). diff --git a/docs/docs/development/contributing.md b/docs/docs/development/contributing.md index a86b768ff9..32fc13e1f0 100644 --- a/docs/docs/development/contributing.md +++ b/docs/docs/development/contributing.md @@ -193,7 +193,7 @@ npm run test #### 1. Installation ```console -npm install +cd docs && npm install ``` #### 2. Local Development From c4e30ca8845bcd14ec372a77621c2fa1721decc8 Mon Sep 17 00:00:00 2001 From: Rui Alves Date: Sun, 29 Sep 2024 11:09:14 +0100 Subject: [PATCH 02/15] docusaurus.config and sidebars converted to Typescript to allow for typings --- docs/docusaurus.config.js | 102 -------------------------------------- docs/docusaurus.config.ts | 102 ++++++++++++++++++++++++++++++++++++++ docs/sidebars.js | 87 -------------------------------- docs/sidebars.ts | 87 ++++++++++++++++++++++++++++++++ 4 files changed, 189 insertions(+), 189 deletions(-) delete mode 100644 docs/docusaurus.config.js create mode 100644 docs/docusaurus.config.ts delete mode 100644 docs/sidebars.js create mode 100644 docs/sidebars.ts diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js deleted file mode 100644 index 092db42007..0000000000 --- a/docs/docusaurus.config.js +++ /dev/null @@ -1,102 +0,0 @@ -const path = require("path"); - -module.exports = { - title: "Frigate", - tagline: "NVR With Realtime Object Detection for IP Cameras", - url: "https://docs.frigate.video", - baseUrl: "/", - onBrokenLinks: "throw", - onBrokenMarkdownLinks: "warn", - favicon: "img/favicon.ico", - organizationName: "blakeblackshear", - projectName: "frigate", - themes: ["@docusaurus/theme-mermaid"], - markdown: { - mermaid: true, - }, - themeConfig: { - algolia: { - appId: "WIURGBNBPY", - apiKey: "d02cc0a6a61178b25da550212925226b", - indexName: "frigate", - }, - docs: { - sidebar: { - hideable: true, - }, - }, - prism: { - additionalLanguages: ["bash", "json"], - }, - navbar: { - title: "Frigate", - logo: { - alt: "Frigate", - src: "img/logo.svg", - srcDark: "img/logo-dark.svg", - }, - items: [ - { - to: "/", - activeBasePath: "docs", - label: "Docs", - position: "left", - }, - { - href: "https://frigate.video", - label: "Website", - position: "right", - }, - { - href: "http://demo.frigate.video", - label: "Demo", - position: "right", - }, - { - href: "https://github.com/blakeblackshear/frigate", - label: "GitHub", - position: "right", - }, - ], - }, - footer: { - style: "dark", - links: [ - { - title: "Community", - items: [ - { - label: "GitHub", - href: "https://github.com/blakeblackshear/frigate", - }, - { - label: "Discussions", - href: "https://github.com/blakeblackshear/frigate/discussions", - }, - ], - }, - ], - copyright: `Copyright © ${new Date().getFullYear()} Blake Blackshear`, - }, - }, - plugins: [path.resolve(__dirname, "plugins", "raw-loader")], - presets: [ - [ - "@docusaurus/preset-classic", - { - docs: { - routeBasePath: "/", - sidebarPath: require.resolve("./sidebars.js"), - // Please change this to your repo. - editUrl: - "https://github.com/blakeblackshear/frigate/edit/master/docs/", - sidebarCollapsible: false, - }, - - theme: { - customCss: require.resolve("./src/css/custom.css"), - }, - }, - ], - ], -}; diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts new file mode 100644 index 0000000000..6dc417d265 --- /dev/null +++ b/docs/docusaurus.config.ts @@ -0,0 +1,102 @@ +import type * as Preset from '@docusaurus/preset-classic'; +import * as path from 'node:path'; + +module.exports = { + title: 'Frigate', + tagline: 'NVR With Realtime Object Detection for IP Cameras', + url: 'https://docs.frigate.video', + baseUrl: '/', + onBrokenLinks: 'throw', + onBrokenMarkdownLinks: 'warn', + favicon: 'img/favicon.ico', + organizationName: 'blakeblackshear', + projectName: 'frigate', + themes: ['@docusaurus/theme-mermaid'], + markdown: { + mermaid: true, + }, + themeConfig: { + algolia: { + appId: 'WIURGBNBPY', + apiKey: 'd02cc0a6a61178b25da550212925226b', + indexName: 'frigate', + }, + docs: { + sidebar: { + hideable: true, + }, + }, + prism: { + additionalLanguages: ['bash', 'json'], + }, + navbar: { + title: 'Frigate', + logo: { + alt: 'Frigate', + src: 'img/logo.svg', + srcDark: 'img/logo-dark.svg', + }, + items: [ + { + to: '/', + activeBasePath: 'docs', + label: 'Docs', + position: 'left', + }, + { + href: 'https://frigate.video', + label: 'Website', + position: 'right', + }, + { + href: 'http://demo.frigate.video', + label: 'Demo', + position: 'right', + }, + { + href: 'https://github.com/blakeblackshear/frigate', + label: 'GitHub', + position: 'right', + }, + ], + }, + footer: { + style: 'dark', + links: [ + { + title: 'Community', + items: [ + { + label: 'GitHub', + href: 'https://github.com/blakeblackshear/frigate', + }, + { + label: 'Discussions', + href: 'https://github.com/blakeblackshear/frigate/discussions', + }, + ], + }, + ], + copyright: `Copyright © ${new Date().getFullYear()} Blake Blackshear`, + }, + }, + plugins: [path.resolve(__dirname, 'plugins', 'raw-loader')], + presets: [ + [ + '@docusaurus/preset-classic', + { + docs: { + routeBasePath: '/', + sidebarPath: require.resolve('./sidebars.js'), + // Please change this to your repo. + editUrl: 'https://github.com/blakeblackshear/frigate/edit/master/docs/', + sidebarCollapsible: false, + }, + + theme: { + customCss: require.resolve('./src/css/custom.css'), + }, + } satisfies Preset.Options, + ], + ], +}; diff --git a/docs/sidebars.js b/docs/sidebars.js deleted file mode 100644 index 9a6ba0df9d..0000000000 --- a/docs/sidebars.js +++ /dev/null @@ -1,87 +0,0 @@ -module.exports = { - docs: { - Frigate: [ - "frigate/index", - "frigate/hardware", - "frigate/installation", - "frigate/camera_setup", - "frigate/video_pipeline", - "frigate/glossary", - ], - Guides: [ - "guides/getting_started", - "guides/configuring_go2rtc", - "guides/ha_notifications", - "guides/ha_network_storage", - "guides/reverse_proxy", - ], - Configuration: { - "Configuration Files": [ - "configuration/index", - "configuration/reference", - { - type: "link", - label: "Go2RTC Configuration Reference", - href: "https://github.com/AlexxIT/go2rtc/tree/v1.9.4#configuration", - }, - ], - Detectors: [ - "configuration/object_detectors", - "configuration/audio_detectors", - ], - "Semantic Search": [ - "configuration/semantic_search", - "configuration/genai", - ], - Cameras: [ - "configuration/cameras", - "configuration/review", - "configuration/record", - "configuration/snapshots", - "configuration/motion_detection", - "configuration/birdseye", - "configuration/live", - "configuration/restream", - "configuration/autotracking", - "configuration/camera_specific", - ], - Objects: [ - "configuration/object_filters", - "configuration/masks", - "configuration/zones", - "configuration/objects", - "configuration/stationary_objects", - ], - "Extra Configuration": [ - "configuration/authentication", - "configuration/notifications", - "configuration/hardware_acceleration", - "configuration/ffmpeg_presets", - "configuration/tls", - "configuration/advanced", - ], - }, - Integrations: [ - "integrations/plus", - "integrations/home-assistant", - "integrations/api", - "integrations/mqtt", - "integrations/third_party_extensions", - ], - "Frigate+": [ - "plus/index", - "plus/first_model", - "plus/improving_model", - "plus/faq", - ], - Troubleshooting: [ - "troubleshooting/faqs", - "troubleshooting/recordings", - "troubleshooting/edgetpu", - ], - Development: [ - "development/contributing", - "development/contributing-boards", - ], - }, -}; diff --git a/docs/sidebars.ts b/docs/sidebars.ts new file mode 100644 index 0000000000..f4567c4420 --- /dev/null +++ b/docs/sidebars.ts @@ -0,0 +1,87 @@ +module.exports = { + docs: { + Frigate: [ + 'frigate/index', + 'frigate/hardware', + 'frigate/installation', + 'frigate/camera_setup', + 'frigate/video_pipeline', + 'frigate/glossary', + ], + Guides: [ + 'guides/getting_started', + 'guides/configuring_go2rtc', + 'guides/ha_notifications', + 'guides/ha_network_storage', + 'guides/reverse_proxy', + ], + Configuration: { + 'Configuration Files': [ + 'configuration/index', + 'configuration/reference', + { + type: 'link', + label: 'Go2RTC Configuration Reference', + href: 'https://github.com/AlexxIT/go2rtc/tree/v1.9.4#configuration', + }, + ], + Detectors: [ + 'configuration/object_detectors', + 'configuration/audio_detectors', + ], + 'Semantic Search': [ + 'configuration/semantic_search', + 'configuration/genai', + ], + Cameras: [ + 'configuration/cameras', + 'configuration/review', + 'configuration/record', + 'configuration/snapshots', + 'configuration/motion_detection', + 'configuration/birdseye', + 'configuration/live', + 'configuration/restream', + 'configuration/autotracking', + 'configuration/camera_specific', + ], + Objects: [ + 'configuration/object_filters', + 'configuration/masks', + 'configuration/zones', + 'configuration/objects', + 'configuration/stationary_objects', + ], + 'Extra Configuration': [ + 'configuration/authentication', + 'configuration/notifications', + 'configuration/hardware_acceleration', + 'configuration/ffmpeg_presets', + 'configuration/tls', + 'configuration/advanced', + ], + }, + Integrations: [ + 'integrations/plus', + 'integrations/home-assistant', + 'integrations/api', + 'integrations/mqtt', + 'integrations/third_party_extensions', + ], + 'Frigate+': [ + 'plus/index', + 'plus/first_model', + 'plus/improving_model', + 'plus/faq', + ], + Troubleshooting: [ + 'troubleshooting/faqs', + 'troubleshooting/recordings', + 'troubleshooting/edgetpu', + ], + Development: [ + 'development/contributing', + 'development/contributing-boards', + ], + }, +}; From a504468955d6b3369c9d4c73205f0a9604c481d2 Mon Sep 17 00:00:00 2001 From: Rui Alves Date: Sun, 29 Sep 2024 11:11:07 +0100 Subject: [PATCH 03/15] Added type for sidebars.ts --- docs/sidebars.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/sidebars.ts b/docs/sidebars.ts index f4567c4420..85d36cfb7d 100644 --- a/docs/sidebars.ts +++ b/docs/sidebars.ts @@ -1,4 +1,6 @@ -module.exports = { +import type { SidebarsConfig } from "@docusaurus/plugin-content-docs"; + +const sidebars: SidebarsConfig = { docs: { Frigate: [ 'frigate/index', @@ -85,3 +87,5 @@ module.exports = { ], }, }; + +export default sidebars; From 40e7cc48e8b46ad26e8403f4664f132f7456b8a7 Mon Sep 17 00:00:00 2001 From: Rui Alves Date: Sun, 6 Oct 2024 17:21:56 +0100 Subject: [PATCH 04/15] Replaced integrations/api.md with automatically generated openAPI specification. Make sidebar collapsible to increase readability --- docs/README.md | 5 + docs/docs/integrations/api.md | 534 -- docs/docusaurus.config.ts | 64 +- docs/package-lock.json | 15677 +++++++++++++++++++++----------- docs/package.json | 14 +- docs/sidebars.ts | 19 +- docs/static/frigate-api.yaml | 3312 +++++++ 7 files changed, 13520 insertions(+), 6105 deletions(-) delete mode 100644 docs/docs/integrations/api.md create mode 100644 docs/static/frigate-api.yaml diff --git a/docs/README.md b/docs/README.md index 29191980fe..68b27e15a9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,3 +3,8 @@ This website is built using [Docusaurus 3.5](https://docusaurus.io/docs), a modern static website generator. For installation and contributing instructions, please follow the [Contributing Docs](https://docs.frigate.video/development/contributing). + +# Development + +1. Run `npm i` to install dependencies +2. Run `npm run start` to start the website diff --git a/docs/docs/integrations/api.md b/docs/docs/integrations/api.md deleted file mode 100644 index edbb3d8811..0000000000 --- a/docs/docs/integrations/api.md +++ /dev/null @@ -1,534 +0,0 @@ ---- -id: api -title: HTTP API ---- - -A web server is available on port 5000 with the following endpoints. - -## Management & Information - -### `GET /api/config` - -A json representation of your configuration - -### `POST /api/restart` - -Restarts Frigate process. - -### `GET /api/stats` - -Contains some granular debug info that can be used for sensors in Home Assistant. - -Sample response: - -```json -{ - /* Per Camera Stats */ - "cameras": { - "back": { - /*************** - * Frames per second being consumed from your camera. If this is higher - * than it is supposed to be, you should set -r FPS in your input_args. - * camera_fps = process_fps + skipped_fps - ***************/ - "camera_fps": 5.0, - /*************** - * Number of times detection is run per second. This can be higher than - * your camera FPS because Frigate often looks at the same frame multiple times - * or in multiple locations - ***************/ - "detection_fps": 1.5, - /*************** - * PID for the ffmpeg process that consumes this camera - ***************/ - "capture_pid": 27, - /*************** - * PID for the process that runs detection for this camera - ***************/ - "pid": 34, - /*************** - * Frames per second being processed by Frigate. - ***************/ - "process_fps": 5.1, - /*************** - * Frames per second skip for processing by Frigate. - ***************/ - "skipped_fps": 0.0 - } - }, - /*************** - * Sum of detection_fps across all cameras and detectors. - * This should be the sum of all detection_fps values from cameras. - ***************/ - "detection_fps": 5.0, - /* Detectors Stats */ - "detectors": { - "coral": { - /*************** - * Timestamp when object detection started. If this value stays non-zero and constant - * for a long time, that means the detection process is stuck. - ***************/ - "detection_start": 0.0, - /*************** - * Time spent running object detection in milliseconds. - ***************/ - "inference_speed": 10.48, - /*************** - * PID for the shared process that runs object detection on the Coral. - ***************/ - "pid": 25321 - } - }, - "service": { - /* Uptime in seconds */ - "uptime": 10, - "version": "0.10.1-8883709", - "latest_version": "0.10.1", - /* Storage data in MB for important locations */ - "storage": { - "/media/frigate/clips": { - "total": 1000, - "used": 700, - "free": 300, - "mnt_type": "ext4" - }, - "/media/frigate/recordings": { - "total": 1000, - "used": 700, - "free": 300, - "mnt_type": "ext4" - }, - "/tmp/cache": { - "total": 256, - "used": 100, - "free": 156, - "mnt_type": "tmpfs" - }, - "/dev/shm": { - "total": 256, - "used": 100, - "free": 156, - "mnt_type": "tmpfs" - } - } - }, - "cpu_usages": { - "pid": { - "cmdline": "ffmpeg...", - "cpu": "5.0", - "cpu_average": "3.0", - "mem": "0.5" - } - }, - "gpu_usages": { - "gpu-type": { - "gpu": "17%", - "mem": "18%" - } - } -} -``` - -### `GET /api/version` - -Version info - -### `GET /api/ffprobe` - -Get ffprobe output for camera feed paths. - -| param | Type | Description | -| ------- | ------ | ---------------------------------- | -| `paths` | string | `,` separated list of camera paths | - -### `GET /api//ptz/info` - -Get PTZ info for the camera. - -## Camera Media - -### `GET /api/` - -An mjpeg stream for debugging. Keep in mind the mjpeg endpoint is for debugging only and will put additional load on the system when in use. - -Accepts the following query string parameters: - -| param | Type | Description | -| ----------- | ---- | ------------------------------------------------------------------ | -| `fps` | int | Frame rate | -| `h` | int | Height in pixels | -| `bbox` | int | Show bounding boxes for detected objects (0 or 1) | -| `timestamp` | int | Print the timestamp in the upper left (0 or 1) | -| `zones` | int | Draw the zones on the image (0 or 1) | -| `mask` | int | Overlay the mask on the image (0 or 1) | -| `motion` | int | Draw blue boxes for areas with detected motion (0 or 1) | -| `regions` | int | Draw green boxes for areas where object detection was run (0 or 1) | - -You can access a higher resolution mjpeg stream by appending `h=height-in-pixels` to the endpoint. For example `/api/back?h=1080`. You can also increase the FPS by appending `fps=frame-rate` to the URL such as `/api/back?fps=10` or both with `?fps=10&h=1000`. - -### `GET /api//latest.jpg[?h=300]` - -The most recent frame that Frigate has finished processing. It is a full resolution image by default. - -Accepts the following query string parameters: - -| param | Type | Description | -| ----------- | ---- | ------------------------------------------------------------------ | -| `h` | int | Height in pixels | -| `bbox` | int | Show bounding boxes for detected objects (0 or 1) | -| `timestamp` | int | Print the timestamp in the upper left (0 or 1) | -| `zones` | int | Draw the zones on the image (0 or 1) | -| `mask` | int | Overlay the mask on the image (0 or 1) | -| `motion` | int | Draw blue boxes for areas with detected motion (0 or 1) | -| `regions` | int | Draw green boxes for areas where object detection was run (0 or 1) | -| `quality` | int | Jpeg encoding quality (0-100). Defaults to 70. | - -Example parameters: - -- `h=300`: resizes the image to 300 pixels tall - -### `GET /api//