blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
17.99k stars 1.64k forks source link

[Config Support]: Record setting in config file - Full time record plus longer object tracking retain #6963

Closed indo419 closed 1 year ago

indo419 commented 1 year ago

Describe the problem you are having

Trying to set up recording to RECORD ALL and retain for 10 days and retain DETECTED OBJECTS for longer (usually 15 days). Having trouble getting RECORD ALL to work. Looks like it is retaining segments with motion or detected objects only.

Question: How does the record: section outside of the camera: section and the record: section inside the camera: section effect each other?

Version

0.12.1-367D724

Frigate config file

mqtt:
  enabled: False

#logger:
#  # Optional: default log level (default: shown below)
#  default: debug

detectors:
  coral:
    type: edgetpu
    device: usb

birdseye:
  enabled: True
  restream: False
  width: 1280
  height: 720
  quality: 8        # 1 is the highest quality, and 31 is the lowest.
  #   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

detect:
  enabled: True
  width: 640 # <---- update for your camera's resolution
  height: 480 # <---- update for your camera's resolution
  fps: 5
  max_disappeared: 25
  stationary:
    interval: 0
    threshold: 50
#    max_frames:
#      default: 3000
#      objects:
#        person: 1000

record:
  enabled: True
  expire_interval: 60
  retain:
    days: 10
    mode: all    # all, motion, and active_objects
  events:
    pre_capture: 5
    post_capture: 5
#    objects:    # track all opbjects
#      - person
#      - car
#      - bicycle
#      - motorcycle
#      - bus
#      - cat
#      - dog
#      - bird
#    required_zones: []
    retain:
      default: 10
      mode: motion
      objects:
        person: 15
        car: 15
        bicycle: 15
        motorcycle: 15
        bus: 15
        cat: 15
        dog: 15
#        bird: 15

snapshots:
  enabled: True
  clean_copy: True
  timestamp: True
  bounding_box: True
  crop: False
#  height: 175
#  required_zones: []
  retain:
    default: 15
    objects:
      person: 30
      car: 30
      bicycle: 30
      motorcycle: 30
      bus: 30
      cat: 30
      dog: 30
#      bird: 30

timestamp_style:
  position: "tr"
  format: "%m/%d/%Y %H:%M:%S"
  color:
    red: 255
    green: 255
    blue: 100
  thickness: 1
  # Optional: Effect of lettering (default: shown below)
  #           None (No effect),
  #           "solid" (solid background in inverse color of font)
  #           "shadow" (shadow for font)
  effect: "shadow"

cameras:
  Sigma_Pallet_Wrapper: #########################################################
    enabled: True
    ffmpeg:
      inputs:
        - path: rtsp://xxxxxxxxxxxxxxxxxxx/videoSub
          roles:
            - detect
        - path: rtsp://xxxxxxxxxxxxxxxxxxx/videoMain
          roles:
            - record

    motion:
      mask:
        - 234,0,231,27,165,24,159,0
    objects:
      track:
        - person
        - car
        - bicycle
    snapshots:
      enabled: True
      timestamp: True
      bounding_box: True
      retain:
        default: 5
        objects:
          person: 15
          car: 15
          bicycle: 15

    record:
      enabled: True
      retain:
        days: 10
        mode: all    # all, motion, and active_objects
      events:
        objects:
          - person
          - car
          - bicycle
        required_zones: []
#        retain:
#          default: 21
#          objects:
#            person: 31
#            car: 31
#            bicycle: 15

Relevant log output

2023-06-30 04:28:01.095292225  [INFO] Starting Frigate...
2023-06-30 04:28:01.971039840  [2023-06-29 21:28:01] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-06-30 04:28:02.105499152  [2023-06-29 21:28:02] peewee_migrate                 INFO    : Starting migrations
2023-06-30 04:30:52.852178692  [2023-06-29 21:28:06] peewee_migrate                 INFO    : There is nothing to migrate
2023-06-30 04:30:52.869858446  [2023-06-29 21:30:52] detector.coral                 INFO    : Starting detection process: 443
2023-06-30 04:30:52.870674036  [2023-06-29 21:30:52] frigate.app                    INFO    : Output process started: 445
2023-06-30 04:30:52.876315206  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for Sigma_Pallet_Wrapper: 452
2023-06-30 04:30:52.879909354  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for Sigma_701_Dome: 453
2023-06-30 04:30:52.885368108  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for Sigma_700_Dome: 455
2023-06-30 04:30:52.889334594  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for Sigma_701_Lobby: 456
2023-06-30 04:30:52.894673899  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for Sigma_701_TimeClock: 458
2023-06-30 04:30:52.898398098  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for Sigma_AK_Office: 460
2023-06-30 04:30:52.901587025  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for Sigma_Tool_Room: 461
2023-06-30 04:30:52.905370176  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for McBroom_Garage: 462
2023-06-30 04:30:52.908730286  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for McBroom_Kitchen: 464
2023-06-30 04:30:52.912640606  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for McBroom_22: 465
2023-06-30 04:30:52.916021158  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for McBroom_West_Back: 467
2023-06-30 04:30:52.920088264  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for McBroom_West_Front: 468
2023-06-30 04:30:52.923636888  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for McBroom_Gate: 470
2023-06-30 04:30:52.927595748  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for McBroom_Bar: 471
2023-06-30 04:30:52.931206644  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for McBroom_Front: 473
2023-06-30 04:30:52.935175456  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for McBroom_Pool: 474
2023-06-30 04:30:52.938695105  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for McBroom_Patio: 476
2023-06-30 04:30:52.942740755  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for McBroom_East_Back: 477
2023-06-30 04:30:52.946365859  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for McBroom_East_Front: 479
2023-06-30 04:30:52.950540572  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for ShowLow_Front: 480
2023-06-30 04:30:52.954692497  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for ShowLow_SideYard: 482
2023-06-30 04:30:52.958800369  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for ShowLow_LivingRoom: 484
2023-06-30 04:30:52.962640330  [2023-06-29 21:30:52] frigate.app                    INFO    : Camera processor started for ShowLow_Bedroom: 485
2023-06-30 04:30:52.966620199  [2023-06-29 21:30:52] frigate.app                    INFO    : Capture process started for Sigma_Pallet_Wrapper: 487
2023-06-30 04:30:52.970555816  [2023-06-29 21:30:52] frigate.app                    INFO    : Capture process started for Sigma_701_Dome: 490
2023-06-30 04:30:52.973953917  [2023-06-29 21:30:52] frigate.app                    INFO    : Capture process started for Sigma_700_Dome: 492
2023-06-30 04:30:52.978222649  [2023-06-29 21:30:52] frigate.app                    INFO    : Capture process started for Sigma_701_Lobby: 497
2023-06-30 04:30:52.983711880  [2023-06-29 21:30:52] frigate.app                    INFO    : Capture process started for Sigma_701_TimeClock: 506
2023-06-30 04:30:52.988844152  [2023-06-29 21:30:52] frigate.app                    INFO    : Capture process started for Sigma_AK_Office: 512
2023-06-30 04:30:52.994393909  [2023-06-29 21:30:52] frigate.app                    INFO    : Capture process started for Sigma_Tool_Room: 519
2023-06-30 04:30:53.003578398  [2023-06-29 21:30:52] frigate.app                    INFO    : Capture process started for McBroom_Garage: 523
2023-06-30 04:30:53.016931443  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for McBroom_Kitchen: 530
2023-06-30 04:30:53.016937304  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for McBroom_22: 540
2023-06-30 04:30:53.022756185  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for McBroom_West_Back: 546
2023-06-30 04:30:53.024357964  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for McBroom_West_Front: 554
2023-06-30 04:30:53.031093020  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for McBroom_Gate: 560
2023-06-30 04:30:53.035063114  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for McBroom_Bar: 569
2023-06-30 04:30:53.042617593  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for McBroom_Front: 573
2023-06-30 04:30:53.048590165  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for McBroom_Pool: 583
2023-06-30 04:30:53.055559153  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for McBroom_Patio: 588
2023-06-30 04:30:53.062019057  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for McBroom_East_Back: 596
2023-06-30 04:30:53.068125412  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for McBroom_East_Front: 603
2023-06-30 04:30:53.104075851  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for ShowLow_Front: 645
2023-06-30 04:30:53.108634102  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for ShowLow_SideYard: 650
2023-06-30 04:30:53.113191518  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for ShowLow_LivingRoom: 655
2023-06-30 04:30:53.119116997  [2023-06-29 21:30:53] frigate.app                    INFO    : Capture process started for ShowLow_Bedroom: 664
2023-06-30 04:30:55.509343858  [2023-06-29 21:30:52] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-06-30 04:30:55.512660016  [2023-06-29 21:30:55] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found

Frigate stats

No response

Operating system

HassOS

Install method

HassOS Addon

Coral version

USB

Any other information that may be helpful

Running on Ubuntu Foscam cameras

NickM-27 commented 1 year ago

Your config looks fine and does what you are describing. Is there a reason you think it is not working?

How does the record: section outside of the camera: section and the record: section inside the camera: section effect each other?

The main record section provides the default values for the cameras, if you set it at the camera section then it overrides the global default.

indo419 commented 1 year ago

Hi Nicolas,

When I play camera recordings by selecting the HOUR, the playback is not a solid hour. It jumps ahead often and there is only minutes or a partial hour recorded depending on the camera and activity level. There are recordings where no object detection has happened, but not solid hour.

Re config file OUTSIDE camera:

record: enabled: True expire_interval: 60 retain: days: 10 mode: all # all, motion, and active_objects events: pre_capture: 5 post_capture: 5 objects:

config file INSIDE camera: record: enabled: True retain: CAN THIS SECTION BE OMITTED. THE DEFAULT FROM OUTSIDE CAMERA WILL APPLY? days: 10 mode: all # all, motion, and active_objects events: objects:

How do the inside and outside record section work together? Combined? Replaced? More Restrictive, ? ? ?

On Fri, Jun 30, 2023 at 4:43 AM Nicolas Mowen @.***> wrote:

Your config looks fine and does what you are describing. Is there a reason you think it is not working?

How does the record: section outside of the camera: section and the record: section inside the camera: section effect each other?

The main record section provides the default values for the cameras, if you set it at the camera section then it overrides the global default.

— Reply to this email directly, view it on GitHub https://github.com/blakeblackshear/frigate/issues/6963#issuecomment-1614535769, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTYVUJMPUXNQUGLR2O2ZDDXN23X5ANCNFSM6AAAAAAZZK753Y . You are receiving this because you authored the thread.Message ID: @.***>

NickM-27 commented 1 year ago

When I play camera recordings by selecting the HOUR, the playback is not a solid hour. It jumps ahead often and there is only minutes or a partial hour recorded depending on the camera and activity level. There are recordings where no object detection has happened, but not solid hour.

I'd suggest double checking the config and also restarting frigate to ensure the current config is applied.

Re config file OUTSIDE camera:

record: enabled: True expire_interval: 60 retain: days: 10 mode: all # all, motion, and active_objects events: pre_capture: 5 post_capture: 5 objects:

  • person
  • car required_zones: [] retain: default: 10 mode: motion objects: person: 15 car: 15 cat: 15

config file INSIDE camera: record: enabled: True retain: CAN THIS SECTION BE OMITTED. THE DEFAULT FROM OUTSIDE CAMERA WILL APPLY?

if it is the same as the global config then it can be ommitted

    days: 10
    mode: all    # all, motion, and active_objects
  events:
    objects:
      - bicycle  WILL THIS TRACK PERSON, CAR, CAT & BICYCLE OR ONLY

BICYCLE? IS THE ENTIRE EVENTS OR OBJECT DEFAULT REPLACED HERE? OR ARE THEY MERGED?

only bicycle will be tracked for this camera

    required_zones: []
    retain:
      default: 21
      objects:
        bicycle: 15

How do the inside and outside record section work together? Combined? Replaced? More Restrictive, ? ? ?

like I said above, the camera config overrides the global config

indo419 commented 1 year ago

It seems like I have too many cameras and there is a bottleneck somewhere. When I disable some cameras the enabled cameras are able to record well.

I will try to limit recording to MOTION, set up hardware acceleration and split to multiple containers or multiple PCs.

NickM-27 commented 1 year ago

there have been a lot of improvements regarding recordings efficiency for 0.13 as well

indo419 commented 1 year ago

Is 0.13 stable? What is the command to update image to 0.13?

NickM-27 commented 1 year ago

Is 0.13 stable? What is the command to update image to 0.13?

No, it is not even in beta yet

indo419 commented 1 year ago

Copy, Thanks . . .

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.