version: "3.9"
services:
frigate:
container_name: frigate
privileged: true # 使用特权模式
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:stable
shm_size: "256mb" # 这个根据摄像头数量来定,我这边4个,其实128mb就足够了
devices:
- /dev/dri/renderD128:/dev/dri/renderD128 # GPU透传
volumes:
- /etc/localtime:/etc/localtime:ro
- /root/frigate/config:/config # 冒号前替换为你自己的本地config文件夹路径
- /mnt/frigate_storage:/media/frigate # 冒号前替换为你自己的本地用于存放录像的文件夹路径
- type: tmpfs
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "8971:8971"
- "5000:5000" # Internal unauthenticated access. Expose carefully.
- "8554:8554" # RTSP feeds
- "8555:8555/tcp" # WebRTC over tcp
- "8555:8555/udp" # WebRTC over udp
environment:
FRIGATE_RTSP_PASSWORD: "passwd"
detectors:
ov:
type: openvino
device: GPU
detect:
width: 1280
height: 720
fps: 6
enabled: true
#分辨率和帧率按你自己的子码流来
model:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: bgr
path: /openvino-model/ssdlite_mobilenet_v2.xml
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
ffmpeg:
hwaccel_args: preset-vaapi
#硬件加速参数,玩过emby/jellyfin的应该知道vaapi是什么了
objects:
track:
- person
- bicycle
- car
- motorcycle
- cat
- dog
- tree
#对象识别的类型
record:
enabled: true
retain:
days: 7
mode: all
#启用全时录像,保留7天
events:
retain:
default: 14
mode: active_objects
#事件触发的录像片段保留14天
pre_capture: 15
post_capture: 15
#事件录像片段裁切包含前15s和后15s
cameras:
cam-1: #摄像头名字,与在go2rtc中设置的一致
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/cam-1 #cam-1要与go2rtc中配置的摄像头名称对应
input_args: preset-rtsp-generic
roles:
- record #取主码流做录制
- path: rtsp://127.0.0.1:8554/cam-1-sub
input_args: preset-rtsp-generic
roles:
- detect #取子码流做检测
cam-2:
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/cam-2
input_args: preset-rtsp-generic
roles:
- record
- path: rtsp://127.0.0.1:8554/cam-2-sub
input_args: preset-rtsp-generic
roles:
- detect
fay000fay 发表于 2024-10-22 08:48
我是tplink的摄像头,接入后,没有音频。
gasment 发表于 2024-10-22 10:06
先把rtsp流放进potplayer播放看看有没有声音,有的话看看音频编码格式是不是acc
其他音频格式需要转码,fr ...
gasment 发表于 2024-10-22 10:06
先把rtsp流放进potplayer播放看看有没有声音,有的话看看音频编码格式是不是acc
其他音频格式需要转码,fr ...
fay000fay 发表于 2024-10-22 14:03
我问了chatgpt,它给我写了这么个代码,然后运行后,Frigate直接启动不了。
gasment 发表于 2024-10-22 14:26
我之前摄像头就默认输出g711,怎么改配置都是无声,后面统一改成acc,用 record: preset-record-generic- ...
2024-10-23 20:44:13.537883174 [INFO] Preparing Frigate...
2024-10-23 20:44:13.555078107 [INFO] Starting Frigate...
2024-10-23 20:44:16.094799632 [2024-10-23 20:44:16] frigate.app INFO : Starting Frigate (0.14.1-f4f3cfa)
2024-10-23 20:44:16.094924710 [2024-10-23 20:44:16] frigate.util.config INFO : Checking if frigate config needs migration...
2024-10-23 20:44:16.115338418 [2024-10-23 20:44:16] frigate.util.config INFO : frigate config does not need migration...
2024-10-23 20:44:16.157193609 [2024-10-23 20:44:16] peewee_migrate.logs INFO : Starting migrations
2024-10-23 20:44:16.158193113 [2024-10-23 20:44:16] peewee_migrate.logs INFO : There is nothing to migrate
2024-10-23 20:44:16.167421829 [2024-10-23 20:44:16] frigate.app INFO : Recording process started: 342
2024-10-23 20:44:16.177333923 [2024-10-23 20:44:16] frigate.app INFO : Recording process started: 351
2024-10-23 20:44:16.184681277 [2024-10-23 20:44:16] frigate.app INFO : go2rtc process pid: 96
2024-10-23 20:44:16.233912656 Process detectorv:
2024-10-23 20:44:16.234559927 [2024-10-23 20:44:16] detector.ov INFO : Starting detection process: 371
2024-10-23 20:44:16.236413324 Traceback (most recent call last):
2024-10-23 20:44:16.236718393 File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
2024-10-23 20:44:16.236722478 self.run()
2024-10-23 20:44:16.236845599 File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
2024-10-23 20:44:16.236848223 self._target(*self._args, **self._kwargs)
2024-10-23 20:44:16.236952670 File "/opt/frigate/frigate/object_detection.py", line 102, in run_detector
2024-10-23 20:44:16.236955533 object_detector = LocalObjectDetector(detector_config=detector_config)
2024-10-23 20:44:16.237076765 File "/opt/frigate/frigate/object_detection.py", line 53, in __init__
2024-10-23 20:44:16.237079456 self.detect_api = create_detector(detector_config)
2024-10-23 20:44:16.237224627 File "/opt/frigate/frigate/detectors/__init__.py", line 18, in create_detector
2024-10-23 20:44:16.237227177 return api(detector_config)
2024-10-23 20:44:16.237376899 File "/opt/frigate/frigate/detectors/plugins/openvino.py", line 39, in __init__
2024-10-23 20:44:16.237379538 if not os.path.isfile(detector_config.model.path):
2024-10-23 20:44:16.237538331 File "/usr/lib/python3.9/genericpath.py", line 30, in isfile
2024-10-23 20:44:16.237540732 st = os.stat(path)
2024-10-23 20:44:16.237688916 TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
2024-10-23 20:44:16.240099510 [2024-10-23 20:44:16] frigate.app INFO : Output process started: 373
2024-10-23 20:44:16.291467350 [2024-10-23 20:44:16] frigate.app INFO : Camera processor started for TP: 387
2024-10-23 20:44:16.292279107 [2024-10-23 20:44:16] frigate.app INFO : Capture process started for TP: 388
OliverY 发表于 2024-10-23 20:45
循环重启唉。。。
fay000fay 发表于 2024-10-23 14:55
在CT资源页添加device passthrough,添加/dev/dri/cardX和/dev/dri/renderD128,我PVE7,CT资源页里添加没 ...
gasment 发表于 2024-11-11 11:34
需要pve8以上版本
欢迎光临 『瀚思彼岸』» 智能家居技术论坛 (https://bbs.hassbian.com/) | Powered by Discuz! X3.5 |