From 89f4db617ab19e60e971fee71c7518498268d17c Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Sat, 10 Feb 2024 11:44:52 -0800 Subject: [PATCH] Docs: Fix and clarify which /dev/video devices to use with Raspberry Pi (#9509) * Docs: Fix and clarify which /dev/video devices to use with Raspberry Pi * Update docs/docs/configuration/hardware_acceleration.md Co-authored-by: Nicolas Mowen * Update docs/docs/configuration/hardware_acceleration.md Co-authored-by: Nicolas Mowen --------- Co-authored-by: Nicolas Mowen --- .../configuration/hardware_acceleration.md | 39 +++++++++++++++---- docs/docs/frigate/installation.md | 7 ++-- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/docs/docs/configuration/hardware_acceleration.md b/docs/docs/configuration/hardware_acceleration.md index ad9d27211..8bd303fdf 100644 --- a/docs/docs/configuration/hardware_acceleration.md +++ b/docs/docs/configuration/hardware_acceleration.md @@ -11,8 +11,8 @@ It is recommended to update your configuration to enable hardware accelerated de ## Raspberry Pi 3/4 -Ensure you increase the allocated RAM for your GPU to at least 128 (raspi-config > Performance Options > GPU Memory). -**NOTICE**: If you are using the addon, you may need to turn off `Protection mode` for hardware acceleration. +Ensure you increase the allocated RAM for your GPU to at least 128 (`raspi-config` > Performance Options > GPU Memory). +If you are using the HA addon, you may need to use the full access variant and turn off `Protection mode` for hardware acceleration. ```yaml # if you want to decode a h264 stream @@ -26,16 +26,39 @@ ffmpeg: :::note -If running Frigate in docker, you either need to run in priviliged mode or be sure to map the /dev/video1x devices to Frigate +If running Frigate in Docker, you either need to run in privileged mode or +map the `/dev/video*` devices to Frigate. With Docker compose add: ```yaml -docker run -d \ ---name frigate \ -... ---device /dev/video10 \ -ghcr.io/blakeblackshear/frigate:stable +services: + frigate: + ... + devices: + - /dev/video11:/dev/video11 ``` +Or with `docker run`: + +```bash +docker run -d \ + --name frigate \ + ... + --device /dev/video11 \ + ghcr.io/blakeblackshear/frigate:stable +``` + +`/dev/video11` is the correct device (on Raspberry Pi 4B). You can check +by running the following and looking for `H264`: + +```bash +for d in /dev/video*; do + echo -e "---\n$d" + v4l2-ctl --list-formats-ext -d $d +done +``` + +Or map in all the `/dev/video*` devices. + ::: ## Intel-based CPUs diff --git a/docs/docs/frigate/installation.md b/docs/docs/frigate/installation.md index fcdaa68ba..99565acf8 100644 --- a/docs/docs/frigate/installation.md +++ b/docs/docs/frigate/installation.md @@ -98,9 +98,10 @@ services: image: ghcr.io/blakeblackshear/frigate:stable shm_size: "64mb" # update for your cameras based on calculation above devices: - - /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions - - /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux - - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware + - /dev/bus/usb:/dev/bus/usb # Passes the USB Coral, needs to be modified for other versions + - /dev/apex_0:/dev/apex_0 # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux + - /dev/video11:/dev/video11 # For Raspberry Pi 4B + - /dev/dri/renderD128:/dev/dri/renderD128 # For intel hwaccel, needs to be updated for your hardware volumes: - /etc/localtime:/etc/localtime:ro - /path/to/your/config:/config