blakeblackshear / frigate

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

[Support]: Storage stats are not valid #2637

Closed MisterTdog closed 2 years ago

MisterTdog commented 2 years ago

Describe the problem you are having

Hi ! I just compared what /api/stats tells me and what windows/qnap tells me about the size of recording and clips directories: /api/stats:

    "service": {
        "storage": {
            "/dev/shm": {
                "free": 61.0,
                "mount_type": "tmpfs",
                "total": 67.1,
                "used": 6.1
            },
            "/media/frigate/clips": {
                "free": 1111882.2,
                "mount_type": "ext4",
                "total": 1962330.5,
                "used": 849894.6
            },
            "/media/frigate/recordings": {
                "free": 1111882.2,
                "mount_type": "ext4",
                "total": 1962330.5,
                "used": 849894.6
            },
            "/tmp/cache": {
                "free": 998.7,
                "mount_type": "tmpfs",
                "total": 1000.0,
                "used": 1.3
            }
        },

Windows / QNAP:

- Recording = 19.45Gb
- Clips = 55.21Mb.

I installed frigate on Docker -> QNAP. I wanted to get track of my storage on Home Assistant.. but I don't understand what /api/stats gives me....

Version

0.9.4-26AE608

Frigate config file

{
  "birdseye": {
    "enabled": false,
    "height": 720,
    "mode": "objects",
    "quality": 8,
    "width": 1280
  },
  "cameras": {
    "cam_garage": {
      "best_image_timeout": 60,
      "detect": {
        "enabled": true,
        "fps": 5,
        "height": 720,
        "max_disappeared": 25,
        "width": 1280
      },
      "ffmpeg": {
        "global_args": [
          "-hide_banner",
          "-loglevel",
          "warning"
        ],
        "hwaccel_args": [
          "-hwaccel",
          "vaapi",
          "-hwaccel_device",
          "/dev/dri/renderD128",
          "-hwaccel_output_format",
          "yuv420p"
        ],
        "input_args": [
          "-avoid_negative_ts",
          "make_zero",
          "-fflags",
          "+genpts+discardcorrupt",
          "-rtsp_transport",
          "tcp",
          "-stimeout",
          "5000000",
          "-use_wallclock_as_timestamps",
          "1"
        ],
        "inputs": [
          {
            "global_args": [],
            "hwaccel_args": [],
            "input_args": [],
            "path": "rtsp://admin:password@ip/cam/realmonitor?channel=1&subtype=00&authbasic=sefsgeh=",
            "roles": [
              "record",
              "rtmp",
              "detect"
            ]
          }
        ],
        "output_args": {
          "detect": [
            "-f",
            "rawvideo",
            "-pix_fmt",
            "yuv420p"
          ],
          "record": [
            "-f",
            "segment",
            "-segment_time",
            "10",
            "-segment_format",
            "mp4",
            "-reset_timestamps",
            "1",
            "-strftime",
            "1",
            "-c",
            "copy",
            "-an"
          ],
          "rtmp": [
            "-c",
            "copy",
            "-f",
            "flv"
          ]
        }
      },
      "ffmpeg_cmds": [
        {
          "cmd": "ffmpeg -hide_banner -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://user:pass@ip/cam/realmonitor?channel=1&subtype=00&authbasic=fze= -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/cam_garage-%Y%m%d%H%M%S.mp4 -c copy -f flv rtmp://127.0.0.1/live/cam_garage -r 5 -s 1280x720 -f rawvideo -pix_fmt yuv420p pipe:",
          "roles": [
            "record",
            "rtmp",
            "detect"
          ]
        }
      ],
      "live": {
        "height": 720,
        "quality": 8
      },
      "motion": {
        "contour_area": 99,
        "delta_alpha": 0.2,
        "frame_alpha": 0.2,
        "frame_height": 180,
        "mask": [
          "1234,41,1232,84,932,84,928,43"
        ],
        "threshold": 25
      },
      "mqtt": {
        "bounding_box": true,
        "crop": true,
        "enabled": true,
        "height": 270,
        "quality": 70,
        "required_zones": [],
        "timestamp": true
      },
      "name": "cam_garage",
      "objects": {
        "filters": {
          "animal": {
            "mask": null,
            "max_area": 24000000,
            "min_area": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "personne": {
            "mask": null,
            "max_area": 24000000,
            "min_area": 0,
            "min_score": 0.5,
            "threshold": 0.7
          },
          "vehicule": {
            "mask": null,
            "max_area": 300000,
            "min_area": 5000,
            "min_score": 0.5,
            "threshold": 0.7
          }
        },
        "mask": "",
        "track": [
          "personne",
          "vehicule",
          "animal"
        ]
      },
      "record": {
        "enabled": true,
        "events": {
          "max_seconds": 300,
          "objects": null,
          "post_capture": 5,
          "pre_capture": 5,
          "required_zones": [
            "terrain",
            "entree_allee",
            "route"
          ],
          "retain": {
            "default": 10,
            "objects": {
              "personne": 15
            }
          }
        },
        "retain_days": 2
      },
      "rtmp": {
        "enabled": true
      },
      "snapshots": {
        "bounding_box": true,
        "clean_copy": true,
        "crop": false,
        "enabled": true,
        "height": null,
        "quality": 70,
        "required_zones": [
          "terrain",
          "entree_allee",
          "route",
          "boite_aux_lettres"
        ],
        "retain": {
          "default": 10,
          "objects": {
            "personne": 15
          }
        },
        "timestamp": false
      },
      "timestamp_style": {
        "color": {
          "blue": 255,
          "green": 255,
          "red": 255
        },
        "effect": null,
        "format": "%m/%d/%Y %H:%M:%S",
        "position": "tl",
        "thickness": 2
      },
      "zones": {
        "boite_aux_lettres": {
          "coordinates": "823,157,843,169,845,190,834,204,807,190,794,177,782,150,802,144",
          "filters": {},
          "objects": [
            "personne",
            "vehicule"
          ]
        },
        "entree_allee": {
          "coordinates": "1280,466,1280,538,1280,573,847,216,951,211,1146,348",
          "filters": {},
          "objects": [
            "personne",
            "vehicule",
            "animal"
          ]
        },
        "route": {
          "coordinates": "808,122,1280,457,1280,222,829,39",
          "filters": {},
          "objects": [
            "personne",
            "vehicule",
            "animal"
          ]
        },
        "terrain": {
          "coordinates": "567,0,1280,616,1280,720,0,720,0,0",
          "filters": {},
          "objects": [
            "personne",
            "animal"
          ]
        }
      }
    }
  },
  "database": {
    "path": "/media/frigate/frigate.db"
  },
  "detect": {
    "enabled": true,
    "fps": 5,
    "height": 720,
    "max_disappeared": null,
    "width": 1280
  },
  "detectors": {
    "cpu": {
      "device": "usb",
      "num_threads": 3,
      "type": "cpu"
    }
  },
  "environment_vars": {},
  "ffmpeg": {
    "global_args": [
      "-hide_banner",
      "-loglevel",
      "warning"
    ],
    "hwaccel_args": [],
    "input_args": [
      "-avoid_negative_ts",
      "make_zero",
      "-fflags",
      "+genpts+discardcorrupt",
      "-rtsp_transport",
      "tcp",
      "-stimeout",
      "5000000",
      "-use_wallclock_as_timestamps",
      "1"
    ],
    "output_args": {
      "detect": [
        "-f",
        "rawvideo",
        "-pix_fmt",
        "yuv420p"
      ],
      "record": [
        "-f",
        "segment",
        "-segment_time",
        "10",
        "-segment_format",
        "mp4",
        "-reset_timestamps",
        "1",
        "-strftime",
        "1",
        "-c",
        "copy",
        "-an"
      ],
      "rtmp": [
        "-c",
        "copy",
        "-f",
        "flv"
      ]
    }
  },
  "live": {
    "height": 720,
    "quality": 8
  },
  "logger": {
    "default": "info",
    "logs": {}
  },
  "model": {
    "height": 320,
    "labelmap": {
      "0": "personne",
      "1": "vehicule",
      "2": "vehicule",
      "3": "vehicule",
      "5": "vehicule",
      "7": "vehicule",
      "15": "animal",
      "16": "animal",
      "17": "animal",
      "18": "animal",
      "19": "animal",
      "20": "animal",
      "21": "animal",
      "22": "animal",
      "23": "animal",
      "24": "animal"
    },
    "labelmap_path": null,
    "path": null,
    "width": 320
  },
  "motion": null,
  "mqtt": {
    "client_id": "frigate",
    "host": "ip",
    "password": "password",
    "port": 1883,
    "stats_interval": 60,
    "tls_ca_certs": null,
    "tls_client_cert": null,
    "tls_client_key": null,
    "tls_insecure": null,
    "topic_prefix": "frigate",
    "user": "user"
  },
  "objects": {
    "filters": {
      "vehicule": {
        "mask": null,
        "max_area": 300000,
        "min_area": 5000,
        "min_score": 0.5,
        "threshold": 0.7
      }
    },
    "mask": "",
    "track": [
      "personne",
      "vehicule",
      "animal"
    ]
  },
  "record": {
    "enabled": true,
    "events": {
      "max_seconds": 300,
      "objects": null,
      "post_capture": 5,
      "pre_capture": 5,
      "required_zones": [
        "terrain",
        "entree_allee",
        "route",
        "boite_aux_lettres"
      ],
      "retain": {
        "default": 10,
        "objects": {
          "personne": 15
        }
      }
    },
    "retain_days": 2
  },
  "rtmp": {
    "enabled": true
  },
  "snapshots": {
    "bounding_box": true,
    "clean_copy": true,
    "crop": false,
    "enabled": true,
    "height": null,
    "quality": 70,
    "required_zones": [],
    "retain": {
      "default": 10,
      "objects": {
        "personne": 15
      }
    },
    "timestamp": false
  },
  "timestamp_style": {
    "color": {
      "blue": 255,
      "green": 255,
      "red": 255
    },
    "effect": null,
    "format": "%m/%d/%Y %H:%M:%S",
    "position": "tl",
    "thickness": 2
  }
}

Relevant log output

n/a

FFprobe output from your camera

n/a

Frigate stats

{"cam_garage":{"camera_fps":5.2,"capture_pid":225,"detection_fps":0.2,"pid":222,"process_fps":0.1,"skipped_fps":0.0},"detection_fps":0.2,"detectors":{"cpu":{"detection_start":1642068555.032477,"inference_speed":4201.58,"pid":218}},"service":{"storage":{"/dev/shm":{"free":61.0,"mount_type":"tmpfs","total":67.1,"used":6.1},"/media/frigate/clips":{"free":1111684.8,"mount_type":"ext4","total":1962330.5,"used":850092.1},"/media/frigate/recordings":{"free":1111684.8,"mount_type":"ext4","total":1962330.5,"used":850092.1},"/tmp/cache":{"free":998.4,"mount_type":"tmpfs","total":1000.0,"used":1.6}},"uptime":5676,"version":"0.9.4-26ae608"}}

Operating system

Other

Install method

Docker Compose

Coral version

CPU (no coral)

Network connection

Mixed

Camera make and model

Imou life

Any other information that may be helpful

No response

blakeblackshear commented 2 years ago

It's telling you the stats for the drive where recordings, etc are stored. It's not telling you the size of that directory alone.

MisterTdog commented 2 years ago

hum... ok There is still a little difference between QNAP and Frigate : Frigate : used=852609.9 = 832Gb? QNAP : used=794Gb

anyway, would it be possible for frigate to give stats about size of its media folder?

blakeblackshear commented 2 years ago

That would be possible.

stale[bot] commented 2 years 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.