From c34d7692f6a018d021cae4c874ede79a7b4d8b9b Mon Sep 17 00:00:00 2001 From: Ashish D'Souza Date: Tue, 5 Nov 2024 22:53:20 -0600 Subject: [PATCH] Add new family room camera #15 --- Jenkinsfile | 2 +- conf/config.yaml | 98 +++++++++++++++++++------------- conf/docker-compose.yaml | 120 ++++++++++++++++++++------------------- install.yaml | 4 ++ start.yaml | 1 + 5 files changed, 124 insertions(+), 101 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d7afef7..c62703a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { frigate_config = readJSON file: 'frigate_config.json' } - ansiblePlaybook credentialsId: 'rivendell-ssh-key', disableHostKeyChecking: true, extras: "--extra-vars 'ipgeolocation_api_key=\"${frigate_config.ipgeolocation.api_key}\" wyze_email=\"${frigate_config.wyze.email}\" wyze_password=\"${frigate_config.wyze.password}\" wyze_api_id=\"${frigate_config.wyze.api_id}\" wyze_api_key=\"${frigate_config.wyze.api_key}\" garage_rtsp_password=\"${frigate_config.rtsp.garage.password}\" front_door_rtsp_password=\"${frigate_config.rtsp.front_door.password}\" doorbell_rtsp_password=\"${frigate_config.rtsp.doorbell.password}\" driveway_rtsp_password=\"${frigate_config.rtsp.driveway.password}\" back_door_rtsp_password=\"${frigate_config.rtsp.back_door.password}\" family_room_rtsp_password=\"${frigate_config.rtsp.family_room.password}\"'", playbook: 'install.yaml' + ansiblePlaybook credentialsId: 'rivendell-ssh-key', disableHostKeyChecking: true, extras: "--extra-vars 'ipgeolocation_api_key=\"${frigate_config.ipgeolocation.api_key}\" wyze_email=\"${frigate_config.wyze.email}\" wyze_password=\"${frigate_config.wyze.password}\" wyze_api_id=\"${frigate_config.wyze.api_id}\" wyze_api_key=\"${frigate_config.wyze.api_key}\" garage_rtsp_password=\"${frigate_config.rtsp.garage.password}\" front_door_rtsp_password=\"${frigate_config.rtsp.front_door.password}\" doorbell_rtsp_password=\"${frigate_config.rtsp.doorbell.password}\" driveway_rtsp_password=\"${frigate_config.rtsp.driveway.password}\" back_door_rtsp_password=\"${frigate_config.rtsp.back_door.password}\" family_room_rtsp_password=\"${frigate_config.rtsp.family_room.password}\" office_rtsp_password=\"${frigate_config.rtsp.office.password}\"'", playbook: 'install.yaml' ansiblePlaybook credentialsId: 'rivendell-ssh-key', disableHostKeyChecking: true, playbook: 'stop.yaml' ansiblePlaybook credentialsId: 'rivendell-ssh-key', disableHostKeyChecking: true, playbook: 'start.yaml' } diff --git a/conf/config.yaml b/conf/config.yaml index 9463873..9986e28 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -12,28 +12,29 @@ detectors: go2rtc: streams: garage: - - 'rtsp://{FRIGATE_GARAGE_RTSP_USERNAME}:{FRIGATE_GARAGE_RTSP_PASSWORD}@192.168.0.102:554/live' + - 'rtsp://{FRIGATE_GARAGE_RTSP_USERNAME}:{FRIGATE_GARAGE_RTSP_PASSWORD}@192.168.0.102:554/live' doorbell: - - 'rtsp://{FRIGATE_DOORBELL_RTSP_USERNAME}:{FRIGATE_DOORBELL_RTSP_PASSWORD}@192.168.0.105:554/cam/realmonitor?channel=1&subtype=0' + - 'rtsp://{FRIGATE_DOORBELL_RTSP_USERNAME}:{FRIGATE_DOORBELL_RTSP_PASSWORD}@192.168.0.105:554/cam/realmonitor?channel=1&subtype=0' front_door: - - 'rtsp://{FRIGATE_FRONT_DOOR_RTSP_USERNAME}:{FRIGATE_FRONT_DOOR_RTSP_PASSWORD}@192.168.0.108:554/live/ch0' + - 'rtsp://{FRIGATE_FRONT_DOOR_RTSP_USERNAME}:{FRIGATE_FRONT_DOOR_RTSP_PASSWORD}@192.168.0.108:554/live/ch0' driveway: - - 'rtsp://{FRIGATE_DRIVEWAY_RTSP_USERNAME}:{FRIGATE_DRIVEWAY_RTSP_PASSWORD}@192.168.0.148:5543/live/channel1' + - 'rtsp://{FRIGATE_DRIVEWAY_RTSP_USERNAME}:{FRIGATE_DRIVEWAY_RTSP_PASSWORD}@192.168.0.148:5543/live/channel1' back_door: - - 'rtsp://wyze-bridge:8554/back-yard-cam' + - 'rtsp://wyze-bridge:8554/back-yard-cam' family_room: - - 'rtsp://{FRIGATE_FAMILY_ROOM_RTSP_USERNAME}:{FRIGATE_FAMILY_ROOM_RTSP_PASSWORD}@192.168.0.104:554/live/ch0' + - 'rtsp://{FRIGATE_FAMILY_ROOM_RTSP_USERNAME}:{FRIGATE_FAMILY_ROOM_RTSP_PASSWORD}@192.168.0.106:554/stream1' + office: + - 'rtsp://{FRIGATE_OFFICE_RTSP_USERNAME}:{FRIGATE_OFFICE_RTSP_PASSWORD}@192.168.0.104:554/live/ch0' cameras: garage: enabled: true ffmpeg: inputs: - - path: 'rtsp://127.0.0.1:8554/garage' - input_args: preset-rtsp-restream - roles: - - detect - - record + - path: 'rtsp://127.0.0.1:8554/garage' + roles: + - detect + - record hwaccel_args: preset-intel-qsv-h264 # Use Intel QSV hardware acceleration for H.264 output_args: record: preset-record-generic-audio-aac # Record with aac audio @@ -43,15 +44,15 @@ cameras: height: 1080 motion: mask: - - 1384,1058,1384,1009,1872,1009,1872,1058 # Timestamp + - 1384,1058,1384,1009,1872,1009,1872,1058 # Timestamp doorbell: enabled: true ffmpeg: inputs: - - path: 'rtsp://127.0.0.1:8554/doorbell' - roles: - - detect - - record + - path: 'rtsp://127.0.0.1:8554/doorbell' + roles: + - detect + - record hwaccel_args: preset-intel-qsv-h264 # Use Intel QSV hardware acceleration for H.264 output_args: record: preset-record-generic-audio-aac # Record with aac audio @@ -62,10 +63,10 @@ cameras: review: alerts: required_zones: - - front_door_zone + - front_door_zone snapshots: required_zones: - - front_door_zone + - front_door_zone zones: front_door_zone: coordinates: 964,677,1920,1080,0,1080,539,754 # Near front door @@ -73,10 +74,10 @@ cameras: enabled: true ffmpeg: inputs: - - path: 'rtsp://127.0.0.1:8554/front_door' - roles: - - detect - - record + - path: 'rtsp://127.0.0.1:8554/front_door' + roles: + - detect + - record hwaccel_args: preset-intel-qsv-h264 # Use Intel QSV hardware acceleration for H.264 output_args: record: preset-record-generic-audio-aac # Record with aac audio @@ -86,22 +87,22 @@ cameras: height: 1080 motion: mask: - - 361,96,565,0,0,0,0,304 # Sidewalk - - 1445,0,1444,46,1920,46,1920,0 # Timestamp + - 361,96,565,0,0,0,0,304 # Sidewalk + - 1445,0,1444,46,1920,46,1920,0 # Timestamp objects: filters: person: mask: - - 167,1080,511,1080,328,744,234,456,140,451,0,509,0,804 # Flower bed and hedge - - 1153,847,1112,838,1042,896,1023,988,1023,1080,1525,1080 # Drainpipe + - 167,1080,511,1080,328,744,234,456,140,451,0,509,0,804 # Flower bed and hedge + - 1153,847,1112,838,1042,896,1023,988,1023,1080,1525,1080 # Drainpipe driveway: enabled: false ffmpeg: inputs: - - path: 'rtsp://127.0.0.1:8554/driveway' - roles: - - detect - - record + - path: 'rtsp://127.0.0.1:8554/driveway' + roles: + - detect + - record hwaccel_args: preset-intel-qsv-h264 # Use Intel QSV hardware acceleration for H.264 output_args: record: preset-record-generic-audio-aac # Record with aac audio @@ -113,10 +114,10 @@ cameras: enabled: true ffmpeg: inputs: - - path: 'rtsp://127.0.0.1:8554/back_door' - roles: - - detect - - record + - path: 'rtsp://127.0.0.1:8554/back_door' + roles: + - detect + - record hwaccel_args: preset-intel-qsv-h264 # Use Intel QSV hardware acceleration for H.264 output_args: record: preset-record-generic-audio-aac # Record with aac audio @@ -126,15 +127,30 @@ cameras: height: 1080 motion: mask: - - 1877,1080,1378,1080,1378,1008,1877,1008 # Timestamp + - 1877,1080,1378,1080,1378,1008,1877,1008 # Timestamp family_room: enabled: false ffmpeg: inputs: - - path: 'rtsp://127.0.0.1:8554/family_room' - roles: - - detect - - record + - path: 'rtsp://127.0.0.1:8554/family_room' + roles: + - detect + - record + hwaccel_args: preset-intel-qsv-h264 # Use Intel QSV hardware acceleration for H.264 + output_args: + record: preset-record-generic-audio-aac # Record with aac audio + detect: + enabled: true + width: 1920 + height: 1080 + office: + enabled: false + ffmpeg: + inputs: + - path: 'rtsp://127.0.0.1:8554/office' + roles: + - detect + - record output_args: record: preset-record-generic-audio-aac # Record with aac audio detect: @@ -148,12 +164,12 @@ ffmpeg: objects: track: - - person + - person review: alerts: labels: - - person + - person detect: enabled: true diff --git a/conf/docker-compose.yaml b/conf/docker-compose.yaml index de5c505..93e97fd 100644 --- a/conf/docker-compose.yaml +++ b/conf/docker-compose.yaml @@ -8,8 +8,8 @@ services: autoheal: 'true' restart: unless-stopped depends_on: - - mqtt - - wyze-bridge + - mqtt + - wyze-bridge healthcheck: test: ls /media/frigate && curl -s -f http://localhost:5000 -o /dev/null interval: 60s @@ -29,29 +29,31 @@ services: FRIGATE_BACK_DOOR_RTSP_PASSWORD: ${FRIGATE_BACK_DOOR_RTSP_PASSWORD} FRIGATE_FAMILY_ROOM_RTSP_USERNAME: frigate FRIGATE_FAMILY_ROOM_RTSP_PASSWORD: ${FRIGATE_FAMILY_ROOM_RTSP_PASSWORD} + FRIGATE_OFFICE_RTSP_USERNAME: frigate + FRIGATE_OFFICE_RTSP_PASSWORD: ${FRIGATE_OFFICE_RTSP_PASSWORD} shm_size: '150mb' devices: - - /dev/dri:/dev/dri + - /dev/dri:/dev/dri volumes: - - type: volume - source: config - target: /config - - type: volume - source: media - target: /media/frigate - - type: tmpfs - target: /tmp/cache - tmpfs: - size: 1000000000 - - type: bind - source: /etc/localtime - target: /etc/localtime - read_only: true + - type: volume + source: config + target: /config + - type: volume + source: media + target: /media/frigate + - type: tmpfs + target: /tmp/cache + tmpfs: + size: 1000000000 + - type: bind + source: /etc/localtime + target: /etc/localtime + read_only: true networks: - - frigate + - frigate ports: - - 127.0.0.1:10000:5000 - - 554:8554 + - 127.0.0.1:10000:5000 + - 554:8554 wyze-bridge: container_name: frigate-wyze-bridge image: mrlt8/wyze-bridge:2.9.7 @@ -66,32 +68,32 @@ services: API_KEY: ${WYZE_API_KEY} ENABLE_AUDIO: 'true' volumes: - - type: bind - source: /etc/localtime - target: /etc/localtime - read_only: true + - type: bind + source: /etc/localtime + target: /etc/localtime + read_only: true networks: - - frigate + - frigate notify: container_name: frigate-notify image: frigate-notify:latest restart: unless-stopped depends_on: - - frigate - - mqtt + - frigate + - mqtt environment: REQUESTS_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt volumes: - - type: bind - source: /data/certs/homelab_ca.crt - target: /usr/local/share/ca-certificates/homelab_ca.crt - read_only: true - - type: bind - source: /etc/localtime - target: /etc/localtime - read_only: true + - type: bind + source: /data/certs/homelab_ca.crt + target: /usr/local/share/ca-certificates/homelab_ca.crt + read_only: true + - type: bind + source: /etc/localtime + target: /etc/localtime + read_only: true networks: - - frigate + - frigate webcontrol: container_name: frigate-webcontrol image: frigate-webcontrol:latest @@ -113,18 +115,18 @@ services: IPGEOLOCATION_API_KEY: ${IPGEOLOCATION_API_KEY} FRIGATE_CONFIG_FILE: /frigate_config/config.yaml volumes: - - type: volume - source: config - target: /frigate_config - read_only: true - - type: bind - source: /etc/localtime - target: /etc/localtime - read_only: true + - type: volume + source: config + target: /frigate_config + read_only: true + - type: bind + source: /etc/localtime + target: /etc/localtime + read_only: true networks: - - frigate + - frigate ports: - - 127.0.0.1:10001:80 + - 127.0.0.1:10001:80 uptime: container_name: frigate-uptime image: frigate-uptime:latest @@ -133,27 +135,27 @@ services: frigate: condition: service_healthy volumes: - - type: bind - source: /etc/localtime - target: /etc/localtime - read_only: true + - type: bind + source: /etc/localtime + target: /etc/localtime + read_only: true networks: - - frigate + - frigate mqtt: container_name: frigate-mqtt image: eclipse-mosquitto:2.0.18 command: - - mosquitto - - -c - - /mosquitto-no-auth.conf + - mosquitto + - -c + - /mosquitto-no-auth.conf restart: unless-stopped volumes: - - type: bind - source: /etc/localtime - target: /etc/localtime - read_only: true + - type: bind + source: /etc/localtime + target: /etc/localtime + read_only: true networks: - - frigate + - frigate networks: frigate: diff --git a/install.yaml b/install.yaml index a53b488..b9859d8 100644 --- a/install.yaml +++ b/install.yaml @@ -23,6 +23,8 @@ prompt: Enter password for back door camera RTSP stream user motion - name: family_room_rtsp_password prompt: Enter password for family room camera RTSP stream user frigate + - name: office_rtsp_password + prompt: Enter password for office camera RTSP stream user frigate tasks: - name: Create Frigate config Docker volume directory become: true @@ -167,6 +169,8 @@ password: '{{back_door_rtsp_password}}' family_room: password: '{{family_room_rtsp_password}}' + office: + password: '{{office_rtsp_password}}' community.postgresql.postgresql_query: login_host: '{{homelab_config.database.host}}' login_user: '{{homelab_config.database.user}}' diff --git a/start.yaml b/start.yaml index 5213e38..db297ef 100644 --- a/start.yaml +++ b/start.yaml @@ -46,6 +46,7 @@ FRIGATE_DRIVEWAY_RTSP_PASSWORD: '{{frigate_config.rtsp.driveway.password}}' FRIGATE_BACK_DOOR_RTSP_PASSWORD: '{{frigate_config.rtsp.back_door.password}}' FRIGATE_FAMILY_ROOM_RTSP_PASSWORD: '{{frigate_config.rtsp.family_room.password}}' + FRIGATE_OFFICE_RTSP_PASSWORD: '{{frigate_config.rtsp.office.password}}' community.docker.docker_compose: project_name: frigate project_src: '{{docker_compose_dir.path}}'