frigate_nvr_installation
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
frigate_nvr_installation [2024/12/06 15:40] – created mark_scottworld.net | frigate_nvr_installation [2025/02/09 17:06] (current) – mark_scottworld.net | ||
---|---|---|---|
Line 33: | Line 33: | ||
| | ||
Stop the services | Stop the services | ||
+ | |||
+ | < | ||
+ | systemctl stop docker.service | ||
+ | systemctl stop docker.socket | ||
+ | systemctl stop containerd.service | ||
+ | </ | ||
+ | |||
+ | Move the Docker root directory: (optional) | ||
+ | |||
+ | mv / | ||
+ | | ||
+ | Edit the systemd service for Docker: | ||
+ | |||
+ | systemctl edit docker.service (only if moving) | ||
+ | | ||
+ | Add the following to the top of the override file: | ||
+ | |||
+ | < | ||
+ | [Service] | ||
+ | ExecStart= | ||
+ | ExecStart=/ | ||
+ | </ | ||
+ | | ||
+ | Restart Docker: | ||
+ | |||
+ | systemctl daemon-reload | ||
+ | systemctl start docker.service | ||
+ | | ||
+ | Check it still works with: | ||
+ | |||
+ | docker run hello-world | ||
+ | | ||
+ | ===== GPU Hardware Acceleration ===== | ||
+ | |||
+ | Download and save the NVIDIA repository signing key: | ||
+ | |||
+ | curl -fsSL https:// | ||
+ | | ||
+ | Add the Docker repository in / | ||
+ | |||
+ | deb [signed-by=/ | ||
+ | | ||
+ | Allow unattended updates from this repository by add to / | ||
+ | |||
+ | < | ||
+ | Unattended-Upgrade:: | ||
+ | " | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | Update the repositories and install the package: | ||
+ | |||
+ | < | ||
+ | apt update | ||
+ | apt install nvidia-docker2 | ||
+ | </ | ||
+ | |||
+ | Restart Docker: | ||
+ | |||
+ | systemctl restart docker.service | ||
+ | | ||
+ | |||
+ | |||
+ | ===== Frigate ===== | ||
+ | |||
+ | If using ZFS, create a filesystem to store the video recordings (not used currently) | ||
+ | |||
+ | zfs create -o recordsize=1M -o compression=off -o quota=256G data/cctv | ||
+ | | ||
+ | Create a configuration directory for Frigate: | ||
+ | |||
+ | mkdir / | ||
+ | | ||
+ | Create / | ||
+ | |||
+ | < | ||
+ | version: " | ||
+ | services: | ||
+ | frigate: | ||
+ | container_name: | ||
+ | privileged: true # this may not be necessary for all setups | ||
+ | restart: unless-stopped | ||
+ | image: ghcr.io/ | ||
+ | network_mode: | ||
+ | deploy: | ||
+ | resources: | ||
+ | reservations: | ||
+ | devices: | ||
+ | - driver: nvidia | ||
+ | count: 1 | ||
+ | capabilities: | ||
+ | shm_size: " | ||
+ | # | ||
+ | # - / | ||
+ | volumes: | ||
+ | - / | ||
+ | # - / | ||
+ | - / | ||
+ | - / | ||
+ | - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear | ||
+ | target: /tmp/cache | ||
+ | tmpfs: | ||
+ | size: 1000000000 | ||
+ | ports: | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | environment: | ||
+ | # - FRIGATE_RTSP_PASSWORD: | ||
+ | - YOLO_MODELS=yolov7-tiny-416 | ||
+ | </ | ||
+ | |||
+ | Create / | ||
+ | |||
+ | < | ||
+ | version: 0.14 | ||
+ | |||
+ | mqtt: | ||
+ | host: mqtt.scottworld.net | ||
+ | user: scottbroker | ||
+ | password: mqtt1 | ||
+ | |||
+ | #detectors: | ||
+ | # coral: | ||
+ | # type: edgetpu | ||
+ | # device: usb | ||
+ | |||
+ | detectors: | ||
+ | tensorrt: | ||
+ | type: tensorrt | ||
+ | device: 0 | ||
+ | |||
+ | model: | ||
+ | path: / | ||
+ | input_tensor: | ||
+ | input_pixel_format: | ||
+ | width: 416 | ||
+ | height: 416 | ||
+ | |||
+ | ffmpeg: | ||
+ | hwaccel_args: | ||
+ | input_args: preset-http-reolink | ||
+ | output_args: | ||
+ | record: preset-record-generic-audio-copy | ||
+ | |||
+ | timestamp_style: | ||
+ | format: ' | ||
+ | |||
+ | go2rtc: | ||
+ | streams: | ||
+ | FrontCam: | ||
+ | - ffmpeg: | ||
+ | BackCam: | ||
+ | - ffmpeg: | ||
+ | Doorbell: | ||
+ | - ffmpeg: | ||
+ | |||
+ | cameras: | ||
+ | FrontCam: | ||
+ | ffmpeg: | ||
+ | inputs: | ||
+ | - path: | ||
+ | http:// | ||
+ | roles: | ||
+ | - detect | ||
+ | - path: rtsp:// | ||
+ | input_args: preset-rtsp-restream | ||
+ | roles: | ||
+ | - record | ||
+ | motion: | ||
+ | mask: 1, | ||
+ | objects: | ||
+ | track: | ||
+ | - person | ||
+ | - car | ||
+ | - bicycle | ||
+ | - motorcycle | ||
+ | zones: | ||
+ | front_drive: | ||
+ | coordinates: | ||
+ | objects: | ||
+ | - person | ||
+ | - car | ||
+ | - bicycle | ||
+ | - motorcycle | ||
+ | inertia: 3 | ||
+ | loitering_time: | ||
+ | review: | ||
+ | alerts: | ||
+ | required_zones: | ||
+ | - front_drive | ||
+ | |||
+ | BackCam: | ||
+ | ffmpeg: | ||
+ | inputs: | ||
+ | - path: | ||
+ | http:// | ||
+ | roles: | ||
+ | - detect | ||
+ | - path: rtsp:// | ||
+ | input_args: preset-rtsp-restream | ||
+ | roles: | ||
+ | - record | ||
+ | motion: | ||
+ | mask: 1, | ||
+ | objects: | ||
+ | track: | ||
+ | - person | ||
+ | - cat | ||
+ | - bird | ||
+ | zones: | ||
+ | back_garden: | ||
+ | coordinates: | ||
+ | objects: | ||
+ | - person | ||
+ | - cat | ||
+ | - bird | ||
+ | inertia: 3 | ||
+ | loitering_time: | ||
+ | review: | ||
+ | alerts: | ||
+ | required_zones: | ||
+ | - back_garden | ||
+ | |||
+ | Doorbell: | ||
+ | ffmpeg: | ||
+ | inputs: | ||
+ | - path: | ||
+ | http:// | ||
+ | roles: | ||
+ | - detect | ||
+ | - path: rtsp:// | ||
+ | input_args: preset-rtsp-restream | ||
+ | roles: | ||
+ | - record | ||
+ | motion: | ||
+ | mask: 1, | ||
+ | objects: | ||
+ | track: | ||
+ | - person | ||
+ | zones: | ||
+ | front_porch: | ||
+ | coordinates: | ||
+ | objects: person | ||
+ | inertia: 3 | ||
+ | loitering_time: | ||
+ | review: | ||
+ | alerts: | ||
+ | required_zones: | ||
+ | - front_porch | ||
+ | |||
+ | birdseye: | ||
+ | enabled: true | ||
+ | mode: motion | ||
+ | |||
+ | record: | ||
+ | sync_recordings: | ||
+ | enabled: true | ||
+ | retain: | ||
+ | days: 7 | ||
+ | mode: motion | ||
+ | events: | ||
+ | retain: | ||
+ | default: 28 | ||
+ | mode: active_objects | ||
+ | |||
+ | snapshots: | ||
+ | enabled: true | ||
+ | |||
+ | </ | ||
+ | |||
+ | Start Frigate with: | ||
+ | |||
+ | docker compose -f / | ||
+ | | ||
+ | Visit the Frigate interface via: | ||
+ | |||
+ | http:// | ||
+ | | ||
+ | Update the Image with | ||
+ | |||
+ | docker compose -f / | ||
+ | docker compose -f / | ||
+ | docker compose -f / | ||
+ | | ||
+ | docker image prune | ||
+ | docker container prune | ||
+ | (on an upgrade) |
frigate_nvr_installation.1733496006.txt.gz · Last modified: 2024/12/06 15:40 by mark_scottworld.net