blakeblackshear / frigate-hass-addons

Frigate hass.io addons
MIT License
243 stars 129 forks source link

Trouble configuring frigate, probably missing something basic #171

Open mad-tunes opened 5 months ago

mad-tunes commented 5 months ago

I've got a couple esp32cams and am hoping to use them as really basic security cameras. After giving up on motioneye (as here), I've been trying to get Frigate up and running.

It's installed and connected to a camera, but I'm really stuggling with configuring anything else using it's yml.

Once a person's detected, it's taking a few still images OK, with a timestamp added. Recording a video has me baffled though.

I currently get a video with no timestamp, of a period thats after the persons detected and left the frame. Close but completely useless.

Can anyone see what I'm doing wrong please?

mqtt:
  enabled: True
  host: 192.168.5.5
  user: mqtt
  password: mqtt

detectors:
  cpu0:
    type: cpu
  cpu1:
    type: cpu
  cpu2:
    type: cpu
  cpu3:
    type: cpu

cameras:
  ESPCamGarden:
    ffmpeg:
      input_args: ""
      inputs:
        - path: http://192.168.5.10:8080
          roles:
            - detect
            - record

record:
  enabled: True
  retain:
    days: 7
    mode: active_objects
  # timestamp: True
  events:
    pre_capture: 5
    post_capture: 5
    retain:
      default: 10
      mode: active_objects
      objects:
        person: 15
    # timestamp: True
detect:
  enabled: True
  width: 1920
  height: 1080
  fps: 5
  # timestamp: True
objects:
  track:
    - person
    - bird
    - cat
    - cup
snapshots:
  enabled: True
  clean_copy: False
  timestamp: True
  bounding_box: False
  crop: False
  retain:
    default: 7
    mode: active_objects
  quality: 100
motion:
  threshold: 30
  lightning_threshold: 0.8
  improve_contrast: True
  # timestamp: True
live:
  stream_name: camera_name
  height: 1080
  quality: 10
  # timestamp: True
timestamp_style:
  position: "tl"
  format: "%m/%d/%Y %H:%M:%S"
  color:
    red: 255
    green: 255
    blue: 255
  thickness: 2
  effect: shadow

Also, the video thats recorded doesn't show within the event in Frigate, instead it shows The media could not be loaded, either because the server or network failed or because the format is not supported.. The video file has been stored and can be played with VLC OK. image

mad-tunes commented 5 months ago

I'm having trouble exporting too, it never seems to find anything to export even though there's an event and saved picture/video within the time period I tried to export. Frigate log:

2024-06-10 11:51:22.815289369 [INFO] Preparing Frigate... 2024-06-10 11:51:22.843831449 [INFO] Starting Frigate... 2024-06-10 11:51:25.248106866 [2024-06-10 12:51:25] frigate.app INFO : Starting Frigate (0.13.2-6476f8a) 2024-06-10 11:51:25.248757950 [2024-06-10 12:51:25] frigate.app INFO : Creating directory: /tmp/cache 2024-06-10 11:51:25.604453605 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Starting migrations 2024-06-10 11:51:25.619377359 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "001_create_events_table" 2024-06-10 11:51:25.619725979 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE TABLE IF NOT EXISTS "event" ("id" VARCHAR(30) NOT NULL PRIMARY KEY, "label" VARCHAR(20) NOT NULL, "camera" VARCHAR(20) NOT NULL, "start_time" DATETIME NOT NULL, "end_time" DATETIME NOT NULL, "top_score" REAL NOT NULL, "false_positive" INTEGER NOT NULL, "zones" JSON NOT NULL, "thumbnail" TEXT NOT NULL)',) 2024-06-10 11:51:25.620132049 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE INDEX IF NOT EXISTS "event_label" ON "event" ("label")',) 2024-06-10 11:51:25.620642218 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE INDEX IF NOT EXISTS "event_camera" ON "event" ("camera")',) 2024-06-10 11:51:25.621776817 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 001_create_events_table 2024-06-10 11:51:25.630395758 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "002_add_clip_snapshot" 2024-06-10 11:51:25.630580098 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('event', 'has_clip', ) 2024-06-10 11:51:25.634644664 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('event', 'has_snapshot', ) 2024-06-10 11:51:25.637882900 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 002_add_clip_snapshot 2024-06-10 11:51:25.646901991 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "003_create_recordings_table" 2024-06-10 11:51:25.647075206 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE TABLE IF NOT EXISTS "recordings" ("id" VARCHAR(30) NOT NULL PRIMARY KEY, "camera" VARCHAR(20) NOT NULL, "path" VARCHAR(255) NOT NULL, "start_time" DATETIME NOT NULL, "end_time" DATETIME NOT NULL, "duration" REAL NOT NULL)',) 2024-06-10 11:51:25.647443316 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE INDEX IF NOT EXISTS "recordings_camera" ON "recordings" ("camera")',) 2024-06-10 11:51:25.647800725 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE UNIQUE INDEX IF NOT EXISTS "recordings_path" ON "recordings" ("path")',) 2024-06-10 11:51:25.648323615 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE INDEX IF NOT EXISTS "recordings_start_time_end_time" ON "recordings" (start_time, end_time)',) 2024-06-10 11:51:25.649074994 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 003_create_recordings_table 2024-06-10 11:51:25.655957007 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "004_add_bbox_region_area" 2024-06-10 11:51:25.656163411 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('event', 'region', ) 2024-06-10 11:51:25.659460778 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('event', 'box', ) 2024-06-10 11:51:25.662399855 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('event', 'area', ) 2024-06-10 11:51:25.665623207 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 004_add_bbox_region_area 2024-06-10 11:51:25.674775407 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "005_make_end_time_nullable" 2024-06-10 11:51:25.674940752 [2024-06-10 12:51:25] peewee_migrate.logs INFO : drop_not_null ('event', 'end_time') 2024-06-10 11:51:25.677854589 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 005_make_end_time_nullable 2024-06-10 11:51:25.684088438 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "006_add_motion_active_objects" 2024-06-10 11:51:25.684256312 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('recordings', 'objects', ) 2024-06-10 11:51:25.684908031 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('recordings', 'motion', ) 2024-06-10 11:51:25.685902060 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 006_add_motion_active_objects 2024-06-10 11:51:25.691685034 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "007_add_retain_indefinitely" 2024-06-10 11:51:25.691846590 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('event', 'retain_indefinitely', ) 2024-06-10 11:51:25.695547070 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 007_add_retain_indefinitely 2024-06-10 11:51:25.701458720 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "008_add_sub_label" 2024-06-10 11:51:25.701660304 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('event', 'sub_label', ) 2024-06-10 11:51:25.702672993 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 008_add_sub_label 2024-06-10 11:51:25.707726453 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "009_add_object_filter_ratio" 2024-06-10 11:51:25.707849063 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('event', 'ratio', ) 2024-06-10 11:51:25.711386569 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 009_add_object_filter_ratio 2024-06-10 11:51:25.721954748 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "010_add_plus_image_id" 2024-06-10 11:51:25.722096158 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('event', 'plus_id', ) 2024-06-10 11:51:25.723131847 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 010_add_plus_image_id 2024-06-10 11:51:25.729935490 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "011_update_indexes" 2024-06-10 11:51:25.730054860 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE INDEX "event_start_time_end_time" ON "event" ("start_time" DESC, "end_time" DESC)',) 2024-06-10 11:51:25.730555004 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('DROP INDEX recordings_start_time_end_time',) 2024-06-10 11:51:25.730934549 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE INDEX "recordings_end_time_start_time" ON "recordings" ("end_time" DESC, "start_time" DESC)',) 2024-06-10 11:51:25.731756088 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 011_update_indexes 2024-06-10 11:51:25.741269883 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "012_add_segment_size" 2024-06-10 11:51:25.741388052 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('recordings', 'segment_size', ) 2024-06-10 11:51:25.745670648 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 012_add_segment_size 2024-06-10 11:51:25.753149940 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "013_create_timeline_table" 2024-06-10 11:51:25.753344560 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE TABLE IF NOT EXISTS "timeline" ("timestamp" DATETIME NOT NULL, "camera" VARCHAR(20) NOT NULL, "source" VARCHAR(20) NOT NULL, "source_id" VARCHAR(30), "class_type" VARCHAR(50) NOT NULL, "data" JSON)',) 2024-06-10 11:51:25.753843339 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE INDEX IF NOT EXISTS "timeline_camera" ON "timeline" ("camera")',) 2024-06-10 11:51:25.754225934 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE INDEX IF NOT EXISTS "timeline_source" ON "timeline" ("source")',) 2024-06-10 11:51:25.754500529 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE INDEX IF NOT EXISTS "timeline_source_id" ON "timeline" ("source_id")',) 2024-06-10 11:51:25.755333987 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 013_create_timeline_table 2024-06-10 11:51:25.763082489 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "014_event_updates_for_fp" 2024-06-10 11:51:25.763308959 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('event', 'score', ) 2024-06-10 11:51:25.764104748 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('event', 'model_hash', ) 2024-06-10 11:51:25.764867898 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('event', 'detector_type', ) 2024-06-10 11:51:25.765768157 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('event', 'model_type', ) 2024-06-10 11:51:25.766409796 [2024-06-10 12:51:25] peewee_migrate.logs INFO : drop_not_null ('event', 'area') 2024-06-10 11:51:25.770249652 [2024-06-10 12:51:25] peewee_migrate.logs INFO : drop_not_null ('event', 'false_positive') 2024-06-10 11:51:25.773273579 [2024-06-10 12:51:25] peewee_migrate.logs INFO : apply_default ('event', 'false_positive', ) 2024-06-10 11:51:25.774102738 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 014_event_updates_for_fp 2024-06-10 11:51:25.784804587 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "015_event_refactor" 2024-06-10 11:51:25.784976632 [2024-06-10 12:51:25] peewee_migrate.logs INFO : drop_not_null ('event', 'top_score') 2024-06-10 11:51:25.788162343 [2024-06-10 12:51:25] peewee_migrate.logs INFO : drop_not_null ('event', 'score') 2024-06-10 11:51:25.791022390 [2024-06-10 12:51:25] peewee_migrate.logs INFO : drop_not_null ('event', 'region') 2024-06-10 11:51:25.793822557 [2024-06-10 12:51:25] peewee_migrate.logs INFO : drop_not_null ('event', 'box') 2024-06-10 11:51:25.796420685 [2024-06-10 12:51:25] peewee_migrate.logs INFO : drop_not_null ('event', 'area') 2024-06-10 11:51:25.799144722 [2024-06-10 12:51:25] peewee_migrate.logs INFO : drop_not_null ('event', 'ratio') 2024-06-10 11:51:25.801967229 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('event', 'data', ) 2024-06-10 11:51:25.805796635 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 015_event_refactor 2024-06-10 11:51:25.811987728 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "016_sublabel_increase" 2024-06-10 11:51:25.812168248 [2024-06-10 12:51:25] peewee_migrate.logs INFO : change_column ('event', 'sub_label', ) 2024-06-10 11:51:25.815712814 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 016_sublabel_increase 2024-06-10 11:51:25.821448938 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "017_update_indexes" 2024-06-10 11:51:25.821730018 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE INDEX "recordings_camera_segment_size" ON "recordings" ("camera", "segment_size")',) 2024-06-10 11:51:25.822509557 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 017_update_indexes 2024-06-10 11:51:25.827810611 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "018_add_dbfs" 2024-06-10 11:51:25.827984461 [2024-06-10 12:51:25] peewee_migrate.logs INFO : add_column ('recordings', 'dBFS', ) 2024-06-10 11:51:25.828936290 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 018_add_dbfs 2024-06-10 11:51:25.835214254 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "019_create_regions_table" 2024-06-10 11:51:25.835469284 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE TABLE IF NOT EXISTS "regions" ("camera" VARCHAR(20) NOT NULL PRIMARY KEY, "last_update" DATETIME NOT NULL, "grid" JSON)',) 2024-06-10 11:51:25.836131863 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 019_create_regions_table 2024-06-10 11:51:25.842767745 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Migrate "020_update_index_recordings" 2024-06-10 11:51:25.842962495 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('DROP INDEX recordings_end_time_start_time',) 2024-06-10 11:51:25.843307005 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE INDEX "recordings_camera_start_time_end_time" ON "recordings" ("camera", "start_time" DESC, "end_time" DESC)',) 2024-06-10 11:51:25.843853734 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE INDEX "recordings_api_recordings_summary" ON "recordings" ("camera", "start_time" DESC, "duration", "motion", "objects")',) 2024-06-10 11:51:25.844093624 [2024-06-10 12:51:25] peewee_migrate.logs INFO : sql ('CREATE INDEX "recordings_start_time" ON "recordings" ("start_time")',) 2024-06-10 11:51:25.844867739 [2024-06-10 12:51:25] peewee_migrate.logs INFO : Done 020_update_index_recordings 2024-06-10 11:51:25.865060272 [2024-06-10 12:51:25] frigate.app INFO : Recording process started: 306 2024-06-10 11:51:25.869960827 [2024-06-10 12:51:25] frigate.app INFO : go2rtc process pid: 89 2024-06-10 11:51:25.913711176 [2024-06-10 12:51:25] detector.cpu0 INFO : Starting detection process: 316 2024-06-10 11:51:25.919644875 [2024-06-10 12:51:25] frigate.detectors WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes. 2024-06-10 11:51:25.927796012 [2024-06-10 12:51:25] detector.cpu1 INFO : Starting detection process: 318 2024-06-10 11:51:25.932782211 [2024-06-10 12:51:25] frigate.detectors WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes. 2024-06-10 11:51:25.940017853 [2024-06-10 12:51:25] detector.cpu2 INFO : Starting detection process: 320 2024-06-10 11:51:25.946863141 [2024-06-10 12:51:25] frigate.detectors WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes. 2024-06-10 11:51:25.955816832 [2024-06-10 12:51:25] detector.cpu3 INFO : Starting detection process: 322 2024-06-10 11:51:25.961038111 [2024-06-10 12:51:25] frigate.detectors WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes. 2024-06-10 11:51:25.965268552 [2024-06-10 12:51:25] frigate.app INFO : Output process started: 324 2024-06-10 11:51:25.989228282 [2024-06-10 12:51:25] frigate.app INFO : Camera processor started for Back_Garden: 329 2024-06-10 11:51:26.001335754 [2024-06-10 12:51:25] frigate.app INFO : Capture process started for Back_Garden: 330 2024-06-10 12:01:10.648284744 [2024-06-10 13:01:10] frigate.record.export ERROR : Failed to export recording for command ffmpeg -hide_banner -y -protocol_whitelist pipe,file,http,tcp -i http://127.0.0.1:5000/vod/Back_Garden/start/1718019900/end/1718020800/index.m3u8 -c copy /media/frigate/exports/in_progress.Back_Garden@2024_06_10_12_45__2024_06_10_13_00.mp4 2024-06-10 12:01:10.648542304 [2024-06-10 13:01:10] frigate.record.export ERROR : [http @ 0x55cbb5305280] HTTP error 400 Bad Request 2024-06-10 12:01:10.648546514 http://127.0.0.1:5000/vod/Back_Garden/start/1718019900/end/1718020800/index.m3u8: Server returned 400 Bad Request 2024-06-10 12:01:10.648548354

Current Frigate config (different to above, as I've been trying allsorts recently):

mqtt:
  enabled: True
  host: 192.168.5.5
  user: mqtt
  password: mqtt

detectors:
  cpu0:
    type: cpu
  cpu1:
    type: cpu
  cpu2:
    type: cpu
  cpu3:
    type: cpu

cameras:
  Back_Garden:
    ffmpeg:
      input_args: "preset-http-mjpeg-generic"
      inputs:
        - path: http://192.168.5.10:8080
          roles:
            - detect
            - record
    detect:
      enabled: True
      fps: 10
    motion:
      threshold: 70
      contour_area: 30
      lightning_threshold: 0.8
      improve_contrast: True
      mask:
        - 552,0,550,58,348,190,0,195,0,0
        - 0,423,0,242,339,240,345,452
    objects:
      track:
        - person
        - bird
        - cat
        - cup
    record:
      enabled: True
      retain:
        days: 0
        mode: all
      events:
        pre_capture: 10
        post_capture: 10
        retain:
          default: 30
          mode: active_objects

snapshots:
  enabled: True
  clean_copy: False
  timestamp: True
  bounding_box: False
  crop: False
  retain:
    default: 10
    mode: active_objects
  quality: 100
timestamp_style:
  position: "tl"
  format: "%m/%d/%Y %H:%M:%S"
  color:
    red: 255
    green: 255
    blue: 255
  thickness: 2
  effect: shadow
live:
  stream_name: camera_name
  height: 1080
  quality: 10
birdseye:
  enabled: True
  mode: objects
  inactivity_threshold: 300
logger:
  default: info
  logs:
    frigate.detectors: info

I still have 'The media could not be loaded, either because the server or network failed or because the format is not supported.' showing for each clip under Events.