blakeblackshear / frigate

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

events.py error #936

Closed Sloth-on-meth closed 3 years ago

Sloth-on-meth commented 3 years ago

Describe the bug I get a python error when running frigate.

Version of frigate Output from /api/version 0.8.4-5043040

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

mqtt:
  host: 192.168.178.79
  user: mosquitto
  password: x
#  bounding_box: True
cameras:
  back:
    mqtt:
      bounding_box: True
    ffmpeg:
      input_args:
        - -avoid_negative_ts
        - make_zero
        - -fflags
        - nobuffer
        - -flags
        - low_delay
        - -strict
        - experimental
        - -fflags
        - +genpts+discardcorrupt
        - -use_wallclock_as_timestamps
        - '1'
        - -c:v
        - h264_cuvid
      inputs:
        - path: rtmp://192.168.178.113/bcs/channel0_main.bcs?channel=0&stream=0&user=admin&password=x
          roles:
            #- record
            - detect
            - rtmp
            - clips
    width: 2560
    height: 1440
    fps: 5
    clips:
      enabled: True
    snapshots:
      enabled: True
      timestamp: True
      bounding_box: True
      crop: True

  front:
    ffmpeg:
      input_args:
        - -c:v
        - h264_cuvid
        - -avoid_negative_ts
        - make_zero
        - -fflags
        - nobuffer
        - -flags
        - low_delay
        - -strict
        - experimental
        - -fflags
        - +genpts+discardcorrupt
        - -use_wallclock_as_timestamps
        - '1'

      inputs:
        - path: rtsp://192.168.178.55:8554/unicast
          roles:
            #- record
            - detect
            - rtmp
            - clips
    width: 1280
    height: 720
    fps: 5
    clips:
      enabled: True
    snapshots:
      enabled: True
      timestamp: True
      bounding_box: True
      crop: True

detectors:
  cpu1:
    type: cpu

record:
  enabled: False

ffmpeg:
  input_args:
    - -avoid_negative_ts
    - make_zero
    - -fflags
    - nobuffer
    - -flags
    - low_delay
    - -strict
    - experimental
    - -fflags
    - +genpts+discardcorrupt
    - -use_wallclock_as_timestamps
    - '1'
    - -c:v
    - h264_cuvid

objects:

  track:
    - person
    - bicycle
    - motorcycle
    - bus
    - train
    - bird
    - cat
    - dog
    - backpack
    - umbrella
    - handbag
    - suitcase
    - sports ball
    - skateboard
    - bottle
    - wine glass
    - cup
    - fork
    - knife
    - spoon
    - chair
    - couch
    - bed
    - dining table
    - toilet
    - tv
    - laptop
    - mouse
    - remote
    - keyboard
    - cell phone
    - microwave
    - oven
    - toaster
    - sink
    - refrigerator
    - book
    - clock
    - vase
    - scissors
    - teddy bear
    - hair drier
    - toothbrush  

clips:
  max_seconds: 240
  retain:
    default: 10
    objects:
      person: 15

Frigate container logs

Include relevant log output here

Frigate stats

Output from frigate's /api/stats endpoint

FFprobe from your camera

Run the following command and paste output below

ffprobe <stream_url>

Screenshots

Exception in thread event_processor:
frigate             | Traceback (most recent call last):
frigate             |   File "/opt/frigate/frigate/events.py", line 193, in run
frigate             |     event_type, camera, event_data = self.event_queue.get(timeout=10)
frigate             |   File "/usr/lib/python3.8/multiprocessing/queues.py", line 108, in get
frigate             |     raise Empty
frigate             | _queue.Empty
frigate             | 
frigate             | During handling of the above exception, another exception occurred:
frigate             | 
frigate             | Traceback (most recent call last):
frigate             |   File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
frigate             |     self.run()
frigate             |   File "/opt/frigate/frigate/events.py", line 196, in run
frigate             |     self.refresh_cache()
frigate             |   File "/opt/frigate/frigate/events.py", line 69, in refresh_cache
frigate             |     start_time = datetime.datetime.strptime(f.split('-')[-1].split('.')[0], '%Y%m%d%H%M%S')
frigate             |   File "/usr/lib/python3.8/_strptime.py", line 568, in _strptime_datetime
frigate             |     tt, fraction, gmtoff_fraction = _strptime(data_string, format)
frigate             |   File "/usr/lib/python3.8/_strptime.py", line 349, in _strptime
frigate             |     raise ValueError("time data %r does not match format %r" %
frigate             | ValueError: time data '%Y%m%d%H%M%S' does not match format '%Y%m%d%H%M%S'

Computer Hardware

Camera Info: not sure how applicable, happens with multiple, but alas

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

jamesawebb commented 2 years ago

FWIW I've started seeing this message too. I haven't (yet) worked out what's causing it but will update here if I do - for posterity.

RealKanashii commented 2 years ago

Same here and recording is not working.

RealKanashii commented 2 years ago

I configured recording like german timestamp as I'm from europe but the error still appearing:

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 154, in run
self.move_files()
File "/opt/frigate/frigate/record.py", line 75, 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'
Exception in thread recording_cleanup:
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 328, in run
self.expire_files()
File "/opt/frigate/frigate/record.py", line 298, in expire_files
oldest_timestamp = p.stat().st_mtime - 1
File "/usr/lib/python3.8/pathlib.py", line 1198, in stat
return self._accessor.stat(self)
FileNotFoundError: [Errno 2] No such file or directory: '/media/frigate/recordings/2021-10/25/17/porta/22.00.mp4'

Timestamp config:

timestamp_style:
  # Optional: Position of the timestamp (default: shown below)
  #           "tl" (top left), "tr" (top right), "bl" (bottom left), "br" (bottom right)
  position: "tl"
  # Optional: Format specifier conform to the Python package "datetime" (default: shown below)
  #           Additional Examples:
  #             german: "%d.%m.%Y %H:%M:%S"
  #format: "%m/%d/%Y %H:%M:%S"
  format: "%d/%m/%Y %H:%M:%S"
  # Optional: Color of font
  color:
    # All Required when color is specified (default: shown below)
    red: 255
    green: 255
    blue: 255
  # Optional: Line thickness of font (default: shown below)
  thickness: 2
  # Optional: Effect of lettering (default: shown below)
  #           None (No effect),
  #           "solid" (solid background in inverse color of font)
  #           "shadow" (shadow for font)
  #effect: None

Camera: Reolink E1 Zoom frigate: Frigate (0.9.2-25bb515) S.O: Docker version in Unraid S.O ( linux )