The Setup

I have 4 Reolink cams, 3 x 510WA and 1 x 510A - seems pretty much the same, just the "WA" hawing Wifi, and the "A" having POE.

I started installing frigate reading the docs and learning from this Youtube video.

Starting up

The first mistake was to install via DockerHub, now a days the image is at GitHub, so I spend a lot of time on an old version and new documentation.

Looking at many issues at gitHub, it seems that this is a very common mistake.

Second mistake, I started using the config from https://docs.frigate.video/configuration/camera_specific#reolink-cameras and with --shm-size=64m

This gave me ALL sort of trouble, and the camera streams stalled within seconds; i tried all sort of streams, https, rstp, rmtp etc etc.

Often ending like this:

I tried all the (bad) advices from a lot of videos, and a lot or article pointing out the problem was the cams.


Then I came across this Youtube video, and found that a simple standard RTSP are working just fine (must be enabled on the Camera) - WITH more memory for 4 cams / 8 streams (--shm-size=256m).

My first working config: config.yml.std

Works fine and the camera streams does not stall


Also the setup of the docker container may require som tweaking, I You have (or not have) the Google Coral.

Starting frigate:

docker run -d \  
  --name frigate \
  --restart=unless-stopped \
  --mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 \
  --device /dev/bus/usb:/dev/bus/usb \
  --shm-size=256m \
  -v /mnt/LaCie/nas/frigate:/media/frigate \
  -v /opt/frigate/config.yml:/config/config.yml:ro \
  -v /etc/localtime:/etc/localtime:ro \
  -e FRIGATE_RTSP_PASSWORD='***********' \
  -p 5000:5000 \
  -p 1935:1935 \
  ghcr.io/blakeblackshear/frigate:master-433bf69-tensorrt

A working/simple config

Previously, I did not use the go2rtc - and the playback of event clips was extreme chonky and studdering. After setting up go2rtc as proxy (see the code) the event clips are way better.

Great that it is embedded with Frigate.


mqtt:
  host: 10.0.0.183
go2rtc:
  streams:
    frigate_front_door_cam_main: 
      - "ffmpeg:http://10.0.0.151/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=readonly&password={FRIGATE_RTSP_PASSWORD}#video=copy#audio=copy#audio=opus"
    frigate_front_door_cam_sub: 
      - "ffmpeg:http://10.0.0.151/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=readonly&password={FRIGATE_RTSP_PASSWORD}"
    frigate_behind_house_cam_main:
      - "ffmpeg:http://10.0.0.176/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=readonly&password={FRIGATE_RTSP_PASSWORD}#video=copy#audio=copy#audio=opus"
    frigate_behind_house_cam_sub:
      - "ffmpeg:http://10.0.0.176/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=readonly&password={FRIGATE_RTSP_PASSWORD}"
    frigate_carport_cam_main:
      - "ffmpeg:http://10.0.0.191/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=readonly&password={FRIGATE_RTSP_PASSWORD}#video=copy#audio=copy#audio=opus"
    frigate_carport_cam_sub:
      - "ffmpeg:http://10.0.0.191/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=readonly&password={FRIGATE_RTSP_PASSWORD}"
    frigate_big_shed_cam_main:
      - "ffmpeg:http://10.0.0.108/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=readonly&password={FRIGATE_RTSP_PASSWORD}#video=copy#audio=copy#audio=opus"
    frigate_big_shed_cam_sub:
      - "ffmpeg:http://10.0.0.108/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=readonly&password={FRIGATE_RTSP_PASSWORD}"

cameras:
  frigate_front_door_cam:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/frigate_front_door_cam_sub?video=copy
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://127.0.0.1:8554/frigate_front_door_cam_main?video=copy&audio=aac
          input_args: preset-rtsp-restream
          roles:
            - record
    rtmp:
      enabled: False
    detect:
      width: 640
      height: 480
      fps: 5
    objects:
      track:
        - person
    snapshots:
      enabled: True
      timestamp: false
      bounding_box: True
      retain:
        default: 2
    record:
      enabled: True
      events:
        retain:
          default: 10
  frigate_behind_house_cam:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/frigate_behind_house_cam_sub?video=copy
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://127.0.0.1:8554/frigate_behind_house_cam_main?video=copy&audio=aac
          input_args: preset-rtsp-restream
          roles:
            - record
    rtmp:
      enabled: False
    detect:
      width: 640
      height: 480
      fps: 5
    objects:
      track:
        - person
    snapshots:
      enabled: True
      timestamp: false
      bounding_box: True
      retain:
        default: 2
    record:
      enabled: True
      events:
        retain:
          default: 10
  frigate_carport_cam:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/frigate_carport_cam_sub?video=copy
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://127.0.0.1:8554/frigate_carport_cam_main?video=copy&audio=aac
          input_args: preset-rtsp-restream
          roles:
            - record
    rtmp:
      enabled: False
    detect:
      width: 640
      height: 480
      fps: 5
    objects:
      track:
        - person
    snapshots:
      enabled: True
      timestamp: false
      bounding_box: True
      retain:
        default: 2
    record:
      enabled: True
      events:
        retain:
          default: 10
  frigate_big_shed_cam:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/frigate_big_shed_cam_sub?video=copy
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://127.0.0.1:8554/frigate_big_shed_cam_main?video=copy&audio=aac
          input_args: preset-rtsp-restream
          roles:
            - record
    rtmp:
      enabled: False
    detect:
      width: 640
      height: 480
      fps: 5
    objects:
      track:
        - person
    snapshots:
      enabled: True
      timestamp: false
      bounding_box: True
      retain:
        default: 2
    record:
      enabled: True
      events:
        retain:
          default: 10
detectors:
  coral:
    type: edgetpu
    device: usb
birdseye:
  enabled: True
  mode: continuous

CPU - With Google Coral

As the logs states:

2023-04-19 21:39:43.672054592  [INFO] Starting Frigate...
2023-04-19 21:39:45.123307770  [2023-04-19 21:39:45] frigate.app                    INFO    : Starting Frigate (0.12.0-433bf69)
2023-04-19 21:39:45.170477205  [2023-04-19 21:39:45] peewee_migrate                 INFO    : Starting migrations
2023-04-19 21:39:45.175774528  [2023-04-19 21:39:45] peewee_migrate                 INFO    : There is nothing to migrate
2023-04-19 21:39:45.204354047  [2023-04-19 21:39:45] detector.coral                 INFO    : Starting detection process: 290
2023-04-19 21:39:48.422390105  [2023-04-19 21:39:45] frigate.app                    INFO    : Output process started: 292
2023-04-19 21:39:48.422396583  [2023-04-19 21:39:45] frigate.comms.dispatcher       INFO    : Turning off snapshots for frigate_carport_cam
2023-04-19 21:39:48.422404731  [2023-04-19 21:39:45] frigate.app                    INFO    : Camera processor started for frigate_front_door_cam: 298
2023-04-19 21:39:48.422409419  [2023-04-19 21:39:45] frigate.app                    INFO    : Camera processor started for frigate_garden_cam: 300
2023-04-19 21:39:48.422426668  [2023-04-19 21:39:45] frigate.app                    INFO    : Camera processor started for frigate_behind_house_cam: 302
2023-04-19 21:39:48.422431296  [2023-04-19 21:39:45] frigate.app                    INFO    : Camera processor started for frigate_carport_cam: 303
2023-04-19 21:39:48.422434562  [2023-04-19 21:39:45] frigate.app                    INFO    : Capture process started for frigate_front_door_cam: 304
2023-04-19 21:39:48.422459193  [2023-04-19 21:39:45] frigate.app                    INFO    : Capture process started for frigate_garden_cam: 308
2023-04-19 21:39:48.422463190  [2023-04-19 21:39:45] frigate.app                    INFO    : Capture process started for frigate_behind_house_cam: 311
2023-04-19 21:39:48.422466294  [2023-04-19 21:39:45] frigate.app                    INFO    : Capture process started for frigate_carport_cam: 315
2023-04-19 21:39:48.446236449  [2023-04-19 21:39:45] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-04-19 21:39:48.446242266  [2023-04-19 21:39:48] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found

I assume the Google Coral is working, but still Frigate is highly CPU intensive for 4 cams:

With frigate not running:

If this is not improving / improved somehow, I will setup Frigate on a seperate piece of hardware.


This is 1 cam high res detect: