Versioner sammenlignet

Nøgle

  • Linjen blev tilføjet.
  • Denne linje blev fjernet.
  • Formatering blev ændret.

...

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

...

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:

Kodeblok
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

Tip

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.


Kodeblok
mqtt:
  host: 10.
Kodeblok
mqtt:
  host: 10.0.0.183
go2rtc:
cameras:
  frigate_front_door_cam  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:
    ffmpeg  enabled: True
      inputstimestamp: false
      bounding_box:  - path: rtsp://user:password@10.0.0.151:554//h264Preview_01_main
True
      retain:
        default: 2
    rolesrecord:
      enabled: True
     - detectevents:
        - path: rtsp://user:password@10.0.0.151:554//h264Preview_01_subretain:
          rolesdefault: 10
      frigate_behind_house_cam:
    ffmpeg:
  - record
    rtmpinputs:
      enabled: False
 -   detect:path: rtsp://127.0.0.1:8554/frigate_behind_house_cam_sub?video=copy
      width: 640
      height: 480input_args: preset-rtsp-restream
      fps: 10
    objectsroles:
      track:
        - persondetect
    snapshots:
    -  enabled: True
      timestamp: false
path: rtsp://127.0.0.1:8554/frigate_behind_house_cam_main?video=copy&audio=aac
          boundinginput_boxargs: True
preset-rtsp-restream
          retainroles:
        default:   2
  frigate_garden_cam:- record
    ffmpegrtmp:
      inputsenabled: False
    detect:
    -  path: rtsp://user:password@10.0.0.108:554//h264Preview_01_mainwidth: 640
      height: 480
      fps: 5
    rolesobjects:
      track:
        - detectperson
    snapshots:
    - path: rtsp://user:password@10.0.0.108:554//h264Preview_01_sub
 enabled: True
      timestamp: false
      rolesbounding_box: True
      retain:
       - default: record2
    rtmprecord:
      enabled: FalseTrue
     detect events:
       width retain: 2560
      height: 1920
   default: 10
  fps: 10frigate_carport_cam:
    objectsffmpeg:
      trackinputs:
        - person
    snapshots:path: rtsp://127.0.0.1:8554/frigate_carport_cam_sub?video=copy
      enabled: True
      timestampinput_args: false
   preset-rtsp-restream
   bounding_box: True
      retainroles:
        default:   2
  frigate_behind_house_cam:- detect
    ffmpeg:
    -  inputs:
path: rtsp://127.0.0.1:8554/frigate_carport_cam_main?video=copy&audio=aac
         - pathinput_args: rtsp://user:password@10.0.0.176:554//h264Preview_01_mainpreset-rtsp-restream
          roles:
            - detectrecord
    rtmp:
    - path: rtsp://user:password@10.0.0.176:554//h264Preview_01_subenabled: False
    detect:
      roleswidth: 640
      height: 480
      -fps: record5
    rtmpobjects:
      enabledtrack:
 False
      detect:
 - person
    widthsnapshots: 2560
      heightenabled: 1920True
      fpstimestamp: 10false
    objects:  bounding_box: True
      trackretain:
        -default: person2
    snapshotsrecord:
      enabled: True
      timestampevents: false
      bounding_box: True
      retain:
          default: 210
  frigate_big_carportshed_cam:
    ffmpeg:
      inputs:
        - path: rtsp://user:password@10127.0.0.191:554//h264Preview_01_main1:8554/frigate_big_shed_cam_sub?video=copy
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://user:password@10127.0.0.1911:554//h264Preview_01_sub8554/frigate_big_shed_cam_main?video=copy&audio=aac
          input_args: preset-rtsp-restream
          roles:
            - record
    rtmp:
      enabled: False
    detect:
       detectwidth: 640
      height: 480
      fps: 5
    objects:
      track:
      width: 2560
 - person
    heightsnapshots: 1920
      fpsenabled: 10True
      objectstimestamp: false
      trackbounding_box: True
        - personretain:
        -default: car2
    snapshotsrecord:
      enabled: True
      timestampevents: false
      bounding_box: True
      retain:
          default: 210
detectors:
  coral:
    type: edgetpu
    device: usb
birdseye:
  enabled: True
  mode: continuous

CPU - With Google Coral

As the logs states:

Kodeblok
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:

Image Added

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


This is 1 cam high res detect:

Image Added