blakeblackshear / frigate

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

[Camera Support]: ONVIF throws preset-related exception for Hikvision DS-2CV2Q21FD-IW #8044

Closed tetele closed 1 year ago

tetele commented 1 year ago

Describe the problem you are having

When I try to configure ONVIF for one my Hikvision DS-2CV2Q21FD-IW, I get an exception in the Frigate logs:

2023-10-03 14:46:18.020230711  [2023-10-03 14:46:18] frigate.http                   ERROR   : Exception on /karlas_room/ptz/info [GET]
2023-10-03 14:46:18.020232839  Traceback (most recent call last):
2023-10-03 14:46:18.020234144    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2190, in wsgi_app
2023-10-03 14:46:18.020235320      response = self.full_dispatch_request()
2023-10-03 14:46:18.020236664    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1486, in full_dispatch_request
2023-10-03 14:46:18.020237746      rv = self.handle_user_exception(e)
2023-10-03 14:46:18.020239012    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1484, in full_dispatch_request
2023-10-03 14:46:18.020240773      rv = self.dispatch_request()
2023-10-03 14:46:18.020242014    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1469, in dispatch_request
2023-10-03 14:46:18.020256582      return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-10-03 14:46:18.020257867    File "/opt/frigate/frigate/http.py", line 1155, in camera_ptz_info
2023-10-03 14:46:18.020258986      return jsonify(current_app.onvif.get_camera_info(camera_name))
2023-10-03 14:46:18.020260026    File "/opt/frigate/frigate/ptz/onvif.py", line 339, in get_camera_info
2023-10-03 14:46:18.020267012      self._init_onvif(camera_name)
2023-10-03 14:46:18.020268101    File "/opt/frigate/frigate/ptz/onvif.py", line 138, in _init_onvif
2023-10-03 14:46:18.020269144      self.cams[camera_name]["presets"][preset["Name"].lower()] = preset["token"]
2023-10-03 14:46:18.020270288  AttributeError: 'NoneType' object has no attribute 'lower'

The Control panel loading icon in the camera page keeps spinning

Version

0.13.0-0858859

Frigate config file

mqtt:
  host: homeassistant.home
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: [redacted]
  password: [redacted]

detectors:
  coral:
    type: edgetpu
    device: pci

detect:
  width: 1280
  height: 720
  fps: 5
  enabled: true

database:
  path: /db/frigate.db

model:
  labelmap:
    18: other_animal # horse
    19: other_animal # sheep
    20: other_animal # cow
    21: other_animal # elephant
    22: other_animal # bear
    23: other_animal # zebra
    24: other_animal # giraffe

# objects:
#   filters:
#     person:
#       min_area: 15000
#       max_ratio: 0.85
#       threshold: 0.75

record:
  enabled: true
  retain:
    days: 0
  events:
    # max_seconds: 1800
    pre_capture: 10
    post_capture: 5
    objects:
    - person
    - car
    - bicycle
    - cat
    - dog
    - other_animal
    retain:
      default: 10
      objects:
        person: 30

# Optional: birdseye configuration
# NOTE: Can (enabled, mode) be overridden at the camera level
birdseye:
  # Optional: Enable birdseye view (default: shown below)
  enabled: true
  # Optional: Restream birdseye via RTSP (default: shown below)
  # NOTE: Enabling this will set birdseye to run 24/7 which may increase CPU usage somewhat.
  restream: false
  # Optional: Width of the output resolution (default: shown below)
  width: 1280
  # Optional: Height of the output resolution (default: shown below)
  height: 720
  # Optional: Encoding quality of the mpeg1 feed (default: shown below)
  # 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
  quality: 8
  # Optional: Mode of the view. Available options are: objects, motion, and continuous
  #   objects - cameras are included if they have had a tracked object within the last 30 seconds
  #   motion - cameras are included if motion was detected in the last 30 seconds
  #   continuous - all cameras are included always
  mode: motion

timestamp_style:
  position: tl
  format: '%d.%m.%Y %H:%M:%S'

go2rtc:
  streams:
    parking:
    - rtsp://{FRIGATE_CAMERA_1}/Streaming/Channels/1   # <- stream which supports video & aac audio. This is only supported for rtsp streams, http must use ffmpeg
    parking_sub:
    - rtsp://{FRIGATE_CAMERA_1}/Streaming/Channels/102   # <- stream which supports video & aac audio. This is only supported for rtsp streams, http must use ffmpeg
    entrance:
    - rtsp://{FRIGATE_CAMERA_2}/Streaming/Channels/1   # <- stream which supports video & aac audio. This is only supported for rtsp streams, http must use ffmpeg
    entrance_sub:
    - rtsp://{FRIGATE_CAMERA_2}/Streaming/Channels/102   # <- stream which supports video & aac audio. This is only supported for rtsp streams, http must use ffmpeg
    backyard:
    - rtsp://{FRIGATE_CAMERA_3}/Streaming/Channels/1   # <- stream which supports video & aac audio. This is only supported for rtsp streams, http must use ffmpeg
    backyard_sub:
    - rtsp://{FRIGATE_CAMERA_3}/Streaming/Channels/102   # <- stream which supports video & aac audio. This is only supported for rtsp streams, http must use ffmpeg
    karlas_room:
    - ffmpeg:rtsp://{FRIGATE_CAMERA_5}/Streaming/Channels/1#video=copy#audio=copy#audio=aac   # <- stream which supports video & aac audio. This is only supported for rtsp streams, http must use ffmpeg
    karlas_room_sub:
    - ffmpeg:rtsp://{FRIGATE_CAMERA_5}/Streaming/Channels/102#video=copy#audio=copy#audio=aac   # <- stream which supports video & aac audio. This is only supported for rtsp streams, http must use ffmpeg
    frontyard:
    - rtsp://{FRIGATE_CAMERA_6}/Streaming/Channels/1   # <- stream which supports video & aac audio. This is only supported for rtsp streams, http must use ffmpeg
    frontyard_sub:
    - rtsp://{FRIGATE_CAMERA_6}/Streaming/Channels/102   # <- stream which supports video & aac audio. This is only supported for rtsp streams, http must use ffmpeg
  webrtc:
    candidates:
    - 172.25.0.2:8555
    - 10.16.9.2:8555
    - stun:8555

cameras:
  parking: # <------ Name the camera
    ffmpeg:
      inputs:
      - path: rtsp://127.0.0.1:8554/parking_sub
        input_args: preset-rtsp-restream
        roles:
        - detect
      - path: rtsp://127.0.0.1:8554/parking
        input_args: preset-rtsp-restream
        roles:
        - record
    detect:
      width: 1280
      height: 720
    # motion:
    #   mask:
    #     - 295,578,146,365,172,286,199,135,325,55,420,0,0,0,0,720,418,720
    #     - 1280,0,1280,67,966,0
    record:
      enabled: True
    snapshots:
      enabled: True
    objects:
      track:
      - person
      - car
      - bicycle
    zones:
      gate:
        coordinates: 1048,720,567,720,761,516,1076,674
        objects:
        - person
      katis_parking_spot:
        coordinates: 875,83,1225,170,960,699,501,437
        objects:
        - person
        - car
        - bicycle
      tudors_parking_spot:
        coordinates: 606,44,887,64,423,441,246,295
        objects:
        - person
        - car
        - bicycle

  entrance: # <------ Name the camera
    ffmpeg:
      inputs:
      - path: rtsp://127.0.0.1:8554/entrance_sub
        input_args: preset-rtsp-restream
        roles:
        - detect
      - path: rtsp://127.0.0.1:8554/entrance
        input_args: preset-rtsp-restream
        roles:
        - record
    detect:
      width: 1280
      height: 720
    record:
      enabled: True
    snapshots:
      enabled: True
    objects:
      track:
      - person
      - bicycle
      - cat
      - dog
      - other_animal
    zones:
      front_entrance:
        coordinates: 288,720,719,720,495,521,244,660
        objects:
        - person
        - bicycle
        - cat
        - dog
        - other_animal
      gate:
        coordinates: 198,201,250,267,107,319,85,244
        objects:
        - person
        - bicycle
        - cat
        - dog
        - other_animal
      lawn:
        coordinates: 
          807,102,1280,293,1280,592,1210,551,1128,720,720,720,517,541,200,194,86,240,56,148,245,75,469,21
        objects:
        - person
        - bicycle
        - cat
        - dog
        - other_animal

  backyard: # <------ Name the camera
    ffmpeg:
      inputs:
      - path: rtsp://127.0.0.1:8554/backyard_sub
        input_args: preset-rtsp-restream
        roles:
        - detect
      - path: rtsp://127.0.0.1:8554/backyard
        input_args: preset-rtsp-restream
        roles:
        - record
    detect:
      width: 1280
      height: 720
    record:
      enabled: True
    snapshots:
      enabled: True
    objects:
      track:
      - person
      - cat
      - dog
      - other_animal

  karlas_room: # <------ Name the camera
    ffmpeg:
      inputs:
      - path: rtsp://127.0.0.1:8554/karlas_room_sub
        input_args: preset-rtsp-restream
        roles:
        - audio
        - detect
      - path: rtsp://127.0.0.1:8554/karlas_room
        input_args: preset-rtsp-restream
        roles:
        - record
      output_args:
        record: preset-record-generic-audio-aac
    onvif:
      host: camera-karla.lan
      port: 80
      user: [redacted]
      password: [redacted]
    audio:
      enabled: True
      listen:
        - speech
        - crying
        - yell
        - scream
        - whispering
    detect:
      width: 640
      height: 360
    record:
      enabled: True
    snapshots:
      enabled: True
    objects:
      track:
      - person
      filters:
        person:
          min_area: 4000
          max_ratio: 0.9
          threshold: 0.75
    # motion:
    #   mask:
    #     - 510,589,508,323,545,0,650,0,673,126,856,144,858,520,661,539

  frontyard: # <------ Name the camera
    ffmpeg:
      inputs:
      - path: rtsp://127.0.0.1:8554/frontyard_sub
        input_args: preset-rtsp-restream
        roles:
        - detect
      - path: rtsp://127.0.0.1:8554/frontyard
        input_args: preset-rtsp-restream
        roles:
        - record
    detect:
      width: 1280
      height: 720
    # motion:
    #   threshold: 18
    #   contour_area: 20
    #   frame_height: 70
    #   mask:
    #     - 104,810,116,182,272,165,244,118,452,72,458,0,0,0,0
    record:
      enabled: True
    snapshots:
      enabled: True
    motion:
      mask:
      - 411,0,406,73,230,103,236,151,0,179,0,0
    objects:
      track:
      - person
      - bicycle
      - cat
      - dog
      - other_animal
      filters:
        person:
          min_area: 4000
          max_ratio: 0.9
          threshold: 0.75
    zones:
      gate:
        # coordinates: 355,237,404,263,471,238,418,214
        coordinates: 710,474,806,536,926,477,836,428
        objects:
        - person
        - bicycle
        - cat
        - dog
        - other_animal
      patio:
        # coordinates: 198,112,254,142,149,155,126,123
        coordinates: 396,224,508,284,299,319,252,246
        objects:
        - person
        - cat
        - dog
        - other_animal
      front_entrance:
        # coordinates: 269,182,300,174,249,143,217,148
        coordinates: 538,364,600,348,498,286,434,296
        objects:
        - person
        - bicycle
        - cat
        - dog
        - other_animal
      lawn:
        # coordinates: 114,116,155,160,211,151,394,271,451,245,614,323,596,360,265,360,74,360,51,270,49,127
        coordinates: 
          228,232,308,309,428,297,809,534,902,490,1238,649,1192,720,530,720,148,720,102,540,98,254
        objects:
        - person
        - bicycle
        - cat
        - dog
        - other_animal

Relevant log output

2023-10-03 14:46:18.020230711  [2023-10-03 14:46:18] frigate.http                   ERROR   : Exception on /karlas_room/ptz/info [GET]
2023-10-03 14:46:18.020232839  Traceback (most recent call last):
2023-10-03 14:46:18.020234144    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2190, in wsgi_app
2023-10-03 14:46:18.020235320      response = self.full_dispatch_request()
2023-10-03 14:46:18.020236664    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1486, in full_dispatch_request
2023-10-03 14:46:18.020237746      rv = self.handle_user_exception(e)
2023-10-03 14:46:18.020239012    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1484, in full_dispatch_request
2023-10-03 14:46:18.020240773      rv = self.dispatch_request()
2023-10-03 14:46:18.020242014    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1469, in dispatch_request
2023-10-03 14:46:18.020256582      return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-10-03 14:46:18.020257867    File "/opt/frigate/frigate/http.py", line 1155, in camera_ptz_info
2023-10-03 14:46:18.020258986      return jsonify(current_app.onvif.get_camera_info(camera_name))
2023-10-03 14:46:18.020260026    File "/opt/frigate/frigate/ptz/onvif.py", line 339, in get_camera_info
2023-10-03 14:46:18.020267012      self._init_onvif(camera_name)
2023-10-03 14:46:18.020268101    File "/opt/frigate/frigate/ptz/onvif.py", line 138, in _init_onvif
2023-10-03 14:46:18.020269144      self.cams[camera_name]["presets"][preset["Name"].lower()] = preset["token"]
2023-10-03 14:46:18.020270288  AttributeError: 'NoneType' object has no attribute 'lower'

FFprobe output from your camera

ffprobe version 4.1.11-0+deb10u1 Copyright (c) 2007-2023 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --prefix=/usr --extra-version=0+deb10u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
[rtsp @ 0x55b7b7287100] max delay reached. need to consume packet
[rtsp @ 0x55b7b7287100] RTP: missed 22 packets
[h264 @ 0x55b7b728be00] concealing 1930 DC, 1930 AC, 1930 MV errors in I frame
Input #0, rtsp, from 'rtsp://user:pass@camera-karla.lan:554/Streaming/Channels/1':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1920x1080, 15 fps, 15 tbr, 90k tbn, 30 tbc
    Stream #0:1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s

Frigate stats

{"backyard":{"camera_fps":5.1,"capture_pid":411,"detection_enabled":1,"detection_fps":1.2,"ffmpeg_pid":430,"pid":393,"process_fps":5.1,"skipped_fps":0.0},"cpu_usages":{"1":{"cmdline":"/package/admin/s6/command/s6-svscan -d4 -- /run/service","cpu":"0.0","cpu_average":"0","mem":"0.0"},"15":{"cmdline":"s6-supervise s6-linux-init-shutdownd","cpu":"0.0","cpu_average":"0","mem":"0.0"},"16":{"cmdline":"/package/admin/s6-linux-init/command/s6-linux-init-shutdownd -c /run/s6/basedir -g 3000 -C -B","cpu":"0.0","cpu_average":"0","mem":"0.0"},"24":{"cmdline":"s6-supervise nginx-log","cpu":"0.0","cpu_average":"0","mem":"0.0"},"25":{"cmdline":"s6-supervise go2rtc-healthcheck","cpu":"0.0","cpu_average":"0","mem":"0.0"},"26":{"cmdline":"s6-supervise go2rtc","cpu":"0.0","cpu_average":"0","mem":"0.0"},"27":{"cmdline":"s6-supervise s6rc-oneshot-runner","cpu":"0.0","cpu_average":"0","mem":"0.0"},"28":{"cmdline":"s6-supervise frigate","cpu":"0.0","cpu_average":"0","mem":"0.0"},"29":{"cmdline":"s6-supervise go2rtc-log","cpu":"0.0","cpu_average":"0","mem":"0.0"},"30":{"cmdline":"s6-supervise frigate-log","cpu":"0.0","cpu_average":"0","mem":"0.0"},"31":{"cmdline":"s6-supervise nginx","cpu":"0.0","cpu_average":"0","mem":"0.0"},"32":{"cmdline":"s6-supervise s6rc-fdholder","cpu":"0.0","cpu_average":"0","mem":"0.0"},"41":{"cmdline":"/package/admin/s6-2.11.3.2/command/s6-fdholderd -1 -i data/rules","cpu":"0.0","cpu_average":"0","mem":"0.0"},"42":{"cmdline":"/package/admin/s6/command/s6-ipcserverd -1 -- /package/admin/s6/command/s6-ipcserver-access -v0 -E -l0 -i data/rules -- /package/admin/s6/command/s6-sudod -t 30000 -- /package/admin/s6-rc/command/s6-rc-oneshot-run -l ../.. --","cpu":"0.0","cpu_average":"0","mem":"0.0"},"80":{"cmdline":"s6-log -b -- T 1 n0 s10000000 T /dev/shm/logs/nginx","cpu":"0.0","cpu_average":"0","mem":"0.0"},"81":{"cmdline":"s6-log -b -- T 1 n0 s10000000 T /dev/shm/logs/frigate","cpu":"0.0","cpu_average":"0","mem":"0.0"},"82":{"cmdline":"s6-log -b -- T 1 n0 s10000000 T /dev/shm/logs/go2rtc","cpu":"0.0","cpu_average":"0","mem":"0.0"},"87":{"cmdline":"/usr/local/go2rtc/bin/go2rtc -config=/dev/shm/go2rtc.yaml","cpu":"5.8","cpu_average":"5","mem":"0.2"},"106":{"cmdline":"python3 -u -m frigate","cpu":"1.5","cpu_average":"2","mem":"2.3"},"111":{"cmdline":"bash ./run.user go2rtc-healthcheck","cpu":"0.0","cpu_average":"0","mem":"0.0"},"121":{"cmdline":"nginx: master process nginx","cpu":"0.0","cpu_average":"0","mem":"0.1"},"140":{"cmdline":"nginx: worker process","cpu":"0.0","cpu_average":"0","mem":"0.0"},"141":{"cmdline":"nginx: worker process","cpu":"0.0","cpu_average":"0","mem":"0.0"},"142":{"cmdline":"nginx: worker process","cpu":"0.0","cpu_average":"0","mem":"0.0"},"143":{"cmdline":"nginx: worker process","cpu":"0.0","cpu_average":"0","mem":"0.0"},"144":{"cmdline":"nginx: worker process","cpu":"0.0","cpu_average":"0","mem":"0.0"},"147":{"cmdline":"nginx: worker process","cpu":"0.0","cpu_average":"0","mem":"0.0"},"360":{"cmdline":"frigate.logger       ","cpu":"0.0","cpu_average":"0","mem":"0.5"},"362":{"cmdline":"frigate.recording_manager","cpu":"9.2","cpu_average":"2","mem":"0.8"},"371":{"cmdline":"/usr/bin/python3 -c from multiprocessing.resource_tracker import main;main(51)","cpu":"0.4","cpu_average":"0","mem":"0.1"},"372":{"cmdline":"frigate.detector.coral","cpu":"0.8","cpu_average":"0","mem":"0.7"},"374":{"cmdline":"frigate.output       ","cpu":"0.8","cpu_average":"0","mem":"0.7"},"389":{"cmdline":"ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1280x720 -i pipe: -f mpegts -s 1280x720 -codec:v mpeg1video -q 8 -bf 0 pipe:","cpu":"0.0","cpu_average":"0","mem":"0.1"},"390":{"cmdline":"frigate.process:parking","cpu":"0.4","cpu_average":"0","mem":"0.7"},"391":{"cmdline":"ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1280x720 -i pipe: -f mpegts -s 1280x720 -codec:v mpeg1video -q 8 -bf 0 pipe:","cpu":"0.0","cpu_average":"0","mem":"0.1"},"392":{"cmdline":"frigate.process:entrance","cpu":"0.4","cpu_average":"0","mem":"0.7"},"393":{"cmdline":"frigate.process:backyard","cpu":"0.8","cpu_average":"0","mem":"0.7"},"394":{"cmdline":"ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1280x720 -i pipe: -f mpegts -s 1280x720 -codec:v mpeg1video -q 8 -bf 0 pipe:","cpu":"0.0","cpu_average":"0","mem":"0.1"},"397":{"cmdline":"frigate.process:karlas_room","cpu":"2.7","cpu_average":"1","mem":"0.7"},"398":{"cmdline":"frigate.process:frontyard","cpu":"0.4","cpu_average":"0","mem":"0.7"},"400":{"cmdline":"ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 640x360 -i pipe: -f mpegts -s 1280x720 -codec:v mpeg1video -q 8 -bf 0 pipe:","cpu":"0.0","cpu_average":"0","mem":"0.1"},"401":{"cmdline":"frigate.capture:parking","cpu":"0.8","cpu_average":"0","mem":"0.6"},"406":{"cmdline":"ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1280x720 -i pipe: -f mpegts -s 1280x720 -codec:v mpeg1video -q 8 -bf 0 pipe:","cpu":"0.0","cpu_average":"0","mem":"0.1"},"407":{"cmdline":"frigate.capture:entrance","cpu":"1.2","cpu_average":"0","mem":"0.6"},"410":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-0858859 -rtsp_transport tcp -timeout 5000000 -i rtsp://127.0.0.1:8554/parking_sub -r 5 -vf fps=5,scale=1280:720 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:","cpu":"3.5","cpu_average":"3","mem":"0.2"},"411":{"cmdline":"frigate.capture:backyard","cpu":"0.8","cpu_average":"0","mem":"0.6"},"412":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-0858859 -rtsp_transport tcp -timeout 5000000 -i rtsp://127.0.0.1:8554/entrance_sub -r 5 -vf fps=5,scale=1280:720 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:","cpu":"3.1","cpu_average":"2","mem":"0.2"},"415":{"cmdline":"frigate.capture:karlas_room","cpu":"0.4","cpu_average":"0","mem":"0.6"},"416":{"cmdline":"ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1280x720 -i pipe: -f mpegts -s 1280x720 -codec:v mpeg1video -q 8 -bf 0 pipe:","cpu":"0.0","cpu_average":"0","mem":"0.1"},"417":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-0858859 -rtsp_transport tcp -timeout 5000000 -i rtsp://127.0.0.1:8554/parking -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/parking-%Y%m%d%H%M%S.mp4","cpu":"0.0","cpu_average":"0","mem":"0.1"},"420":{"cmdline":"frigate.capture:frontyard","cpu":"0.8","cpu_average":"0","mem":"0.6"},"423":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-0858859 -rtsp_transport tcp -timeout 5000000 -i rtsp://127.0.0.1:8554/karlas_room_sub -r 5 -vf fps=5,scale=640:360 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:","cpu":"0.8","cpu_average":"0","mem":"0.2"},"428":{"cmdline":"frigate.audio_manager","cpu":"0.0","cpu_average":"0","mem":"0.7"},"430":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-0858859 -rtsp_transport tcp -timeout 5000000 -i rtsp://127.0.0.1:8554/backyard_sub -r 5 -vf fps=5,scale=1280:720 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:","cpu":"3.5","cpu_average":"3","mem":"0.2"},"432":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-0858859 -rtsp_transport tcp -timeout 5000000 -i rtsp://127.0.0.1:8554/frontyard_sub -r 5 -vf fps=5,scale=1280:720 -threads 2 -f rawvideo -pix_fmt yuv420p pipe:","cpu":"1.5","cpu_average":"1","mem":"0.2"},"434":{"cmdline":"ffmpeg -hide_banner -v error -allowed_media_types video+audio -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_flags prefer_tcp -i rtsp://user:pass@camera-karla.lan:554/Streaming/Channels/102 -map 0:v:0? -c:v:0 copy -map 0:a:0? -c:a:0 copy -map 0:a:0? -c:a:1 aac -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://127.0.0.1:8554/b9e901e033edcce54867f68d0217b295","cpu":"1.2","cpu_average":"0","mem":"0.1"},"444":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-0858859 -rtsp_transport tcp -timeout 5000000 -i rtsp://127.0.0.1:8554/entrance -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/entrance-%Y%m%d%H%M%S.mp4","cpu":"0.4","cpu_average":"0","mem":"0.2"},"445":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -rtsp_transport tcp -timeout 5000000 -vn -i rtsp://127.0.0.1:8554/karlas_room_sub -f s16le -ar 16000 -ac 1 -y pipe:","cpu":"0.0","cpu_average":"0","mem":"0.1"},"449":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-0858859 -rtsp_transport tcp -timeout 5000000 -i rtsp://127.0.0.1:8554/karlas_room -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac /tmp/cache/karlas_room-%Y%m%d%H%M%S.mp4","cpu":"0.8","cpu_average":"0","mem":"0.2"},"452":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-0858859 -rtsp_transport tcp -timeout 5000000 -i rtsp://127.0.0.1:8554/frontyard -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/frontyard-%Y%m%d%H%M%S.mp4","cpu":"0.8","cpu_average":"0","mem":"0.1"},"453":{"cmdline":"ffmpeg -hide_banner -v error -allowed_media_types video+audio -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_flags prefer_tcp -i rtsp://user:pass@camera-karla.lan:554/Streaming/Channels/1 -map 0:v:0? -c:v:0 copy -map 0:a:0? -c:a:0 copy -map 0:a:0? -c:a:1 aac -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://127.0.0.1:8554/f0417ba5467004ed0f21486b10eab667","cpu":"1.5","cpu_average":"1","mem":"0.1"},"454":{"cmdline":"ffmpeg -hide_banner -loglevel warning -threads 2 -user_agent FFmpeg Frigate/0.13.0-0858859 -rtsp_transport tcp -timeout 5000000 -i rtsp://127.0.0.1:8554/backyard -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/backyard-%Y%m%d%H%M%S.mp4","cpu":"0.0","cpu_average":"0","mem":"0.1"},"1876":{"cmdline":"sleep 30s","cpu":"0.0","cpu_average":"0","mem":"0.0"}},"detection_fps":3.0,"detectors":{"coral":{"detection_start":0.0,"inference_speed":6.65,"pid":372}},"entrance":{"camera_fps":5.1,"capture_pid":407,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":412,"pid":392,"process_fps":5.1,"skipped_fps":0.0},"frontyard":{"camera_fps":5.1,"capture_pid":420,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":432,"pid":398,"process_fps":5.1,"skipped_fps":0.0},"karlas_room":{"camera_fps":5.0,"capture_pid":415,"detection_enabled":1,"detection_fps":1.7,"ffmpeg_pid":423,"pid":397,"process_fps":5.0,"skipped_fps":0.0},"parking":{"camera_fps":5.1,"capture_pid":401,"detection_enabled":1,"detection_fps":0.1,"ffmpeg_pid":410,"pid":390,"process_fps":5.1,"skipped_fps":0.0},"processes":{"audioDetector":{"pid":428},"go2rtc":{"pid":87},"logger":{"pid":360},"recording":{"pid":362}},"service":{"last_updated":1696334269,"latest_version":"0.12.1","storage":{"/dev/shm":{"free":215.7,"mount_type":"tmpfs","total":224.0,"used":8.3},"/media/frigate/clips":{"free":2348050.0,"mount_type":"cifs","total":2457519.8,"used":109469.8},"/media/frigate/recordings":{"free":2348050.0,"mount_type":"cifs","total":2457519.8,"used":109469.8},"/tmp/cache":{"free":1409.5,"mount_type":"tmpfs","total":1430.5,"used":21.0}},"temperatures":{"apex_0":48.05},"uptime":697,"version":"0.13.0-0858859"}}

Operating system

Debian

Install method

Docker Compose

Coral version

PCIe

Network connection

Wired

Camera make and model

Hikvision DS-2CV2Q21FD-IW

Any other information that may be helpful

Frigate is running as a Docker container inside a Debian guest running on a Proxmox VM.

hawkeye217 commented 1 year ago

Can you add this to your config, restart Frigate, and paste the first part of the log output?

logger:
  logs:
    frigate.ptz.onvif: debug

We've been noticing some others having trouble with ONVIF on Hikvision cameras lately. Can you make sure your camera's firmware is up to date and then try again?

tetele commented 1 year ago

Firmware is at the latest version, V5.5.803 build 210817

Here is the log:

2023-10-03 16:23:08.014968944  [2023-10-03 16:23:08] frigate.ptz.onvif              DEBUG   : Onvif config for karlas_room: {
2023-10-03 16:23:08.014972070      'Spaces': {
2023-10-03 16:23:08.014973292          'AbsolutePanTiltPositionSpace': [
2023-10-03 16:23:08.014974291              {
2023-10-03 16:23:08.014975470                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/DigitalPositionSpace',
2023-10-03 16:23:08.014976405                  'XRange': {
2023-10-03 16:23:08.014985728                      'Min': 0.0,
2023-10-03 16:23:08.014986729                      'Max': 1.0
2023-10-03 16:23:08.014988077                  },
2023-10-03 16:23:08.014988990                  'YRange': {
2023-10-03 16:23:08.014989955                      'Min': 0.0,
2023-10-03 16:23:08.014990908                      'Max': 1.0
2023-10-03 16:23:08.014991793                  }
2023-10-03 16:23:08.014992661              }
2023-10-03 16:23:08.014993517          ],
2023-10-03 16:23:08.015004422          'AbsoluteZoomPositionSpace': [
2023-10-03 16:23:08.015005293              {
2023-10-03 16:23:08.015006423                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/NormalizedDigitalPosition',
2023-10-03 16:23:08.015013482                  'XRange': {
2023-10-03 16:23:08.015014392                      'Min': 1.0,
2023-10-03 16:23:08.015015314                      'Max': inf
2023-10-03 16:23:08.015016227                  }
2023-10-03 16:23:08.015017086              }
2023-10-03 16:23:08.015017938          ],
2023-10-03 16:23:08.015018907          'RelativePanTiltTranslationSpace': [
2023-10-03 16:23:08.015019793              {
2023-10-03 16:23:08.015020866                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/DigitalTranslationSpace',
2023-10-03 16:23:08.015021750                  'XRange': {
2023-10-03 16:23:08.015029465                      'Min': -1.0,
2023-10-03 16:23:08.015030409                      'Max': 1.0
2023-10-03 16:23:08.015031264                  },
2023-10-03 16:23:08.015032165                  'YRange': {
2023-10-03 16:23:08.015033066                      'Min': -1.0,
2023-10-03 16:23:08.015034078                      'Max': 1.0
2023-10-03 16:23:08.015034922                  }
2023-10-03 16:23:08.015035777              }
2023-10-03 16:23:08.015036553          ],
2023-10-03 16:23:08.015037535          'RelativeZoomTranslationSpace': [
2023-10-03 16:23:08.015038348              {
2023-10-03 16:23:08.015047955                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/NormalizedDigital',
2023-10-03 16:23:08.015048834                  'XRange': {
2023-10-03 16:23:08.015049736                      'Min': -inf,
2023-10-03 16:23:08.015050620                      'Max': inf
2023-10-03 16:23:08.015051461                  }
2023-10-03 16:23:08.015052452              }
2023-10-03 16:23:08.015053273          ],
2023-10-03 16:23:08.015054205          'ContinuousPanTiltVelocitySpace': [
2023-10-03 16:23:08.015055052              {
2023-10-03 16:23:08.015056113                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
2023-10-03 16:23:08.015056995                  'XRange': {
2023-10-03 16:23:08.015057927                      'Min': -1.0,
2023-10-03 16:23:08.015058836                      'Max': 1.0
2023-10-03 16:23:08.015059699                  },
2023-10-03 16:23:08.015060559                  'YRange': {
2023-10-03 16:23:08.015061426                      'Min': -1.0,
2023-10-03 16:23:08.015062286                      'Max': 1.0
2023-10-03 16:23:08.015063099                  }
2023-10-03 16:23:08.015073663              },
2023-10-03 16:23:08.015074519              {
2023-10-03 16:23:08.015075600                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocitySpaceFOV',
2023-10-03 16:23:08.015076482                  'XRange': {
2023-10-03 16:23:08.015077354                      'Min': -7.0,
2023-10-03 16:23:08.015078240                      'Max': 7.0
2023-10-03 16:23:08.015079101                  },
2023-10-03 16:23:08.015079940                  'YRange': {
2023-10-03 16:23:08.015090764                      'Min': -7.0,
2023-10-03 16:23:08.015091674                      'Max': 7.0
2023-10-03 16:23:08.015092501                  }
2023-10-03 16:23:08.015093356              }
2023-10-03 16:23:08.015094165          ],
2023-10-03 16:23:08.015095048          'ContinuousZoomVelocitySpace': [
2023-10-03 16:23:08.015095869              {
2023-10-03 16:23:08.015096961                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
2023-10-03 16:23:08.015097835                  'XRange': {
2023-10-03 16:23:08.015098800                      'Min': -1.0,
2023-10-03 16:23:08.015099734                      'Max': 1.0
2023-10-03 16:23:08.015100539                  }
2023-10-03 16:23:08.015101359              },
2023-10-03 16:23:08.015102181              {
2023-10-03 16:23:08.015103307                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocitySpaceMillimeter',
2023-10-03 16:23:08.015104164                  'XRange': {
2023-10-03 16:23:08.015105049                      'Min': -7.0,
2023-10-03 16:23:08.015105912                      'Max': 7.0
2023-10-03 16:23:08.015106716                  }
2023-10-03 16:23:08.015119004              }
2023-10-03 16:23:08.015119817          ],
2023-10-03 16:23:08.015120666          'PanTiltSpeedSpace': [],
2023-10-03 16:23:08.015121549          'ZoomSpeedSpace': [],
2023-10-03 16:23:08.015122413          'Extension': None,
2023-10-03 16:23:08.015123243          '_attr_1': None
2023-10-03 16:23:08.015124066      },
2023-10-03 16:23:08.015124965      'PTZTimeout': {
2023-10-03 16:23:08.015125849          'Min': datetime.timedelta(seconds=1),
2023-10-03 16:23:08.015126775          'Max': datetime.timedelta(seconds=600)
2023-10-03 16:23:08.015127589      },
2023-10-03 16:23:08.015128469      '_value_1': None,
2023-10-03 16:23:08.015129331      'PTControlDirection': None,
2023-10-03 16:23:08.015130324      'Extension': None,
2023-10-03 16:23:08.015131166      '_attr_1': None
2023-10-03 16:23:08.015131976  }
2023-10-03 16:23:08.075638802  [2023-10-03 16:23:08] frigate.http                   ERROR   : Exception on /karlas_room/ptz/info [GET]
2023-10-03 16:23:08.075640993  Traceback (most recent call last):
2023-10-03 16:23:08.075642287    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2190, in wsgi_app
2023-10-03 16:23:08.075643487      response = self.full_dispatch_request()
2023-10-03 16:23:08.075644799    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1486, in full_dispatch_request
2023-10-03 16:23:08.075645901      rv = self.handle_user_exception(e)
2023-10-03 16:23:08.075647162    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1484, in full_dispatch_request
2023-10-03 16:23:08.075648175      rv = self.dispatch_request()
2023-10-03 16:23:08.075649364    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1469, in dispatch_request
2023-10-03 16:23:08.075650422      return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-10-03 16:23:08.075651480    File "/opt/frigate/frigate/http.py", line 1155, in camera_ptz_info
2023-10-03 16:23:08.075652548      return jsonify(current_app.onvif.get_camera_info(camera_name))
2023-10-03 16:23:08.075653585    File "/opt/frigate/frigate/ptz/onvif.py", line 339, in get_camera_info
2023-10-03 16:23:08.075654543      self._init_onvif(camera_name)
2023-10-03 16:23:08.075655604    File "/opt/frigate/frigate/ptz/onvif.py", line 138, in _init_onvif
2023-10-03 16:23:08.075656667      self.cams[camera_name]["presets"][preset["Name"].lower()] = preset["token"]
2023-10-03 16:23:08.075657733  AttributeError: 'NoneType' object has no attribute 'lower'
tetele commented 1 year ago

I've just updated to 0.13.0-FACD557, which should have the fix included. Is this the same issue @hawkeye217 ?

2023-10-20 16:27:44.989283143  [2023-10-20 16:27:44] frigate.ptz.onvif              DEBUG   : Onvif config for karlas_room: {
2023-10-20 16:27:44.989286249      'Spaces': {
2023-10-20 16:27:44.989287495          'AbsolutePanTiltPositionSpace': [
2023-10-20 16:27:44.989288547              {
2023-10-20 16:27:44.989289784                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/DigitalPositionSpace',
2023-10-20 16:27:44.989290813                  'XRange': {
2023-10-20 16:27:44.989291800                      'Min': 0.0,
2023-10-20 16:27:44.989292778                      'Max': 1.0
2023-10-20 16:27:44.989293670                  },
2023-10-20 16:27:44.989296608                  'YRange': {
2023-10-20 16:27:44.989297545                      'Min': 0.0,
2023-10-20 16:27:44.989298904                      'Max': 1.0
2023-10-20 16:27:44.989299839                  }
2023-10-20 16:27:44.989300950              }
2023-10-20 16:27:44.989301907          ],
2023-10-20 16:27:44.989302870          'AbsoluteZoomPositionSpace': [
2023-10-20 16:27:44.989319582              {
2023-10-20 16:27:44.989320939                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/NormalizedDigitalPosition',
2023-10-20 16:27:44.989328185                  'XRange': {
2023-10-20 16:27:44.989329263                      'Min': 1.0,
2023-10-20 16:27:44.989330219                      'Max': inf
2023-10-20 16:27:44.989331233                  }
2023-10-20 16:27:44.989332143              }
2023-10-20 16:27:44.989333041          ],
2023-10-20 16:27:44.989334059          'RelativePanTiltTranslationSpace': [
2023-10-20 16:27:44.989335028              {
2023-10-20 16:27:44.989336158                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/DigitalTranslationSpace',
2023-10-20 16:27:44.989337114                  'XRange': {
2023-10-20 16:27:44.989345000                      'Min': -1.0,
2023-10-20 16:27:44.989346055                      'Max': 1.0
2023-10-20 16:27:44.989346930                  },
2023-10-20 16:27:44.989347879                  'YRange': {
2023-10-20 16:27:44.989348865                      'Min': -1.0,
2023-10-20 16:27:44.989349915                      'Max': 1.0
2023-10-20 16:27:44.989350811                  }
2023-10-20 16:27:44.989351719              }
2023-10-20 16:27:44.989352551          ],
2023-10-20 16:27:44.989353567          'RelativeZoomTranslationSpace': [
2023-10-20 16:27:44.989354435              {
2023-10-20 16:27:44.989364157                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/NormalizedDigital',
2023-10-20 16:27:44.989365204                  'XRange': {
2023-10-20 16:27:44.989366144                      'Min': -inf,
2023-10-20 16:27:44.989367077                      'Max': inf
2023-10-20 16:27:44.989367958                  }
2023-10-20 16:27:44.989368963              }
2023-10-20 16:27:44.989369845          ],
2023-10-20 16:27:44.989370801          'ContinuousPanTiltVelocitySpace': [
2023-10-20 16:27:44.989371697              {
2023-10-20 16:27:44.989372807                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
2023-10-20 16:27:44.989373723                  'XRange': {
2023-10-20 16:27:44.989374700                      'Min': -1.0,
2023-10-20 16:27:44.989375638                      'Max': 1.0
2023-10-20 16:27:44.989376555                  },
2023-10-20 16:27:44.989377477                  'YRange': {
2023-10-20 16:27:44.989378404                      'Min': -1.0,
2023-10-20 16:27:44.989379337                      'Max': 1.0
2023-10-20 16:27:44.989380217                  }
2023-10-20 16:27:44.989393904              },
2023-10-20 16:27:44.989394908              {
2023-10-20 16:27:44.989396082                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocitySpaceFOV',
2023-10-20 16:27:44.989397019                  'XRange': {
2023-10-20 16:27:44.989397954                      'Min': -7.0,
2023-10-20 16:27:44.989398902                      'Max': 7.0
2023-10-20 16:27:44.989399819                  },
2023-10-20 16:27:44.989400736                  'YRange': {
2023-10-20 16:27:44.989412244                      'Min': -7.0,
2023-10-20 16:27:44.989413311                      'Max': 7.0
2023-10-20 16:27:44.989414196                  }
2023-10-20 16:27:44.989415087              }
2023-10-20 16:27:44.989415953          ],
2023-10-20 16:27:44.989416885          'ContinuousZoomVelocitySpace': [
2023-10-20 16:27:44.989417762              {
2023-10-20 16:27:44.989418916                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
2023-10-20 16:27:44.989419823                  'XRange': {
2023-10-20 16:27:44.989420886                      'Min': -1.0,
2023-10-20 16:27:44.989421852                      'Max': 1.0
2023-10-20 16:27:44.989422726                  }
2023-10-20 16:27:44.989423604              },
2023-10-20 16:27:44.989424474              {
2023-10-20 16:27:44.989425621                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocitySpaceMillimeter',
2023-10-20 16:27:44.989426549                  'XRange': {
2023-10-20 16:27:44.989427490                      'Min': -7.0,
2023-10-20 16:27:44.989428416                      'Max': 7.0
2023-10-20 16:27:44.989429282                  }
2023-10-20 16:27:44.989441952              }
2023-10-20 16:27:44.989442919          ],
2023-10-20 16:27:44.989443857          'PanTiltSpeedSpace': [],
2023-10-20 16:27:44.989444802          'ZoomSpeedSpace': [],
2023-10-20 16:27:44.989445728          'Extension': None,
2023-10-20 16:27:44.989446648          '_attr_1': None
2023-10-20 16:27:44.989447521      },
2023-10-20 16:27:44.989448455      'PTZTimeout': {
2023-10-20 16:27:44.989449398          'Min': datetime.timedelta(seconds=1),
2023-10-20 16:27:44.989450381          'Max': datetime.timedelta(seconds=600)
2023-10-20 16:27:44.989451254      },
2023-10-20 16:27:44.989452177      '_value_1': None,
2023-10-20 16:27:44.989453099      'PTControlDirection': None,
2023-10-20 16:27:44.989454130      'Extension': None,
2023-10-20 16:27:44.989455049      '_attr_1': None
2023-10-20 16:27:44.989455935  }
2023-10-20 16:27:45.034352408  [2023-10-20 16:27:45] frigate.ptz.onvif              DEBUG   : Onvif status config for karlas_room: {
2023-10-20 16:27:45.034355448      'Position': None,
2023-10-20 16:27:45.034356648      'MoveStatus': None,
2023-10-20 16:27:45.034357743      'Error': 'NO error',
2023-10-20 16:27:45.034359071      'UtcTime': datetime.datetime(2023, 10, 20, 13, 27, 44, tzinfo=<isodate.tzinfo.Utc object at 0x7fbe2f807b80>),
2023-10-20 16:27:45.034360104      '_value_1': None,
2023-10-20 16:27:45.034361124      '_attr_1': None
2023-10-20 16:27:45.034362083  }
2023-10-20 16:27:45.075154435  [2023-10-20 16:27:45] frigate.http                   ERROR   : Exception on /karlas_room/ptz/info [GET]
2023-10-20 16:27:45.075156851  Traceback (most recent call last):
2023-10-20 16:27:45.075158186    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2190, in wsgi_app
2023-10-20 16:27:45.075159310      response = self.full_dispatch_request()
2023-10-20 16:27:45.075160609    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1486, in full_dispatch_request
2023-10-20 16:27:45.075161760      rv = self.handle_user_exception(e)
2023-10-20 16:27:45.075163024    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1484, in full_dispatch_request
2023-10-20 16:27:45.075164061      rv = self.dispatch_request()
2023-10-20 16:27:45.075165306    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1469, in dispatch_request
2023-10-20 16:27:45.075166477      return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-10-20 16:27:45.075167613    File "/opt/frigate/frigate/http.py", line 1274, in camera_ptz_info
2023-10-20 16:27:45.075168707      return jsonify(current_app.onvif.get_camera_info(camera_name))
2023-10-20 16:27:45.075169830    File "/opt/frigate/frigate/ptz/onvif.py", line 456, in get_camera_info
2023-10-20 16:27:45.075170858      self._init_onvif(camera_name)
2023-10-20 16:27:45.075171967    File "/opt/frigate/frigate/ptz/onvif.py", line 179, in _init_onvif
2023-10-20 16:27:45.075173018      getattr(preset, "Name", f"preset {preset['token']}").lower()
2023-10-20 16:27:45.075174110  AttributeError: 'NoneType' object has no attribute 'lower'
NickM-27 commented 1 year ago

looks like there may be a bug with the logic of returning a default then, this can probably be fixed with

(getattr(preset, "Name") or f"preset {preset['token']}").lower()
hawkeye217 commented 1 year ago

Corrected in https://github.com/blakeblackshear/frigate/pull/8245