blakeblackshear / frigate

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

[Support]: Exception in thread recording_maint #2651

Closed mtongnz closed 2 years ago

mtongnz commented 2 years ago

Describe the problem you are having

No new recordings are working. I can view old recordings fine but new recordings seem to not be made.

I get this error: ValueError: time data '%Y%m%d%H%M%S' does not match format '%Y%m%d%H%M%S'

Odd as those formats look identical.

Have tried simplifying the config to a single cam and removing zones... didn't work. Tried to force docker image update... didn't work. Tried to delete the docker image and re-install... didn't work.

I'm out of ideas to fix this.

Version

0.9.4-26AE608

Frigate config file

mqtt:
  host: 192.168.1.242

detectors:
  cpu1:
    type: cpu
  cpu2:
    type: cpu

record:
  enabled: True
  retain_days: 0
  events:
    pre_capture: 5
    post_capture: 5
    max_seconds: 600
    retain:
      default: 14

snapshots:
  enabled: True
  bounding_box: false
  retain:
    default: 5

detect:
  enabled: True
  fps: 5
  max_disappeared: 15

rtmp:
  enabled: True

cameras:
  cam_backdoor:
    ffmpeg:
      inputs:
#        - path: rtsp://192.168.9.103:554/user=***&password=***&channel=2&stream=1.sdp?real_stream
#          roles:
#            - detect
        - path: rtsp://192.168.9.103:554/user=***&password=***&channel=1&stream=0.sdp?real_stream
          roles:
            - detect
            - rtmp
            - record
    detect:
#      width: 704
#      height: 576
      width: 1280
      height: 960
    objects:
      track:
        - person
        - car
      filters:
        person:
          min_score: 0.45
          threshold: 0.65
        car:
          min_score: 0.6
          threshold: 0.75
    zones:
      back_deck:
        coordinates: 0,960,850,960,746,0,0,0
      back_gate:
        coordinates: 1280,960,864,960,739,0,996,0,1028,515,1280,633
      drive:
        coordinates: 1280,334,1280,627,1060,528,1053,268
      neighbors:
        coordinates: 1059,264,1280,317,1280,0,1023,0
    motion:
      contour_area: 150

  cam_drive:
    ffmpeg:
      inputs:
        - path: rtsp://192.168.9.102:554/user=***&password=***&channel=1&stream=0.sdp?real_stream
          roles:
            - detect
            - rtmp
            - record
    detect:
      width: 1280
      height: 960
    objects:
      track:
        - person
        - car
      filters:
        person:
          min_score: 0.5
          threshold: 0.65
        car:
          min_score: 0.6
          threshold: 0.75
    zones:
      drive:
        coordinates: 0,960,1280,960,1280,412,412,268,397,107,0,175
      neighbors:
        coordinates: 1280,101,1172,398,451,270,446,79,0,161,0,0
    motion:
      contour_area: 200
      mask:
        - 887,0,975,82,975,145,814,110,833,0

  cam_frontyard:
    ffmpeg:
      inputs:
        - path: rtsp://192.168.9.101:554/user=***&password=***&channel=1&stream=0.sdp?real_stream
          roles:
            - detect
            - rtmp
            - record
    detect:
      width: 1920
      height: 1080
    objects:
      track:
        - person
        - car
      filters:
        person:
          min_score: 0.6
          threshold: 0.75
        car:
          min_score: 0.6
          threshold: 0.75
    zones:
      front_gate:
        coordinates: 521,880,982,767,761,676,730,532,536,593
      front_yard:
        coordinates: 542,870,1007,779,761,598,1128,521,1449,376,1469,251,1920,323,1920,1080,29,1080,119,831,355,781
      street:
        coordinates: 1352,246,1359,110,1620,113,1606,28,281,208,261,70,0,84,0,596
      neighbors:
        coordinates: 268,205,1613,31,1617,120,1920,159,1920,0,265,0
      fence:
        coordinates: 154,795,390,765,360,540,716,445,734,582,1114,492,1347,370,1338,254,22,607
      letter_box:
        coordinates: 779,357,792,437,726,440,723,353
    motion:
      contour_area: 150
      mask:
        - 0,0,486,0,179,187,216,508,363,415,550,459,586,760,424,887,246,725,183,545,0,568

Relevant log output

[2022-01-16 13:13:12] frigate.app INFO : Starting Frigate (0.9.4-26ae608)
Starting migrations
[2022-01-16 13:13:13] peewee_migrate INFO : Starting migrations
There is nothing to migrate
[2022-01-16 13:13:13] peewee_migrate INFO : There is nothing to migrate
[2022-01-16 13:13:13] frigate.mqtt INFO : MQTT connected
[2022-01-16 13:13:13] detector.cpu1 INFO : Starting detection process: 257
[2022-01-16 13:13:13] frigate.edgetpu WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.

[2022-01-16 13:13:13] frigate.app INFO : Output process started: 260
[2022-01-16 13:13:13] detector.cpu2 INFO : Starting detection process: 259
[2022-01-16 13:13:13] ws4py INFO : Using epoll
[2022-01-16 13:13:13] frigate.edgetpu WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.

[2022-01-16 13:13:13] frigate.app INFO : Camera processor started for cam_backdoor: 265
[2022-01-16 13:13:13] frigate.app INFO : Camera processor started for cam_drive: 267
[2022-01-16 13:13:13] frigate.app INFO : Camera processor started for cam_frontyard: 269
[2022-01-16 13:13:13] frigate.app INFO : Capture process started for cam_backdoor: 270
[2022-01-16 13:13:13] frigate.app INFO : Capture process started for cam_drive: 274
[2022-01-16 13:13:13] frigate.app INFO : Capture process started for cam_frontyard: 277
[2022-01-16 13:13:13] ws4py INFO : Using epoll
Exception in thread recording_maint:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/opt/frigate/frigate/record.py", line 137, in run
self.move_files()
File "/opt/frigate/frigate/record.py", line 77, in move_files
start_time = datetime.datetime.strptime(date, "%Y%m%d%H%M%S")
File "/usr/lib/python3.8/_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
File "/usr/lib/python3.8/_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '%Y%m%d%H%M%S' does not match format '%Y%m%d%H%M%S'

FFprobe output from your camera

n/a

Frigate stats

{"cam_backdoor":{"camera_fps":5.1,"capture_pid":270,"detection_fps":0.0,"pid":265,"process_fps":5.1,"skipped_fps":0.0},"cam_drive":{"camera_fps":5.1,"capture_pid":274,"detection_fps":3.6,"pid":267,"process_fps":5.0,"skipped_fps":0.0},"cam_frontyard":{"camera_fps":5.0,"capture_pid":277,"detection_fps":14.5,"pid":269,"process_fps":5.1,"skipped_fps":0.0},"detection_fps":18.1,"detectors":{"cpu1":{"detection_start":1642292592.022291,"inference_speed":48.8,"pid":257},"cpu2":{"detection_start":1642292592.01615,"inference_speed":46.03,"pid":259}},"service":{"storage":{"/dev/shm":{"free":5355.5,"mount_type":"tmpfs","total":5368.7,"used":13.2},"/media/frigate/clips":{"free":304507.5,"mount_type":"xfs","total":1999422.1,"used":1694914.6},"/media/frigate/recordings":{"free":304507.5,"mount_type":"xfs","total":1999422.1,"used":1694914.6},"/tmp/cache":{"free":13978.9,"mount_type":"rootfs","total":16716.1,"used":2737.2}},"uptime":599,"version":"0.9.4-26ae608"}}

Operating system

UNRAID

Install method

Docker CLI

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

Chinese cams

Any other information that may be helpful

I have just purchased a Annke C800 4K cam that I've been trying to get working nicely with Frigate. Flashed the Hikvision firmware. Finally had it 99% working - just couldn't get recordings to play in the browser but they work in VLC. I was about to be done with it and then had this issue.

I reverted to my working config which is above and this issue persists.

blakeblackshear commented 2 years ago

This is usually because you have an erroneous file in your cache directory. The beta version handles these types exceptions without failing.

mtongnz commented 2 years ago

Ahh.. Went into cache and found that a file had been created as camname_%Y%m%d%H%M%S.mp4

I deleted it and it now seems fine.

Thanks