frigate: [Support]: Errors in Log - error: OpenCV(4.5.5) /io/opencv/modules/imgproc/src/resize.cpp:4055

Describe the problem you are having

I am getting a new error that is constantly appearing in the logs. Would like some help to debug the issue.

Version

0.12.0-DA3E197

Frigate config file

mqtt:
  host: 192.168.15.34
  user: '
  password: '

go2rtc:
  streams:
    Social:
      - rtsp://':'@':554/cam/realmonitor?channel=5&subtype=0
    Portao:
      - rtsp://':'@':554/cam/realmonitor?channel=2&subtype=0

cameras:
  Social:
    ffmpeg:
      inputs:
        - path: rtsp://':'@':554/cam/realmonitor?channel=5&subtype=1
          roles:
            - detect
        - path: rtsp://':'@':554/cam/realmonitor?channel=5&subtype=0
          roles:
            - record
    detect:
      width: 704
      height: 480
      fps: 5
      stationary:
        interval: 0
        threshold: 40
    objects:
      track:
        - person
        - bicycle
        - motorcycle
        - car
      filters:
        person:
          threshold: 0.60
        car:
          threshold: 0.60
          min_area: 13000
          max_area: 65000
    motion:
      threshold: 25
      contour_area: 30
      mask:
        - 80,0,704,0,704,190,528,39,523,0,257,0,273,113,346,113,390,177,407,274,163,312
      improve_contrast: false
    zones:
      zone_calcada_social:
        coordinates: 704,423,346,0,248,0,270,139,494,480,704,480
        objects:
          - bicycle
          - motorcycle
      zone_car:
        coordinates: 366,29,254,21,298,186,492,176
        objects:
          - car
      zone_portao_social:
        coordinates: 264,135,362,260,416,480,0,480,0,0,207,0
        objects:
          - person
  Portao:
    ffmpeg:
      hwaccel_args: preset-vaapi
      inputs:
        - path: rtsp://':'@':554/cam/realmonitor?channel=2&subtype=0
          roles:
            - detect
            - record
    detect:
      width: 1280
      height: 720
      fps: 5
      stationary:
        interval: 0
        threshold: 40
    objects:
      track:
        - person
        - bicycle
        - motorcycle
        - car
      filters:
        car:
          threshold: 0.56
          min_area: 130000
        motorcycle:
          threshold: 0.65
        person:
          threshold: 0.68
          min_area: 10000
          min_score: 0.45
    motion:
      threshold: 25
      contour_area: 30
      mask:
        - 783,38,982,540,888,720,1280,720,1280,0,735,0
        - 0,0,682,270,0,196
      improve_contrast: false
    zones:
      zone_calcada:
        coordinates: 0,541,0,720,339,720,356,454,819,433,884,0,286,0
        objects:
          - bicycle
          - motorcycle
          - car
      zone_portao:
        coordinates: 394,720,1051,720,921,138,846,0,743,0,682,270,498,318,444,432
        objects:
          - person

snapshots:
  enabled: True
  bounding_box: True
  required_zones:
    - zone_portao
    - zone_calcada
    - zone_calcada_social
    - zone_portao_social
    - zone_calcada2
  retain:
    default: 3

record:
  enabled: True
  retain:
    days: 0
  events:
    required_zones:
      - zone_portao
      - zone_calcada
      - zone_calcada_social
      - zone_portao_social
      - zone_calcada2
    pre_capture: 5
    post_capture: 5
    retain:
      default: 3

detectors:
  cpu1:
    type: cpu
    num_threads: 4
  cpu2:
    type: cpu
    num_threads: 4

birdseye:
  enabled: False

Relevant log output

2023-04-14 19:07:54.984274743  [2023-04-14 16:07:54] frigate.http                   ERROR   : Exception on /Social/latest.jpg [GET]
2023-04-14 19:07:54.984284170  Traceback (most recent call last):
2023-04-14 19:07:54.984290042    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2528, in wsgi_app
2023-04-14 19:07:54.984295217      response = self.full_dispatch_request()
2023-04-14 19:07:54.984300984    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1825, in full_dispatch_request
2023-04-14 19:07:54.984305618      rv = self.handle_user_exception(e)
2023-04-14 19:07:54.984310957    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1823, in full_dispatch_request
2023-04-14 19:07:54.984315094      rv = self.dispatch_request()
2023-04-14 19:07:54.984320167    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1799, in dispatch_request
2023-04-14 19:07:54.984324922      return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-04-14 19:07:54.984329526    File "/opt/frigate/frigate/http.py", line 896, in latest_frame
2023-04-14 19:07:54.984334383      frame = cv2.resize(frame, dsize=(width, height), interpolation=cv2.INTER_AREA)
2023-04-14 19:07:54.984340177  cv2.error: OpenCV(4.5.5) /io/opencv/modules/imgproc/src/resize.cpp:4055: error: (-215:Assertion failed) inv_scale_x > 0 in function 'resize'
2023-04-14 19:07:54.984344058  
2023-04-14 19:07:54.989848624  [2023-04-14 16:07:54] frigate.http                   ERROR   : Exception on /Portao/latest.jpg [GET]
2023-04-14 19:07:54.989858225  Traceback (most recent call last):
2023-04-14 19:07:54.989864085    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2528, in wsgi_app
2023-04-14 19:07:54.989869079      response = self.full_dispatch_request()
2023-04-14 19:07:54.989874618    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1825, in full_dispatch_request
2023-04-14 19:07:54.989879116      rv = self.handle_user_exception(e)
2023-04-14 19:07:54.989884324    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1823, in full_dispatch_request
2023-04-14 19:07:54.989888608      rv = self.dispatch_request()
2023-04-14 19:07:54.989893731    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1799, in dispatch_request
2023-04-14 19:07:54.989898541      return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-04-14 19:07:54.989903124    File "/opt/frigate/frigate/http.py", line 896, in latest_frame
2023-04-14 19:07:54.989907877      frame = cv2.resize(frame, dsize=(width, height), interpolation=cv2.INTER_AREA)
2023-04-14 19:07:54.989913684  cv2.error: OpenCV(4.5.5) /io/opencv/modules/imgproc/src/resize.cpp:4055: error: (-215:Assertion failed) inv_scale_x > 0 in function 'resize'

FFprobe output from your camera

Social:
[{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"0/0","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","height":0,"width":0}]}},{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"0/0","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","height":0,"width":0}]}}]

Portao:
[{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"0/0","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","height":0,"width":0}]}}]

Frigate stats

No response

Operating system

HassOS

Install method

HassOS Addon

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

Intelbras

Any other information that may be helpful

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 22 (1 by maintainers)

Most upvoted comments

This has been fixed for 0.13

All this error means is that an invalid frame size was requested for the frame. We will catch and handle the error in the next release so there is no error message.

This isn’t known to cause any problems and can be ignored.