roflcoopter / viseron

Self-hosted, local only NVR and AI Computer Vision software. With features such as object detection, motion detection, face recognition and more, it gives you the power to keep an eye on your home, office or any other place you want to monitor.
MIT License
1.5k stars 154 forks source link

[3.0.0b3] Segments get moved through Tiers before being deleted #742

Closed w-marco closed 1 month ago

w-marco commented 1 month ago

Hi!

I am using Viseron 3.0.0b3 with Storage Tiers. I have a RAM-Disk as a first tier (/cache) and then my NFS mount as the second tier (/viseron). My Viseron is configured to only record when the Coral TPU detects certain objects, everything else is discarded.

This is my storage configuration:

storage:
  recorder:
    tiers:
      - path: /cache
        move_on_shutdown: true
        events:
          max_age:
            minutes: 10
      - path: /viseron
        move_on_shutdown: false
        events:
          max_age:
            days: 21
  snapshots:
    tiers:
      - path: /cache
        move_on_shutdown: true
        max_age:
          minutes: 10
      - path: /viseron
        move_on_shutdown: false
        max_age:
          days: 21

Segments from the camera are created as .m4s files in /cache/segments/camera/abc.m4s. But then, they're not directly deleted from /cache, but they move to /viseron and are then deleted immediately after. This unnecessarily creates write operations on the NFS. Can't segments that do not end up in a recording be deleted directly at Tier 0 instead of moving through the tiers and then being deleted?

roflcoopter commented 1 month ago

This is now fixed in v3.0.0b5