TawfikDaim / home_automation

home automation user stories
0 stars 0 forks source link

frigate docker on portainer #63

Open TawfikDaim opened 3 months ago

TawfikDaim commented 3 months ago

https://blog.smarterhome.my/how-to-install-zigbee2mqtt-using-portainer/ Portainer stack

services: frigate: container_name: frigate_on_the_stack image: ghcr.io/blakeblackshear/frigate:stable shm_size: "264mb" # update for your cameras based on calculation above

restart: always

volumes:

- /etc/localtime:/etc/localtime

  - /home/tawfik/frigate/frigate.yaml:/config/config.yaml
  - /home/tawfik/frigate/media:/media/frigate
ports:
  - 5000:5000
  - 1935:1935
environment:
  FRIGATE_RTSP_PASSWORD: "Newipad1"

Configuration = good one on 24 March 2024 mqtt: host: 192.168.1.26 port: 1883 user: tawfik password: Newipad1!

cameras: kitchen: ffmpeg:

inputs:

- path: rtsp://admin:Newipad1@192.168.1.102:554/Streaming/Channel/102

roles:

- record

rtmp:

enabled: False

hwaccel_args:

- -c:v

- h264_cuvid

  #Low resolution stream   
  inputs:
    - path: rtsp://admin:Newipad1@192.168.1.102:554/Steaming/Channels/101
      roles:
        - rtmp
        - detect
TawfikDaim commented 3 months ago

mqtt: host: 192.168.1.26 port: 1883 user: tawfik password: Newipad1!

cameras: kitchen: ffmpeg: inputs:

motion:

Optional: The threshold passed to cv2.threshold to determine if a pixel is different enough to be counted as motion. (default: shown below)

Increasing this value will make motion detection less sensitive and decreasing it will make motion detection more sensitive.

The value should be between 1 and 255.

threshold: 25

Optional: Minimum size in pixels in the resized motion image that counts as motion (default: 30)

Increasing this value will prevent smaller areas of motion from being detected. Decreasing will

make motion detection more sensitive to smaller moving objects.

As a rule of thumb:

- 15 - high sensitivity

- 30 - medium sensitivity

- 50 - low sensitivity

contour_area: 30

Optional: Alpha value passed to cv2.accumulateWeighted when averaging the motion delta across multiple frames (default: shown below)

Higher values mean the current frame impacts the delta a lot, and a single raindrop may register as motion.

Too low and a fast moving person wont be detected as motion.

delta_alpha: 0.2

Optional: Alpha value passed to cv2.accumulateWeighted when averaging frames to determine the background (default: shown below)

Higher values mean the current frame impacts the average a lot, and a new object will be averaged into the background faster.

Low values will cause things like moving shadows to be detected as motion for longer.

https://www.geeksforgeeks.org/background-subtraction-in-an-image-using-concept-of-running-average/

frame_alpha: 0.2

Optional: Height of the resized motion frame (default: 50)

This operates as an efficient blur alternative. Higher values will result in more granular motion detection at the expense

of higher CPU usage. Lower values result in less CPU, but small changes may not register as motion.

frame_height: 50

Optional: improve contrast (default: shown below)

Enables dynamic contrast improvement. This should help improve night detections at the cost of making motion detection more sensitive

for daytime.

improve_contrast: False

detect:

Width of the frame for the input with the detect role

width: 3072

Height of the frame for the input with the detect role

height: 1728

Desired fps for your camera for the input with the detect role

fps: 5

Number of frames without a detection before frigate considers an object to be gone.

max_disappeared: 25

objects:

Optional: list of objects to track from labelmap.txt

track:

maindoor:

ffmpeg:

inputs:

- path: rtsp://admin:Newipad1@192.168.1.103:554/Steaming/Channels/101

#      roles:
 #       - rtmp
  #      - detect

basket:

ffmpeg:

inputs:

#    - path: rtsp://admin:Newipad1@192.168.1.101:554/Steaming/Channels/101
 #     roles:
  #      - rtmp
   #     - detect

jaccuzi:

ffmpeg:

inputs:

#    - path: rtsp://admin:Newipad1@192.168.1.106:554/Steaming/Channels/101
 #     roles:
  #      - rtmp
   #     - detect

birdseye:

Optional: Enable birdseye view (default: shown below)

enabled: True

Optional: Width of the output resolution (default: shown below)

width: 1280

Optional: Height of the output resolution (default: shown below)

height: 720

Optional: Encoding quality of the mpeg1 feed (default: shown below)

1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.

quality: 8

Optional: Mode of the view. Available options are: objects, motion, and continuous

objects - cameras are included if they have had a tracked object within the last 30 seconds

motion - cameras are included if motion was detected in the last 30 seconds

continuous - all cameras are included always

mode: objects

record: enabled: True

Number of minutes to wait between cleanup runs - one week

expire_interval: 10080

Number of days to retain recordings regardless of events

retain: days: 2 mode: all

TawfikDaim commented 3 months ago

mqtt: host: 192.168.1.26 port: 1883 user: tawfik password: Newipad1!

cameras: kitchen: ffmpeg: inputs:

motion:

Optional: The threshold passed to cv2.threshold to determine if a pixel is different enough to be counted as motion. (default: shown below)

Increasing this value will make motion detection less sensitive and decreasing it will make motion detection more sensitive.

The value should be between 1 and 255.

threshold: 25

Optional: Minimum size in pixels in the resized motion image that counts as motion (default: 30)

Increasing this value will prevent smaller areas of motion from being detected. Decreasing will

make motion detection more sensitive to smaller moving objects.

As a rule of thumb:

- 15 - high sensitivity

- 30 - medium sensitivity

- 50 - low sensitivity

contour_area: 30

Optional: Alpha value passed to cv2.accumulateWeighted when averaging the motion delta across multiple frames (default: shown below)

Higher values mean the current frame impacts the delta a lot, and a single raindrop may register as motion.

Too low and a fast moving person wont be detected as motion.

delta_alpha: 0.2

Optional: Alpha value passed to cv2.accumulateWeighted when averaging frames to determine the background (default: shown below)

Higher values mean the current frame impacts the average a lot, and a new object will be averaged into the background faster.

Low values will cause things like moving shadows to be detected as motion for longer.

https://www.geeksforgeeks.org/background-subtraction-in-an-image-using-concept-of-running-average/

frame_alpha: 0.2

Optional: Height of the resized motion frame (default: 50)

This operates as an efficient blur alternative. Higher values will result in more granular motion detection at the expense

of higher CPU usage. Lower values result in less CPU, but small changes may not register as motion.

frame_height: 50

Optional: improve contrast (default: shown below)

Enables dynamic contrast improvement. This should help improve night detections at the cost of making motion detection more sensitive

for daytime.

improve_contrast: False

detect:

Width of the frame for the input with the detect role

width: 3072

Height of the frame for the input with the detect role

height: 1728

Desired fps for your camera for the input with the detect role

fps: 5

Number of frames without a detection before frigate considers an object to be gone.

max_disappeared: 25

objects:

Optional: list of objects to track from labelmap.txt

track:

maindoor:

ffmpeg:

inputs:

- path: rtsp://admin:Newipad1@192.168.1.103:554/Steaming/Channels/101

#      roles:
 #       - rtmp
  #      - detect

basket:

ffmpeg:

inputs:

#    - path: rtsp://admin:Newipad1@192.168.1.101:554/Steaming/Channels/101
 #     roles:
  #      - rtmp
   #     - detect

jaccuzi:

ffmpeg:

inputs:

#    - path: rtsp://admin:Newipad1@192.168.1.106:554/Steaming/Channels/101
 #     roles:
  #      - rtmp
   #     - detect

birdseye:

Optional: Enable birdseye view (default: shown below)

enabled: True

Optional: Width of the output resolution (default: shown below)

width: 1280

Optional: Height of the output resolution (default: shown below)

height: 720

Optional: Encoding quality of the mpeg1 feed (default: shown below)

1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.

quality: 8

Optional: Mode of the view. Available options are: objects, motion, and continuous

objects - cameras are included if they have had a tracked object within the last 30 seconds

motion - cameras are included if motion was detected in the last 30 seconds

continuous - all cameras are included always

mode: objects

record: enabled: True

Number of minutes to wait between cleanup runs - one week

expire_interval: 10080

Number of days to retain recordings regardless of events

retain: days: 2 mode: all

snapshots:

Enable writing jpg snapshot to /media/frigate/clips

enabled: True

Print a timestamp on the snapshots

timestamp: True

Draw bounding box on the snapshots

bounding_box: True retain:

Retention days

default: 10