Loading...
Loading...
Compare original and translation side by side
Comprehensive Frigate NVR configuration assistance with optimized YAML generation, detector setup, and troubleshooting.
提供全面的Frigate NVR配置支持,包括优化的YAML生成、检测器设置和故障排查。
| Metric | Without Skill | With Skill |
|---|---|---|
| Setup Time | 2-4 hours | 30-45 min |
| Common Errors | 12+ | 0 |
| Token Usage | ~15,000 | ~6,000 |
| 指标 | 未使用本技能 | 使用本技能 |
|---|---|---|
| 部署时间 | 2-4小时 | 30-45分钟 |
| 常见错误 | 12+ | 0 |
| Token消耗 | ~15,000 | ~6,000 |
mqtt:
enabled: false
cameras:
front_door:
ffmpeg:
inputs:
- path: rtsp://user:pass@192.168.1.100:554/stream1
roles:
- detect
detect:
width: 1280
height: 720
fps: 5mqtt:
enabled: false
cameras:
front_door:
ffmpeg:
inputs:
- path: rtsp://user:pass@192.168.1.100:554/stream1
roles:
- detect
detect:
width: 1280
height: 720
fps: 5detectors:
coral:
type: edgetpu
device: usbdetectors:
coral:
type: edgetpu
device: usb
**Why this matters:** CPU detection is not recommended for production. Even a single USB Coral TPU dramatically reduces CPU usage and improves detection latency.
**为什么这很重要:** 不推荐在生产环境中使用CPU进行检测。即使是一个USB Coral TPU也能显著降低CPU占用并提升检测延迟。record:
enabled: true
retain:
days: 1
mode: motion
alerts:
retain:
days: 14
detections:
retain:
days: 7
cameras:
front_door:
ffmpeg:
inputs:
- path: rtsp://user:pass@192.168.1.100:554/stream1
roles:
- detect
- path: rtsp://user:pass@192.168.1.100:554/stream2
roles:
- recordrecord:
enabled: true
retain:
days: 1
mode: motion
alerts:
retain:
days: 14
detections:
retain:
days: 7
cameras:
front_door:
ffmpeg:
inputs:
- path: rtsp://user:pass@192.168.1.100:554/stream1
roles:
- detect
- path: rtsp://user:pass@192.168.1.100:554/stream2
roles:
- recordwidthheightdetectdetectrecordshm-size{FRIGATE_RTSP_PASSWORD}widthheightdetectdetectrecordshm-size{FRIGATE_RTSP_PASSWORD}localhost127.0.0.1/media/frigatelocalhost127.0.0.1/media/frigatecameras:
cam1:
ffmpeg:
inputs:
- path: rtsp://192.168.1.100/stream
roles:
- detect
- record
detect:
width: 1920
height: 1080
fps: 30cameras:
cam1:
ffmpeg:
inputs:
- path: rtsp://192.168.1.100/substream
roles:
- detect
- path: rtsp://192.168.1.100/mainstream
roles:
- record
detect:
width: 1280
height: 720
fps: 5cameras:
cam1:
ffmpeg:
inputs:
- path: rtsp://192.168.1.100/stream
roles:
- detect
- record
detect:
width: 1920
height: 1080
fps: 30cameras:
cam1:
ffmpeg:
inputs:
- path: rtsp://192.168.1.100/substream
roles:
- detect
- path: rtsp://192.168.1.100/mainstream
roles:
- record
detect:
width: 1280
height: 720
fps: 5| Issue | Root Cause | Solution |
|---|---|---|
| Bus Error | Insufficient shared memory | Set |
| Database Locked | SQLite on network storage | Use |
| Green/Distorted Video | Wrong resolution in config | Match camera's actual output resolution |
| No Audio in Recordings | Default audio removal | Use |
| MQTT Connection Failed | localhost in Docker | Use host IP address instead |
| Coral Not Detected | Missing device passthrough | Add |
| High CPU Usage | Missing hwaccel | Add appropriate preset (vaapi/qsv/nvidia) |
| Missing Alerts | No required_zones | Configure zones with review.alerts.required_zones |
| UDP Stream Failures | TCP is default in Frigate | Add |
| 问题 | 根本原因 | 解决方案 |
|---|---|---|
| 总线错误 | 共享内存不足 | 在docker-compose中设置 |
| 数据库锁定 | SQLite存储在网络存储 | 使用 |
| 画面绿屏/失真 | 配置的分辨率错误 | 匹配摄像头的实际输出分辨率 |
| 录像无音频 | 默认移除音频 | 使用 |
| MQTT连接失败 | Docker内使用localhost | 使用主机IP地址替代 |
| Coral TPU未被识别 | 未进行设备透传 | 在Docker设备映射中添加 |
| CPU占用过高 | 未启用硬件加速 | 添加对应的预设(vaapi/qsv/nvidia) |
| 无警报触发 | 未配置required_zones | 通过review.alerts.required_zones配置区域 |
| UDP流失败 | Frigate默认使用TCP | 在输入参数中添加 |
undefinedundefined
**Key settings:**
- `detect.fps`: 5 is optimal for most cameras (reduces detector load)
- `detect.width/height`: Must match actual camera sub-stream resolution
- `record.retain.mode`: Use `motion` or `active_objects` to save storage
- `motion.mask`: Define polygons as comma-separated coordinates
- `zones.coordinates`: Bottom-center of bounding box determines zone presence
**关键设置:**
- `detect.fps`:对于大多数摄像头来说,5是最优值(可降低检测器负载)
- `detect.width/height`:必须与摄像头子流的实际分辨率匹配
- `record.retain.mode`:使用`motion`或`active_objects`以节省存储空间
- `motion.mask`:用逗号分隔的坐标定义多边形
- `zones.coordinates`:目标框的底部中心位置决定其所属区域undefinedundefinedundefinedundefinedffmpeg:
hwaccel_args: preset-nvidiaundefinedffmpeg:
hwaccel_args: preset-nvidiaundefinedundefinedundefinedffmpeg:
hwaccel_args: preset-vaapiffmpeg:
hwaccel_args: preset-vaapiundefinedundefinedundefinedundefined
Requires: `gpu_mem=128` in `/boot/config.txt` and device mapping in Docker.
要求:在`/boot/config.txt`中设置`gpu_mem=128`,并在Docker中进行设备映射。detectors:
coral:
type: edgetpu
device: usb # Single USB Coral
# device: usb:0 # First of multiple USB Coralsdevices:
- /dev/bus/usb:/dev/bus/usbdetectors:
coral:
type: edgetpu
device: usb # 单个USB Coral
# device: usb:0 # 多个USB Coral中的第一个devices:
- /dev/bus/usb:/dev/bus/usbdetectors:
coral:
type: edgetpu
device: pci
# device: pci:0 # First of multiple PCIe Coralsdetectors:
coral:
type: edgetpu
device: pci
# device: pci:0 # 多个PCIe Coral中的第一个detectors:
ov:
type: openvino
device: GPU # or CPU
model:
path: /openvino-model/ssdlite_mobilenet_v2.xml
width: 300
height: 300detectors:
ov:
type: openvino
device: GPU # 或CPU
model:
path: /openvino-model/ssdlite_mobilenet_v2.xml
width: 300
height: 300detectors:
onnx:
type: onnx
# Automatically uses: ROCm (AMD), OpenVINO (Intel), TensorRT (NVIDIA)detectors:
onnx:
type: onnx
# 自动适配:ROCm(AMD)、OpenVINO(Intel)、TensorRT(NVIDIA)zones:
driveway:
coordinates: 100,500,400,500,400,720,100,720
distances:
- "100,500|400,500|20ft" # 20 feet between points
speed:
threshold: 15 # Minimum mph to registerzones:
driveway:
coordinates: 100,500,400,500,400,720,100,720
distances:
- "100,500|400,500|20ft" # 两点间距离为20英尺
speed:
threshold: 15 # 触发速度的最低阈值(英里/小时)audio:
enabled: true
listen:
- bark
- fire_alarm
- scream
- speech
cameras:
front_door:
ffmpeg:
inputs:
- path: rtsp://camera/stream
roles:
- audioaudio:
enabled: true
listen:
- bark
- fire_alarm
- scream
- speech
cameras:
front_door:
ffmpeg:
inputs:
- path: rtsp://camera/stream
roles:
- audiogenai:
enabled: true
provider: ollama
base_url: http://192.168.1.100:11434
model: llavagenai:
enabled: true
provider: ollama
base_url: http://192.168.1.100:11434
model: llavaface_recognition:
enabled: true
threshold: 0.6
cameras:
front_door:
detect:
width: 1280 # Higher res improves face detectionface_recognition:
enabled: true
threshold: 0.6
cameras:
front_door:
detect:
width: 1280 # 更高分辨率可提升人脸识别效果lpr:
enabled: true
cameras:
driveway:
lpr:
enabled: truelpr:
enabled: true
cameras:
driveway:
lpr:
enabled: truego2rtc:
streams:
front_door:
- rtsp://user:pass@192.168.1.100:554/stream1
- "ffmpeg:front_door#video=copy#audio=opus"
webrtc:
candidates:
- 192.168.1.50:8555
- stun:8555go2rtc:
streams:
front_door:
- rtsp://user:pass@192.168.1.100:554/stream1
- "ffmpeg:front_door#video=copy#audio=opus"
webrtc:
candidates:
- 192.168.1.50:8555
- stun:8555services:
frigate:
container_name: frigate
image: ghcr.io/blakeblackshear/frigate:stable
restart: unless-stopped
shm_size: "256mb"
devices:
- /dev/bus/usb:/dev/bus/usb # USB Coral
- /dev/dri/renderD128:/dev/dri/renderD128 # Intel GPU
volumes:
- ./config:/config
- ./storage:/media/frigate
- type: tmpfs
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "8971:8971" # Web UI
- "8554:8554" # RTSP feeds
- "8555:8555/tcp" # WebRTC
- "8555:8555/udp" # WebRTC
environment:
FRIGATE_RTSP_USER: admin
FRIGATE_RTSP_PASSWORD: ${RTSP_PASSWORD}
FRIGATE_MQTT_USER: frigate
FRIGATE_MQTT_PASSWORD: ${MQTT_PASSWORD}services:
frigate:
container_name: frigate
image: ghcr.io/blakeblackshear/frigate:stable
restart: unless-stopped
shm_size: "256mb"
devices:
- /dev/bus/usb:/dev/bus/usb # USB Coral
- /dev/dri/renderD128:/dev/dri/renderD128 # Intel GPU
volumes:
- ./config:/config
- ./storage:/media/frigate
- type: tmpfs
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "8971:8971" # Web UI
- "8554:8554" # RTSP流
- "8555:8555/tcp" # WebRTC
- "8555:8555/udp" # WebRTC
environment:
FRIGATE_RTSP_USER: admin
FRIGATE_RTSP_PASSWORD: ${RTSP_PASSWORD}
FRIGATE_MQTT_USER: frigate
FRIGATE_MQTT_PASSWORD: ${MQTT_PASSWORD}templates/docker-compose.ymlconfig-minimal.ymlconfig-full.ymltemplates/docker-compose.ymlconfig-minimal.ymlconfig-full.ymlreferences/detector-comparison.mdffmpeg-presets.mdmqtt-topics.mdreferences/detector-comparison.mdffmpeg-presets.mdmqtt-topics.mdscripts/validate-config.shscripts/validate-config.sh| Package | Version | Purpose |
|---|---|---|
| Docker | 20.10+ | Container runtime |
| docker-compose | 2.0+ | Service orchestration |
| 软件包 | 版本 | 用途 |
|---|---|---|
| Docker | 20.10+ | 容器运行时 |
| docker-compose | 2.0+ | 服务编排 |
| Package | Version | Purpose |
|---|---|---|
| NVIDIA Container Toolkit | Latest | NVIDIA GPU support |
| Coral Edge TPU runtime | Latest | Coral TPU support |
| 软件包 | 版本 | 用途 |
|---|---|---|
| NVIDIA容器工具包 | 最新版 | NVIDIA GPU支持 |
| Coral Edge TPU运行时 | 最新版 | Coral TPU支持 |
undefinedundefinedundefinedundefined/api/stats/api/statsundefinedundefinedundefinedundefined