diff --git a/.gitignore b/.gitignore index 7b6919d..deef190 100644 --- a/.gitignore +++ b/.gitignore @@ -77,8 +77,6 @@ scans/ **/queue/ # Node-Red dependencies **/node_modules/ -# Frigate database/clips -**/frigate/ # Home Assistant State Registry (Contains secrets) **/.storage/ # Text-to-speech cache diff --git a/lxc2/frigate/config/frigate.yml b/lxc2/frigate/config/frigate.yml new file mode 100644 index 0000000..8ef41d7 --- /dev/null +++ b/lxc2/frigate/config/frigate.yml @@ -0,0 +1,77 @@ +mqtt: + enabled: False # Set to True and add host/user/pass if you use Home Assistant + +go2rtc: + streams: + camera_1: + - "ffmpeg:rtsp://:@:554/stream1#video=copy#audio=copy#audio=aac" + camera_1_sub: + - rtsp://:@:554/stream2 + camera_2: + - "ffmpeg:rtsp://:@:554/stream1#video=copy#audio=copy#audio=aac" + camera_2_sub: + - rtsp://:@:554/stream2 + camera_3: + - "ffmpeg:rtsp://:@:554/stream1#video=copy#audio=copy#audio=aac" + camera_3_sub: + - rtsp://:@:554/stream2 + +cameras: + camera_1: # Change name to match your location (e.g., driveway) + ffmpeg: + inputs: + - path: rtsp://127.0.0.1:8554/camera_1 + roles: + - record + - path: rtsp://127.0.0.1:8554/camera_1_sub + roles: + - detect + detect: + width: 640 # stream2 is typically 640x360 + height: 360 + fps: 5 + + camera_2: + ffmpeg: + inputs: + - path: rtsp://127.0.0.1:8554/camera_2 + roles: + - record + - path: rtsp://127.0.0.1:8554/camera_2_sub + roles: + - detect + detect: + width: 640 + height: 360 + fps: 5 + + camera_3: + ffmpeg: + inputs: + - path: rtsp://127.0.0.1:8554/camera_3 + roles: + - record + - path: rtsp://127.0.0.1:8554/camera_3_sub + roles: + - detect + detect: + width: 640 + height: 360 + fps: 5 + +# Optional: Global recording settings +record: + enabled: True + retain: + days: 7 + mode: all + +ffmpeg: + hwaccel_args: preset-nvidia + +# If you want to use the GPU for object detection (requires Frigate + TensorRT) +# Note: This is separate from decoding and requires the tensorrt detector image +detectors: + ov: + type: openvino + device: GPU # This uses Intel iGPU if available, use 'tensorrt' for Nvidia \ No newline at end of file diff --git a/lxc2/frigate/frigate.yml b/lxc2/frigate/frigate.yml new file mode 100755 index 0000000..fd5d2d9 --- /dev/null +++ b/lxc2/frigate/frigate.yml @@ -0,0 +1,41 @@ +services: + frigate: + image: ghcr.io/blakeblackshear/frigate:stable-tensorrt + privileged: true + devices: + - /dev/nvidia0:/dev/nvidia0 + - /dev/nvidiactl:/dev/nvidiactl + - /dev/nvidia-uvm:/dev/nvidia-uvm + - /dev/nvidia-uvm-tools:/dev/nvidia-uvm-tools + container_name: frigate + restart: unless-stopped + privileged: true + shm_size: 512m + volumes: + - /etc/localtime:/etc/localtime:ro + - /docker/homeassistant/frigate:/config + - /mnt/local_configs/frigate/cache:/tmp/cache + - /pool/securitycameras:/media + ports: + - "5000:5000" + - "1935:1935" + runtime: nvidia + environment: + - NVIDIA_VISIBLE_DEVICES=all + - NVIDIA_DRIVER_CAPABILITIES=all,video,compute + - FRIGATE_SQLITE_PATH=/config/frigate.db + - FRIGATE_SQLITE_JOURNAL_MODE=DELETE + - PUID=1000 + - PGID=1000 + cpus: "2.0" + mem_limit: "6144m" + mem_reservation: "2048m" + +services: + frigate: + container_name: frigate + # Use the TensorRT image to use your 3050 for detection as well as decoding + + environment: + - NVIDIA_VISIBLE_DEVICES=all + # ... rest of your config (volumes, ports) \ No newline at end of file