blakeblackshear / frigate

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

max_seconds does not appear to be working #1125

Closed hursey013 closed 3 years ago

hursey013 commented 3 years ago

Describe the bug I have set max_seconds to 30, with the hopes of saving smaller clips however when I review the saved clips they are often well over the allotted time (2+ mins in some cases).

Version of frigate 0.8.4-5043040

Config file Include your full config file wrapped in triple back ticks.

mqtt:
  host: 192.168.1.155
detectors:
  cpu1:
    type: cpu
  cpu2:
    type: cpu
ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p
clips:
  max_seconds: 30
cameras:
  feeder:
    ffmpeg:
      inputs:
        - path: rtsp://192.168.1.152/live
          roles:
            - clips
            - detect
    width: 1920
    height: 1080
    fps: 5
    best_image_timeout: 300
    snapshots:
      enabled: True
    clips:
      enabled: True
      pre_capture: 0
      post_capture: 0
    detect:
      max_disappeared: 50
    objects:
      track:
        - bird
      filters:
        bird:
          min_area: 90000

Frigate stats

{
  "detection_fps": 0.0, 
  "detectors": {
    "cpu1": {
      "detection_start": 0.0, 
      "inference_speed": 61.17, 
      "pid": 34
    }, 
    "cpu2": {
      "detection_start": 0.0, 
      "inference_speed": 63.36, 
      "pid": 36
    }
  }, 
  "feeder": {
    "camera_fps": 5.1, 
    "capture_pid": 40, 
    "detection_fps": 0.0, 
    "pid": 39, 
    "process_fps": 5.1, 
    "skipped_fps": 0.0
  }, 
  "service": {
    "storage": {
      "/dev/shm": {
        "free": 63.4, 
        "mount_type": "tmpfs", 
        "total": 67.1, 
        "used": 3.7
      }, 
      "/media/frigate/clips": {
        "free": 850349.3, 
        "mount_type": "ext4", 
        "total": 983429.8, 
        "used": 83053.5
      }, 
      "/media/frigate/recordings": {
        "free": 850349.3, 
        "mount_type": "ext4", 
        "total": 983429.8, 
        "used": 83053.5
      }, 
      "/tmp/cache": {
        "free": 991.2, 
        "mount_type": "tmpfs", 
        "total": 1000.0, 
        "used": 8.8
      }
    }, 
    "uptime": 23887, 
    "version": "0.8.4-5043040"
  }
}

FFprobe from your camera

Run the following command and paste output below

ffprobe <stream_url>

Screenshots If applicable, add screenshots to help explain your problem.

Computer Hardware

Camera Info:

Additional context

blakeblackshear commented 3 years ago

The max_seconds setting is really managing the age of cached files, not the length of generated clips. There is 90 seconds of cached video for each camera built-in, and this setting is added to that 90 second baseline. With a setting of 30, any cached video segments older than 120 seconds will be expired when the process checks periodically. You can try reducing it to 0 to limit it to 90 seconds of cache.

hursey013 commented 3 years ago

Got it - thanks for the clarification, I'll give setting it to 0 a try and see how that works.