diff --git a/docs/docs/integrations/api.md b/docs/docs/integrations/api.md index 510a8a3c8..90de38832 100644 --- a/docs/docs/integrations/api.md +++ b/docs/docs/integrations/api.md @@ -5,45 +5,15 @@ title: HTTP API A web server is available on port 5000 with the following endpoints. -### `GET /api/` +## Management & Information -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. +### `GET /api/config` -Accepts the following query string parameters: +A json representation of your configuration -| 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) | +### `POST /api/restart` -You can access a higher resolution mjpeg stream by appending `h=height-in-pixels` to the endpoint. For example `http://localhost:5000/api/back?h=1080`. You can also increase the FPS by appending `fps=frame-rate` to the URL such as `http://localhost:5000/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 +Restarts Frigate process. ### `GET /api/stats` @@ -54,35 +24,37 @@ Sample response: ```json { /* Per Camera Stats */ - "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 + "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. @@ -139,18 +111,109 @@ Sample response: "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/config` - -A json representation of your configuration - ### `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 `http://localhost:5000/api/back?h=1080`. You can also increase the FPS by appending `fps=frame-rate` to the URL such as `http://localhost:5000/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//