Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Support]: unable to add the ffmpeg hardware acceleration for my Raspberry Pi4 #2030

Closed
neildotwilliams opened this issue Oct 16, 2021 · 262 comments

Comments

@neildotwilliams
Copy link

Describe the problem you are having

I hope I'm not missing something obvious, I have been looking at this for a while before reaching out ;-)

I seem unable to add the ffmpeg hardware acceleration for my Raspberry Pi4 using the following lines:
ffmpeg:
hwaccel_args:
- -c:v
- h264_v4l2m2m

I have tried to add globally and under a specific single camera. All I get is a pure green image. Without adding these lines everything works great, although obviously the CPU usage is quite hit.

In these logs describing the issue, I have only added the acceleration for the camera Living_Room_Low

I have modified the /boot/config.txt file to 512 - gpu_mem=512
Confirmed this by going to the homeassistant container console:
bash-5.1# /opt/vc/bin/vcgencmd get_mem gpu
gpu=512M

Version

DEBUG 0.9.1-800F33E

Frigate config file

mqtt:
  host: 192.168.0.130
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: <USERNAME>
  password: <PASSWORD>
  stats_interval: 60

detectors:
  coral:
    type: edgetpu
    device: usb

detect:
  width: 640
  height: 360
  fps: 5
  enabled: True
  max_disappeared: 25

record:
  enabled: True
  retain_days: 0
  events:
    retain:
      default: 10

snapshots:
  enabled: true
  timestamp: false
  bounding_box: true
  retain:
    default: 10

# Optional: birdseye configuration
birdseye:
  # Optional: Enable birdseye view (default: shown below)
  enabled: True
  # 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: 31
  # 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: objects

cameras:
## Living Room Low Camera
  Living_Room_Low:
    ffmpeg:
      hwaccel_args:
        - -c:v
        - h264_v4l2m2m
      inputs:
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.206:554/av_stream/ch1
          roles:
            - detect
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.206:554/av_stream/ch0
          roles:
            - record
    objects:
      track:
        - person
        - dog
      filters:
        person:
          threshold: 0.75
          min_score: 0.70
        dog:
          threshold: 0.75
          min_score: 0.70
    motion:
      mask:
        - 0,75,209,61,209,0,0,0
        - 380,74,482,74,487,24,382,21
## Living Room High Camera
  Living_Room_High:
    ffmpeg:
      inputs:
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.205:554/av_stream/ch1
          roles:
            - detect
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.205:554/av_stream/ch0
          roles:
            - record
    objects:
      track:
        - person
        - dog
      filters:
        person:
          threshold: 0.75
          min_score: 0.70
        dog:
          threshold: 0.75
          min_score: 0.70
    motion:
      mask:
        - 0,18,155,18,155,0,0,0
  ## Patio camera
  Patio:
    ffmpeg:
      inputs:
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.203:554/av_stream/ch1
          roles:
            - detect
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.203:554/av_stream/ch0
          roles:
            - record
    objects:
      track:
        - person
        - dog
      filters:
        person:
          threshold: 0.75
          min_score: 0.70
        dog:
          threshold: 0.75
          min_score: 0.70
    motion:
      mask:
        - 0,108,640,108,640,0,0,0
  ## Kitchen Camera
  Kitchen:
    ffmpeg:
      inputs:
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.204:554/av_stream/ch1
          roles:
            - detect
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.204:554/av_stream/ch0
          roles:
            - record
    objects:
      track:
        - person
        - dog
      filters:
        person:
          threshold: 0.75
          min_score: 0.70
        dog:
          threshold: 0.65
          min_score: 0.60
    motion:
      mask:
        - 0,18,155,18,155,0,0,0
    zones:
      Cam_Zone_Back_Door:
        coordinates: 365,243,452,257,471,165,388,154
  ## Bedroom Camera
  Bedroom:
    ffmpeg:
      inputs:
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.207:554/av_stream/ch1
          roles:
            - detect
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.207:554/av_stream/ch0
          roles:
            - record
    objects:
      track:
        - person
        - dog
      filters:
        person:
          threshold: 0.75
          min_score: 0.70
        dog:
          threshold: 0.75
          min_score: 0.70
    motion:
      mask:
        - 0,18,155,18,155,0,0,0

Relevant log output

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2021-10-16 16:28:01] frigate.app                    INFO    : Starting Frigate (0.9.1-800f33e)
[2021-10-16 16:28:01] frigate.app                    INFO    : Creating directory: /tmp/cache
[2021-10-16 16:28:01] frigate.app                    WARNING : Camera Living_Room_Low has rtmp enabled, but rtmp is not assigned to an input.
[2021-10-16 16:28:01] frigate.app                    WARNING : Camera Living_Room_High has rtmp enabled, but rtmp is not assigned to an input.
[2021-10-16 16:28:01] frigate.app                    WARNING : Camera Patio has rtmp enabled, but rtmp is not assigned to an input.
[2021-10-16 16:28:01] frigate.app                    WARNING : Camera Kitchen has rtmp enabled, but rtmp is not assigned to an input.
[2021-10-16 16:28:01] frigate.app                    WARNING : Camera Bedroom has rtmp enabled, but rtmp is not assigned to an input.
Starting migrations
[2021-10-16 16:28:01] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2021-10-16 16:28:01] peewee_migrate                 INFO    : There is nothing to migrate
[2021-10-16 16:28:01] frigate.mqtt                   INFO    : MQTT connected
[2021-10-16 16:28:01] frigate.app                    INFO    : Output process started: 219
[2021-10-16 16:28:01] detector.coral                 INFO    : Starting detection process: 217
[2021-10-16 16:28:01] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2021-10-16 16:28:01] frigate.app                    INFO    : Camera processor started for Living_Room_Low: 221
[2021-10-16 16:28:01] ws4py                          INFO    : Using epoll
[2021-10-16 16:28:02] frigate.app                    INFO    : Camera processor started for Living_Room_High: 226
[2021-10-16 16:28:02] frigate.app                    INFO    : Camera processor started for Patio: 230
[2021-10-16 16:28:02] frigate.app                    INFO    : Camera processor started for Kitchen: 234
[2021-10-16 16:28:02] frigate.app                    INFO    : Camera processor started for Bedroom: 235
[2021-10-16 16:28:02] frigate.app                    INFO    : Capture process started for Living_Room_Low: 236
[2021-10-16 16:28:02] frigate.app                    INFO    : Capture process started for Living_Room_High: 238
[2021-10-16 16:28:02] frigate.app                    INFO    : Capture process started for Patio: 241
[2021-10-16 16:28:02] frigate.app                    INFO    : Capture process started for Kitchen: 244
[2021-10-16 16:28:02] frigate.app                    INFO    : Capture process started for Bedroom: 250
[2021-10-16 16:28:02] ws4py                          INFO    : Using epoll
[2021-10-16 16:28:05] frigate.edgetpu                INFO    : TPU found
[2021-10-16 16:28:22] watchdog.Living_Room_Low       INFO    : No frames received from Living_Room_Low in 20 seconds. Exiting ffmpeg...
[2021-10-16 16:28:22] watchdog.Living_Room_Low       INFO    : Waiting for ffmpeg to exit gracefully...
[2021-10-16 16:28:52] watchdog.Living_Room_Low       INFO    : FFmpeg didnt exit. Force killing...
[2021-10-16 16:28:52] frigate.video                  INFO    : Living_Room_Low: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-16 16:28:52] frigate.video                  INFO    : Living_Room_Low: ffmpeg process is not running. exiting capture thread...
[2021-10-16 16:29:02] watchdog.Living_Room_Low       ERROR   : FFMPEG process crashed unexpectedly for Living_Room_Low.
[2021-10-16 16:29:02] watchdog.Living_Room_Low       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-16 16:29:02] watchdog.Living_Room_Low       ERROR   : You may have invalid args defined for this camera.
[2021-10-16 16:29:02] ffmpeg.Living_Room_Low.detect  ERROR   : Guessed Channel Layout for Input Stream #0.1 : mono
[2021-10-16 16:29:22] watchdog.Living_Room_Low       INFO    : No frames received from Living_Room_Low in 20 seconds. Exiting ffmpeg...
[2021-10-16 16:29:22] watchdog.Living_Room_Low       INFO    : Waiting for ffmpeg to exit gracefully...
[2021-10-16 16:29:52] watchdog.Living_Room_Low       INFO    : FFmpeg didnt exit. Force killing...
[2021-10-16 16:29:52] frigate.video                  INFO    : Living_Room_Low: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-16 16:29:52] frigate.video                  INFO    : Living_Room_Low: ffmpeg process is not running. exiting capture thread...
[2021-10-16 16:30:02] watchdog.Living_Room_Low       ERROR   : FFMPEG process crashed unexpectedly for Living_Room_Low.
[2021-10-16 16:30:02] watchdog.Living_Room_Low       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-16 16:30:02] watchdog.Living_Room_Low       ERROR   : You may have invalid args defined for this camera.
[2021-10-16 16:30:02] ffmpeg.Living_Room_Low.detect  ERROR   : Guessed Channel Layout for Input Stream #0.1 : mono
[2021-10-16 16:30:22] watchdog.Living_Room_Low       INFO    : No frames received from Living_Room_Low in 20 seconds. Exiting ffmpeg...
[2021-10-16 16:30:22] watchdog.Living_Room_Low       INFO    : Waiting for ffmpeg to exit gracefully...
[2021-10-16 16:30:52] watchdog.Living_Room_Low       INFO    : FFmpeg didnt exit. Force killing...
[2021-10-16 16:30:52] frigate.video                  INFO    : Living_Room_Low: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-16 16:30:52] frigate.video                  INFO    : Living_Room_Low: ffmpeg process is not running. exiting capture thread...
[2021-10-16 16:31:02] watchdog.Living_Room_Low       ERROR   : FFMPEG process crashed unexpectedly for Living_Room_Low.
[2021-10-16 16:31:02] watchdog.Living_Room_Low       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-16 16:31:02] watchdog.Living_Room_Low       ERROR   : You may have invalid args defined for this camera.
[2021-10-16 16:31:02] ffmpeg.Living_Room_Low.detect  ERROR   : Guessed Channel Layout for Input Stream #0.1 : mono
[2021-10-16 16:31:22] watchdog.Living_Room_Low       INFO    : No frames received from Living_Room_Low in 20 seconds. Exiting ffmpeg...
[2021-10-16 16:31:22] watchdog.Living_Room_Low       INFO    : Waiting for ffmpeg to exit gracefully...
[2021-10-16 16:31:52] watchdog.Living_Room_Low       INFO    : FFmpeg didnt exit. Force killing...
[2021-10-16 16:31:52] frigate.video                  INFO    : Living_Room_Low: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-16 16:31:52] frigate.video                  INFO    : Living_Room_Low: ffmpeg sent a broken frame. read of closed file
[2021-10-16 16:31:52] frigate.video                  INFO    : Living_Room_Low: ffmpeg sent a broken frame. read of closed file
[2021-10-16 16:31:52] frigate.video                  INFO    : Living_Room_Low: ffmpeg process is not running. exiting capture thread...
[2021-10-16 16:32:02] watchdog.Living_Room_Low       ERROR   : FFMPEG process crashed unexpectedly for Living_Room_Low.
[2021-10-16 16:32:02] watchdog.Living_Room_Low       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-16 16:32:02] watchdog.Living_Room_Low       ERROR   : You may have invalid args defined for this camera.
[2021-10-16 16:32:02] ffmpeg.Living_Room_Low.detect  ERROR   : Guessed Channel Layout for Input Stream #0.1 : mono
[2021-10-16 16:32:23] watchdog.Living_Room_Low       INFO    : No frames received from Living_Room_Low in 20 seconds. Exiting ffmpeg...
[2021-10-16 16:32:23] watchdog.Living_Room_Low       INFO    : Waiting for ffmpeg to exit gracefully...

FFprobe output from your camera

root@ccab4aaf-frigate:/opt/frigate# ffprobe rtsp://<USERNAME>:<PASSWORD>@192.168.0.206:554/av_stream/ch1
ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-rkmpp --enable-libdrm --enable-v4l2_m2m --enable-neon --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, rtsp, from 'rtsp://<USERNAME>:<PASSWORD>@192.168.0.206:554/av_stream/ch1':
  Metadata:
    title           : DYrtpsion
  Duration: N/A, start: 0.356000, bitrate: N/A
    Stream #0:0: Video: h264, yuv420p(progressive), 640x360, 10 fps, 10 tbr, 90k tbn, 20 tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s


root@ccab4aaf-frigate:/opt/frigate# ffprobe rtsp://<USERNAME>:<PASSWORD>@192.168.0.206:554/av_stream/ch0
ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-rkmpp --enable-libdrm --enable-v4l2_m2m --enable-neon --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, rtsp, from 'rtsp://<USERNAME>:<PASSWORD>@192.168.0.206:554/av_stream/ch0':
  Metadata:
    title           : DYrtpsion
  Duration: N/A, start: 1.453000, bitrate: N/A
    Stream #0:0: Video: h264, yuv420p(progressive), 1920x1080, 10 fps, 10 tbr, 90k tbn, 20 tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s

Frigate stats

{"Bedroom":{"camera_fps":5.1,"capture_pid":250,"detection_fps":2.4,"pid":235,"process_fps":4.5,"skipped_fps":0.0},"Kitchen":{"camera_fps":4.33,"capture_pid":244,"detection_fps":0.0,"pid":234,"process_fps":2.5,"skipped_fps":0.0},"Living_Room_High":{"camera_fps":5.1,"capture_pid":238,"detection_fps":7.8,"pid":226,"process_fps":3.6,"skipped_fps":0.0},"Living_Room_Low":{"camera_fps":0.0,"capture_pid":236,"detection_fps":0.0,"pid":221,"process_fps":0.0,"skipped_fps":0.0},"Patio":{"camera_fps":5.0,"capture_pid":241,"detection_fps":6.3,"pid":230,"process_fps":5.0,"skipped_fps":0.0},"detection_fps":16.5,"detectors":{"coral":{"detection_start":1634398738.87413,"inference_speed":49.29,"pid":217}},"service":{"storage":{"/dev/shm":{"free":1757.4,"mount_type":"tmpfs","total":1760.4,"used":3.0},"/media/frigate/clips":{"free":187931.6,"mount_type":"ext4","total":235535.3,"used":38003.3},"/media/frigate/recordings":{"free":187931.6,"mount_type":"ext4","total":235535.3,"used":38003.3},"/tmp/cache":{"free":1759.0,"mount_type":"tmpfs","total":1760.4,"used":1.4}},"uptime":656,"version":"0.9.1-800f33e"}}

Operating system

HassOS

Install method

HassOS Addon

Coral version

USB

Network connection

Wired

Camera make and model

Sonoff WiFi IP Camera 1080P

Any other information that may be helpful

No response

@blakeblackshear
Copy link
Owner

Have you tried disabling protection mode on the addon?

@neildotwilliams
Copy link
Author

Hi. Thanks for the lightening response, and the fantastic add on of course! Yes I have disabled the protection.

@blakeblackshear
Copy link
Owner

Try changing the log level for the one camera where you have hwaccel:

mqtt:
  host: 192.168.0.130
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: <USERNAME>
  password: <PASSWORD>
  stats_interval: 60

detectors:
  coral:
    type: edgetpu
    device: usb

detect:
  width: 640
  height: 360
  fps: 5
  enabled: True
  max_disappeared: 25

record:
  enabled: True
  retain_days: 0
  events:
    retain:
      default: 10

snapshots:
  enabled: true
  timestamp: false
  bounding_box: true
  retain:
    default: 10

# Optional: birdseye configuration
birdseye:
  # Optional: Enable birdseye view (default: shown below)
  enabled: True
  # 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: 31
  # 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: objects

cameras:
## Living Room Low Camera
  Living_Room_Low:
    ffmpeg:
      global_args: -hide_banner -loglevel info
      hwaccel_args:
        - -c:v
        - h264_v4l2m2m
      inputs:
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.206:554/av_stream/ch1
          roles:
            - detect
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.206:554/av_stream/ch0
          roles:
            - record
    objects:
      track:
        - person
        - dog
      filters:
        person:
          threshold: 0.75
          min_score: 0.70
        dog:
          threshold: 0.75
          min_score: 0.70
    motion:
      mask:
        - 0,75,209,61,209,0,0,0
        - 380,74,482,74,487,24,382,21
## Living Room High Camera
  Living_Room_High:
    ffmpeg:
      inputs:
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.205:554/av_stream/ch1
          roles:
            - detect
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.205:554/av_stream/ch0
          roles:
            - record
    objects:
      track:
        - person
        - dog
      filters:
        person:
          threshold: 0.75
          min_score: 0.70
        dog:
          threshold: 0.75
          min_score: 0.70
    motion:
      mask:
        - 0,18,155,18,155,0,0,0
  ## Patio camera
  Patio:
    ffmpeg:
      inputs:
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.203:554/av_stream/ch1
          roles:
            - detect
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.203:554/av_stream/ch0
          roles:
            - record
    objects:
      track:
        - person
        - dog
      filters:
        person:
          threshold: 0.75
          min_score: 0.70
        dog:
          threshold: 0.75
          min_score: 0.70
    motion:
      mask:
        - 0,108,640,108,640,0,0,0
  ## Kitchen Camera
  Kitchen:
    ffmpeg:
      inputs:
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.204:554/av_stream/ch1
          roles:
            - detect
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.204:554/av_stream/ch0
          roles:
            - record
    objects:
      track:
        - person
        - dog
      filters:
        person:
          threshold: 0.75
          min_score: 0.70
        dog:
          threshold: 0.65
          min_score: 0.60
    motion:
      mask:
        - 0,18,155,18,155,0,0,0
    zones:
      Cam_Zone_Back_Door:
        coordinates: 365,243,452,257,471,165,388,154
  ## Bedroom Camera
  Bedroom:
    ffmpeg:
      inputs:
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.207:554/av_stream/ch1
          roles:
            - detect
        - path: rtsp://rtsp:<PASSWORD>@192.168.0.207:554/av_stream/ch0
          roles:
            - record
    objects:
      track:
        - person
        - dog
      filters:
        person:
          threshold: 0.75
          min_score: 0.70
        dog:
          threshold: 0.75
          min_score: 0.70
    motion:
      mask:
        - 0,18,155,18,155,0,0,0

@neildotwilliams
Copy link
Author

I noticed that viewing the single camera 'live' shows a white page, debug shows the green square and the fps number changes.

I've added log level info, here's what I get:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2021-10-16 17:19:16] frigate.app INFO : Starting Frigate (0.9.1-800f33e)
[2021-10-16 17:19:16] frigate.app INFO : Creating directory: /tmp/cache
[2021-10-16 17:19:16] frigate.app WARNING : Camera Living_Room_Low has rtmp enabled, but rtmp is not assigned to an input.
[2021-10-16 17:19:16] frigate.app WARNING : Camera Living_Room_High has rtmp enabled, but rtmp is not assigned to an input.
[2021-10-16 17:19:16] frigate.app WARNING : Camera Patio has rtmp enabled, but rtmp is not assigned to an input.
[2021-10-16 17:19:16] frigate.app WARNING : Camera Kitchen has rtmp enabled, but rtmp is not assigned to an input.
[2021-10-16 17:19:16] frigate.app WARNING : Camera Bedroom has rtmp enabled, but rtmp is not assigned to an input.
Starting migrations
[2021-10-16 17:19:16] peewee_migrate INFO : Starting migrations
There is nothing to migrate
[2021-10-16 17:19:16] peewee_migrate INFO : There is nothing to migrate
[2021-10-16 17:19:16] frigate.mqtt INFO : MQTT connected
[2021-10-16 17:19:16] frigate.app INFO : Output process started: 218
[2021-10-16 17:19:16] detector.coral INFO : Starting detection process: 217
[2021-10-16 17:19:16] ws4py INFO : Using epoll
[2021-10-16 17:19:16] frigate.edgetpu INFO : Attempting to load TPU as usb
[2021-10-16 17:19:16] frigate.app INFO : Camera processor started for Living_Room_Low: 222
[2021-10-16 17:19:16] frigate.app INFO : Camera processor started for Living_Room_High: 226
[2021-10-16 17:19:16] frigate.app INFO : Camera processor started for Patio: 229
[2021-10-16 17:19:16] frigate.app INFO : Camera processor started for Kitchen: 232
[2021-10-16 17:19:16] frigate.app INFO : Camera processor started for Bedroom: 234
[2021-10-16 17:19:16] frigate.app INFO : Capture process started for Living_Room_Low: 235
[2021-10-16 17:19:16] frigate.app INFO : Capture process started for Living_Room_High: 239
[2021-10-16 17:19:16] frigate.app INFO : Capture process started for Patio: 247
[2021-10-16 17:19:17] frigate.app INFO : Capture process started for Kitchen: 259
[2021-10-16 17:19:17] frigate.app INFO : Capture process started for Bedroom: 263
[2021-10-16 17:19:17] ws4py INFO : Using epoll
[2021-10-16 17:19:19] frigate.edgetpu INFO : TPU found
[2021-10-16 17:19:36] watchdog.Living_Room_Low INFO : No frames received from Living_Room_Low in 20 seconds. Exiting ffmpeg...
[2021-10-16 17:19:36] watchdog.Living_Room_Low INFO : Waiting for ffmpeg to exit gracefully...
[2021-10-16 17:20:06] watchdog.Living_Room_Low INFO : FFmpeg didnt exit. Force killing...
[2021-10-16 17:20:06] frigate.video INFO : Living_Room_Low: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-16 17:20:06] frigate.video INFO : Living_Room_Low: ffmpeg process is not running. exiting capture thread...
[2021-10-16 17:20:16] watchdog.Living_Room_Low ERROR : FFMPEG process crashed unexpectedly for Living_Room_Low.
[2021-10-16 17:20:16] watchdog.Living_Room_Low ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-16 17:20:16] watchdog.Living_Room_Low ERROR : You may have invalid args defined for this camera.
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : Guessed Channel Layout for Input Stream #0.1 : mono
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : Input #0, rtsp, from 'rtsp://username:password@192.168.0.206:554/av_stream/ch1':
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : Metadata:
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : title : DYrtpsion
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : Duration: N/A, start: 1634401157.829900, bitrate: N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : Stream #0:0: Video: h264, yuv420p(progressive), 640x360, 10 fps, 10 tbr, 90k tbn, 20 tbc
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : [h264_v4l2m2m @ 0x5588efd740] Using device /dev/video10
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : [h264_v4l2m2m @ 0x5588efd740] driver 'bcm2835-codec' on card 'bcm2835-codec-decode' in mplane mode
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : [h264_v4l2m2m @ 0x5588efd740] requesting formats: output=H264 capture=YU12
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : Stream mapping:
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : Stream #0:0 -> #0:0 (h264 (h264_v4l2m2m) -> rawvideo (native))
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : Press [q] to stop, [?] for help
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:16] ffmpeg.Living_Room_Low.detect ERROR : frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
[2021-10-16 17:20:37] watchdog.Living_Room_Low INFO : No frames received from Living_Room_Low in 20 seconds. Exiting ffmpeg...
[2021-10-16 17:20:37] watchdog.Living_Room_Low INFO : Waiting for ffmpeg to exit gracefully...

@blakeblackshear
Copy link
Owner

Strange. Ffmpeg runs, but no frames ever make it through to Frigate. I don't know why that's happening.

@neildotwilliams
Copy link
Author

I really don't have a clue what's going on to be honest. I'm happy to do any extra diagnostics suggested.

@Papadoma
Copy link

Similar situation here
Green frame, ffmpeg crashing

Seems to me there a bug was introduced in the latest version

@neildotwilliams
Copy link
Author

I think it was failing on the previous version also. I've only recently started using HA and Frigate, this was my first update to Frigate since install. While I was in the config file changing other things (clips, recordings, etc) I tried hardware accel again.

@jonandel
Copy link

jonandel commented Oct 18, 2021

I had a similar issue on one of my cameras. The hardware accel wouldn't work unless I modified the frame height and width to be consistent with the detect frame size...BUT crucially not the stream framesize, but the size reported as 'Buffer'. I used onvif manager to show this as VLC etc would not.... In my case the buffer was 640x368 when stream was reporting 640x360. I guessed it he hardware encoder is a little more picky....although I have no idea what buffer size is...

@neildotwilliams
Copy link
Author

I had a similar issue on one of my cameras. The hardware accel wouldn't work unless I modified the frame height and width to be consistent with the detect frame size...BUT crucially not the stream framesize, but the size reported as 'Buffer'. I used onvif manager to show this as VLC etc would not.... In my case the buffer was 640x368 when stream was reporting 640x360. I guessed it he hardware encoder is a little more picky....although I have no idea what buffer size is...

I'm going to try and look at this tonight. I initially used VLC to check the streams so I'll give them onvif manager a go 👍🏻

@neildotwilliams
Copy link
Author

I tried all combinations, it took hours :-( I was drinking alcohol :-)
My results are attached but the end result was a fail whenever I enabled hardware accelerations
Frigate Testing.txt
.

@jonandel
Copy link

@neildotwilliams I see your hardware accel settings are only included under/for one camera, whereas in my configuration they're globally set (ie section before the cameras). Tried that ?

@neildotwilliams
Copy link
Author

@neildotwilliams I see your hardware accel settings are only included under/for one camera, whereas in my configuration they're globally set (ie section before the cameras). Tried that ?

Hi @jonandel yep, tried that. I removed all other cameras and set it as a global option with just one camera. All of my cameras are the same.

@neildotwilliams
Copy link
Author

I couldn't get onvif manager to work with rtsp streams. I looked at VLC again and it did add 8 to the width on both streams in the buffer dimensions. Tried those as options in frigate.yml but didn't work :-(

@neildotwilliams
Copy link
Author

image

@neildotwilliams
Copy link
Author

image

@healeydave
Copy link

healeydave commented Oct 24, 2021

I'm having exactly the same problem.

Been running Frigate for ages with exactly the same setup without any problems. I recently upgraded Home Assistant and Frigate.
Don't know which one broke my system as they were both done around the same time.

Now I can't run with Hardware Acceleration anymore otherwise I get green screen and ffmpeg errors.
Without HW acceleration, I'm not sure how long my Pi will last because Ive gone from negligible CPU to 80-90%

@blakeblackshear
Copy link
Owner

@healeydave did you change the log level and check your logs to make sure you see the same as I suggested above? Also, nobody has posted the specific version of HassOS, etc either.

@neildotwilliams
Copy link
Author

Apologies. I'm on the latest version of production:

Operating System
Home Assistant OS 6.5 production
core-2021.10.6
supervisor-2021.10.0

@healeydave
Copy link

@blakeblackshear Will add the following now to my setup and report back 👍
global_args: -hide_banner -loglevel info

FYI: I'm running:
Home Assistant core-2021.10.6 , supervisor-2021.10.0 , OS 6.5
Frigate reports 2.0 on the supervisor information page but when I start Frigate, it reports "Starting Frigate (0.9.1-800f33e)" in the log!?

@healeydave
Copy link

healeydave commented Oct 24, 2021

Sorry to hijack your case Neil, but I think we're having the same issue and reporting in one place save's us having to flip between cases and discussions to reach our unified goal :)

Ok, I removed all my camera's from my config apart from one and added the loglevel to it. This is what I got from a startup:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2021-10-24 13:00:37] frigate.app                    INFO    : Starting Frigate (0.9.1-800f33e)
[2021-10-24 13:00:37] frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
[2021-10-24 13:00:37] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2021-10-24 13:00:37] peewee_migrate                 INFO    : There is nothing to migrate
[2021-10-24 13:00:37] frigate.mqtt                   INFO    : MQTT connected
[2021-10-24 13:00:37] detector.coral                 INFO    : Starting detection process: 217
[2021-10-24 13:00:37] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2021-10-24 13:00:37] frigate.app                    INFO    : Output process started: 219
[2021-10-24 13:00:37] frigate.app                    INFO    : Camera processor started for Driveway_Bottom: 222
[2021-10-24 13:00:37] frigate.app                    INFO    : Capture process started for Driveway_Bottom: 225
[2021-10-24 13:00:37] ws4py                          INFO    : Using epoll
[2021-10-24 13:00:37] ws4py                          INFO    : Using epoll
[2021-10-24 13:00:40] frigate.edgetpu                INFO    : TPU found
[2021-10-24 13:00:55] frigate.video                  INFO    : Driveway_Bottom: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-24 13:00:55] frigate.video                  INFO    : Driveway_Bottom: ffmpeg process is not running. exiting capture thread...
[2021-10-24 13:00:57] watchdog.Driveway_Bottom       ERROR   : FFMPEG process crashed unexpectedly for Driveway_Bottom.
[2021-10-24 13:00:57] watchdog.Driveway_Bottom       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-24 13:00:57] watchdog.Driveway_Bottom       ERROR   : You may have invalid args defined for this camera.
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : Input #0, rtsp, from 'rtsp://admin:PW@192.168.1.15:554/Streaming/channels/201':
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :   Metadata:
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :     title           : HIK Media Server V4.40.017
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :     comment         : HIK Media Server Session Description : standard
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :   Duration: N/A, start: 1635076838.142856, bitrate: N/A
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :     Stream #0:0: Video: h264, yuvj420p(pc, bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 20 fps, 24.17 tbr, 90k tbn, 40 tbc
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : Output #0, flv, to 'rtmp://127.0.0.1/live/Driveway_Bottom':
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :   Metadata:
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :     title           : HIK Media Server V4.40.017
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :     comment         : HIK Media Server Session Description : standard
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :     encoder         : Lavf58.45.100
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :     Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuvj420p(pc, bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 20 fps, 24.17 tbr, 1k tbn, 90k tbc
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : Stream mapping:
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :   Stream #0:0 -> #0:0 (copy)
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :   Stream #0:0 -> #1:0 (h264 (native) -> rawvideo (native))
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : Press [q] to stop, [?] for help
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : [swscaler @ 0x5593f5e5e0] deprecated pixel format used, make sure you did set range correctly
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : Output #1, rawvideo, to 'pipe:':
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :   Metadata:
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :     title           : HIK Media Server V4.40.017
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :     comment         : HIK Media Server Session Description : standard
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :     encoder         : Lavf58.45.100
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :     Stream #1:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480 [SAR 4:3 DAR 16:9], q=2-31, 18432 kb/s, 5 fps, 5 tbn, 5 tbc
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :     Metadata:
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   :       encoder         : Lavc58.91.100 rawvideo
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=    6 fps=0.0 q=-1.0 q=-0.0 size=    1008kB time=00:00:01.12 bitrate=7343.4kbits/s speed=1.69x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=   16 fps= 13 q=-1.0 q=-0.0 size=    1090kB time=00:00:01.60 bitrate=5581.6kbits/s dup=0 drop=5 speed=1.34x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=   26 fps= 15 q=-1.0 q=-0.0 size=    1207kB time=00:00:03.00 bitrate=3294.8kbits/s dup=4 drop=13 speed=1.74x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=   36 fps= 16 q=-1.0 q=-0.0 size=    1334kB time=00:00:03.60 bitrate=3036.6kbits/s dup=4 drop=19 speed=1.62x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=   47 fps= 17 q=-1.0 q=-0.0 size=    1515kB time=00:00:04.20 bitrate=2955.6kbits/s dup=4 drop=27 speed=1.51x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=   56 fps= 17 q=-1.0 q=-0.0 size=    2701kB time=00:00:04.60 bitrate=4810.6kbits/s dup=4 drop=34 speed=1.37x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=   65 fps= 17 q=-1.0 q=-0.0 size=    2801kB time=00:00:05.20 bitrate=4413.0kbits/s dup=4 drop=40 speed=1.34x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=   73 fps= 17 q=-1.0 q=-0.0 size=    3032kB time=00:00:05.80 bitrate=4282.8kbits/s dup=4 drop=46 speed=1.32x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=   83 fps= 17 q=-1.0 q=-0.0 size=    3226kB time=00:00:06.20 bitrate=4262.6kbits/s dup=4 drop=53 speed=1.26x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=   94 fps= 17 q=-1.0 q=-0.0 size=    3450kB time=00:00:06.80 bitrate=4156.3kbits/s dup=4 drop=61 speed=1.25x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  104 fps= 17 q=-1.0 q=-0.0 size=    5075kB time=00:00:07.40 bitrate=5618.6kbits/s dup=4 drop=68 speed=1.23x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  112 fps= 17 q=-1.0 q=-0.0 size=    5115kB time=00:00:08.00 bitrate=5238.0kbits/s dup=4 drop=74 speed=1.22x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  122 fps= 17 q=-1.0 q=-0.0 size=    5253kB time=00:00:08.40 bitrate=5123.4kbits/s dup=4 drop=81 speed=1.19x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  132 fps= 17 q=-1.0 q=-0.0 size=    5403kB time=00:00:09.00 bitrate=4918.0kbits/s dup=4 drop=88 speed=1.19x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  142 fps= 18 q=-1.0 q=-0.0 size=    5594kB time=00:00:09.40 bitrate=4875.3kbits/s dup=4 drop=96 speed=1.16x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  152 fps= 18 q=-1.0 q=-0.0 size=    6953kB time=00:00:10.00 bitrate=5695.6kbits/s dup=4 drop=103 speed=1.16x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  158 fps= 17 q=-1.0 q=-0.0 size=    7020kB time=00:00:10.40 bitrate=5529.7kbits/s dup=4 drop=108 speed=1.13x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  168 fps= 17 q=-1.0 q=-0.0 size=    7197kB time=00:00:11.00 bitrate=5359.6kbits/s dup=4 drop=114 speed=1.13x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  178 fps= 17 q=-1.0 q=-0.0 size=    7407kB time=00:00:11.60 bitrate=5230.9kbits/s dup=4 drop=121 speed=1.13x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  188 fps= 17 q=-1.0 q=-0.0 size=    7587kB time=00:00:12.20 bitrate=5094.2kbits/s dup=4 drop=129 speed=1.13x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  198 fps= 18 q=-1.0 q=-0.0 size=    7805kB time=00:00:12.60 bitrate=5074.3kbits/s dup=4 drop=136 speed=1.11x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  206 fps= 17 q=-1.0 q=-0.0 size=    9376kB time=00:00:13.20 bitrate=5818.9kbits/s dup=4 drop=142 speed=1.11x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  217 fps= 17 q=-1.0 q=-0.0 size=    9511kB time=00:00:13.80 bitrate=5646.2kbits/s dup=4 drop=149 speed=1.11x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  227 fps= 17 q=-1.0 q=-0.0 size=    9705kB time=00:00:14.40 bitrate=5520.9kbits/s dup=4 drop=156 speed=1.11x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : [h264 @ 0x5593ab5e40] concealing 15031 DC, 15031 AC, 15031 MV errors in P frame
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  237 fps= 17 q=-1.0 q=-0.0 size=    9859kB time=00:00:15.00 bitrate=5384.2kbits/s dup=4 drop=164 speed=1.08x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : rtsp://admin:PW@192.168.1.15:554/Streaming/channels/201: corrupt decoded frame in stream 0
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  252 fps= 17 q=-1.0 q=-0.0 size=   10083kB time=00:00:15.68 bitrate=5265.4kbits/s dup=4 drop=164 speed=1.09x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  266 fps= 18 q=-1.0 q=-0.0 size=   10334kB time=00:00:16.20 bitrate=5225.7kbits/s dup=7 drop=164 speed=1.08x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  275 fps= 18 q=-1.0 q=-0.0 size=   10511kB time=00:00:16.80 bitrate=5125.1kbits/s dup=7 drop=169 speed=1.08x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : av_interleaved_write_frame(): Connection reset by peer
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : [flv @ 0x5593aaa870] Failed to update header with correct duration.
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : [flv @ 0x5593aaa870] Failed to update header with correct filesize.
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : Error writing trailer of rtmp://127.0.0.1/live/Driveway_Bottom: Connection reset by peer
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : frame=  282 fps= 17 q=-1.0 Lq=-0.0 size=   12183kB time=00:00:17.20 bitrate=5802.5kbits/s dup=7 drop=174 speed=1.06x    
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : video:49979kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[2021-10-24 13:00:57] ffmpeg.Driveway_Bottom.detect  ERROR   : Conversion failed!
[2021-10-24 13:01:10] frigate.video                  INFO    : Driveway_Bottom: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-24 13:01:10] frigate.video                  INFO    : Driveway_Bottom: ffmpeg process is not running. exiting capture thread...

@healeydave
Copy link

Oh, and I just noticed that's without HW acceleration because I forgot to uncomment the lines :)
I do have live view and CPU is hovering around 20% but that's because I only have 1 camera in the config now.

@healeydave
Copy link

Frigate startup with hwaccel enabled and green screen:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2021-10-24 13:18:09] frigate.app                    INFO    : Starting Frigate (0.9.1-800f33e)
[2021-10-24 13:18:10] frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
[2021-10-24 13:18:10] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2021-10-24 13:18:11] peewee_migrate                 INFO    : There is nothing to migrate
[2021-10-24 13:18:11] frigate.mqtt                   INFO    : MQTT connected
[2021-10-24 13:18:11] frigate.app                    INFO    : Output process started: 219
[2021-10-24 13:18:11] frigate.app                    INFO    : Camera processor started for Driveway_Bottom: 222
[2021-10-24 13:18:11] ws4py                          INFO    : Using epoll
[2021-10-24 13:18:11] frigate.app                    INFO    : Capture process started for Driveway_Bottom: 225
[2021-10-24 13:18:11] ws4py                          INFO    : Using epoll
[2021-10-24 13:18:11] detector.coral                 INFO    : Starting detection process: 218
[2021-10-24 13:18:11] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2021-10-24 13:18:14] frigate.video                  INFO    : Driveway_Bottom: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-24 13:18:14] frigate.video                  INFO    : Driveway_Bottom: ffmpeg process is not running. exiting capture thread...
[2021-10-24 13:18:15] frigate.edgetpu                INFO    : TPU found
[2021-10-24 13:18:31] watchdog.Driveway_Bottom       ERROR   : FFMPEG process crashed unexpectedly for Driveway_Bottom.
[2021-10-24 13:18:31] watchdog.Driveway_Bottom       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-24 13:18:31] watchdog.Driveway_Bottom       ERROR   : You may have invalid args defined for this camera.
[2021-10-24 13:18:31] ffmpeg.Driveway_Bottom.detect  ERROR   : Input #0, rtsp, from 'rtsp://admin:PW@192.168.1.15:554/Streaming/channels/201':
[2021-10-24 13:18:31] ffmpeg.Driveway_Bottom.detect  ERROR   :   Metadata:
[2021-10-24 13:18:31] ffmpeg.Driveway_Bottom.detect  ERROR   :     title           : HIK Media Server V4.40.017
[2021-10-24 13:18:31] ffmpeg.Driveway_Bottom.detect  ERROR   :     comment         : HIK Media Server Session Description : standard
[2021-10-24 13:18:31] ffmpeg.Driveway_Bottom.detect  ERROR   :   Duration: N/A, start: 1635077893.656111, bitrate: N/A
[2021-10-24 13:18:31] ffmpeg.Driveway_Bottom.detect  ERROR   :     Stream #0:0: Video: h264, yuvj420p(pc, bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 20 fps, 20 tbr, 90k tbn, 40 tbc
[2021-10-24 13:18:31] ffmpeg.Driveway_Bottom.detect  ERROR   : [h264_v4l2m2m @ 0x5597484bb0] Could not find a valid device
[2021-10-24 13:18:31] ffmpeg.Driveway_Bottom.detect  ERROR   : [h264_v4l2m2m @ 0x5597484bb0] can't configure decoder
[2021-10-24 13:18:31] ffmpeg.Driveway_Bottom.detect  ERROR   : Stream mapping:
[2021-10-24 13:18:31] ffmpeg.Driveway_Bottom.detect  ERROR   :   Stream #0:0 -> #0:0 (copy)
[2021-10-24 13:18:31] ffmpeg.Driveway_Bottom.detect  ERROR   :   Stream #0:0 -> #1:0 (h264 (h264_v4l2m2m) -> rawvideo (native))
[2021-10-24 13:18:31] ffmpeg.Driveway_Bottom.detect  ERROR   : Error while opening decoder for input stream #0:0 : Operation not permitted
[2021-10-24 13:18:33] frigate.video                  INFO    : Driveway_Bottom: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-24 13:18:33] frigate.video                  INFO    : Driveway_Bottom: ffmpeg process is not running. exiting capture thread...
[2021-10-24 13:18:41] watchdog.Driveway_Bottom       ERROR   : FFMPEG process crashed unexpectedly for Driveway_Bottom.
[2021-10-24 13:18:41] watchdog.Driveway_Bottom       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-24 13:18:41] watchdog.Driveway_Bottom       ERROR   : You may have invalid args defined for this camera.
[2021-10-24 13:18:41] ffmpeg.Driveway_Bottom.detect  ERROR   : Input #0, rtsp, from 'rtsp://admin:PW@192.168.1.15:554/Streaming/channels/201':
[2021-10-24 13:18:41] ffmpeg.Driveway_Bottom.detect  ERROR   :   Metadata:
[2021-10-24 13:18:41] ffmpeg.Driveway_Bottom.detect  ERROR   :     title           : HIK Media Server V4.40.017
[2021-10-24 13:18:41] ffmpeg.Driveway_Bottom.detect  ERROR   :     comment         : HIK Media Server Session Description : standard
[2021-10-24 13:18:41] ffmpeg.Driveway_Bottom.detect  ERROR   :   Duration: N/A, start: 1635077912.282689, bitrate: N/A
[2021-10-24 13:18:41] ffmpeg.Driveway_Bottom.detect  ERROR   :     Stream #0:0: Video: h264, yuvj420p(pc, bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 20 fps, 23.58 tbr, 90k tbn, 40 tbc
[2021-10-24 13:18:41] ffmpeg.Driveway_Bottom.detect  ERROR   : [h264_v4l2m2m @ 0x55a86afeb0] Could not find a valid device
[2021-10-24 13:18:41] ffmpeg.Driveway_Bottom.detect  ERROR   : [h264_v4l2m2m @ 0x55a86afeb0] can't configure decoder
[2021-10-24 13:18:41] ffmpeg.Driveway_Bottom.detect  ERROR   : Stream mapping:
[2021-10-24 13:18:41] ffmpeg.Driveway_Bottom.detect  ERROR   :   Stream #0:0 -> #0:0 (copy)
[2021-10-24 13:18:41] ffmpeg.Driveway_Bottom.detect  ERROR   :   Stream #0:0 -> #1:0 (h264 (h264_v4l2m2m) -> rawvideo (native))
[2021-10-24 13:18:41] ffmpeg.Driveway_Bottom.detect  ERROR   : Error while opening decoder for input stream #0:0 : Operation not permitted
[2021-10-24 13:18:43] frigate.video                  INFO    : Driveway_Bottom: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-24 13:18:43] frigate.video                  INFO    : Driveway_Bottom: ffmpeg process is not running. exiting capture thread...

@neildotwilliams
Copy link
Author

@healeydave I'm just glad I'm not alone 👍🏻

@healeydave
Copy link

@neildotwilliams It looks like we are both running up-to-date Home Assistant versions, maybe this is the common denominator. Perhaps they put a new build of FFMPEG in it that is causing the problem??

@blakeblackshear
Copy link
Owner

So this message means that ffmpeg doesnt see the hardware needed for video acceleration:

[h264_v4l2m2m @ 0x5597484bb0] Could not find a valid device

Are both of you using the "Full Access" version of the addon with protection mode disabled?

@healeydave
Copy link

healeydave commented Oct 24, 2021

I have Protection Mode disabled but according to the add-on store I have the Frigate NVR installed, not the Full Access version. What is the Full Access version?
There seems to be quite a few versions in the add-on store now.

@blakeblackshear
Copy link
Owner

Can you try the full access one? I was expecting the switch to be gone for the non-Full Access version.

@emuell36
Copy link

emuell36 commented May 2, 2022

Hey,

anybody who is running 0.11.0-3de1948 with Raspberry Pi OS Lite (64Bit)?
I am still getting a green screen as soon as I switch on the hwaccel.

HW: Raspi 4 4GB
OS: Raspberry Pi OS Lite (64Bit)
Frigate: 0.11.0-3de1948
Installation:Docker-Compose

getting following errors:

frigate | [2022-05-02 15:18:20] watchdog.Front_SB INFO : No frames received from Front_SB in 20 seconds. Exiting ffmpeg...
frigate | [2022-05-02 15:18:20] watchdog.Front_SB INFO : Waiting for ffmpeg to exit gracefully...
frigate | [2022-05-02 15:18:26] frigate.video ERROR : Front_SB: Unable to read frames from ffmpeg process.
frigate | [2022-05-02 15:18:26] frigate.video ERROR : Front_SB: Unable to read frames from ffmpeg process.
frigate | [2022-05-02 15:18:26] frigate.video ERROR : Front_SB: ffmpeg process is not running. exiting capture thread...
frigate | [2022-05-02 15:18:36] watchdog.Front_SB ERROR : Ffmpeg process crashed unexpectedly for Front_SB.
frigate | [2022-05-02 15:18:36] watchdog.Front_SB ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
frigate | [2022-05-02 15:18:36] ffmpeg.Front_SB.detect ERROR : [segment @ 0x5587124f10] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
frigate | [2022-05-02 15:18:36] ffmpeg.Front_SB.detect ERROR : [flv @ 0x5587156810] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
frigate | [2022-05-02 15:18:36] ffmpeg.Front_SB.detect ERROR : [h264_v4l2m2m @ 0x5587461a70] === poll unexpected TIMEOUT: events=0x43, cap buffers=20
frigate | [2022-05-02 15:18:36] ffmpeg.Front_SB.detect ERROR : Last message repeated 1 times
frigate | [2022-05-02 15:18:36] ffmpeg.Front_SB.detect ERROR : Finishing stream 2:0 without any data written to it.
frigate | [2022-05-02 15:18:36] ffmpeg.Front_SB.detect ERROR : [flv @ 0x5587156810] Failed to update header with correct duration.
frigate | [2022-05-02 15:18:36] ffmpeg.Front_SB.detect ERROR : [flv @ 0x5587156810] Failed to update header with correct filesize.

@MickPBduece
Copy link

MickPBduece commented May 3, 2022 via email

@DNKROZ
Copy link

DNKROZ commented May 22, 2022

Just to update this issue with a little info.

I decided to upgrade my current working install (docker & Ubuntu 20.04 on a Rpi 8 GB) to 22.04 release.

After the upgrade I get the same hw acceleration problems as with the Raspian install, will try to reinstall 20.04 later to check if that makes it work again (it should)

Will keep you posted

EDIT: Ubuntu 20.04 works perfectly ok with same config and images

EDIT2: Sorry, didn't notice the thread was closed

@jshep321
Copy link

jshep321 commented Aug 9, 2022

I'm having similar issues with a transcoded mjpg camera on a pi4 32 Bit, running the latest RPI OS bullseye. Anyone have luck with this configuration? hwaccel args kill the ffmpeg process. Comment them out and things are OK.
Note: I added this to my /boot/config.txt, but no joy

#testing hwaccel for mjpg cams from: /~https://github.com/blakeblackshear/frigate/issues/2030
dtoverlay=rpivid-v4l2

@elgorro
Copy link

elgorro commented Aug 10, 2022

@jshep321 check: https://docs.frigate.video/configuration/hardware_acceleration and https://docs.frigate.video/configuration/camera_specific - if u still have issues create a new help submit with all infos requested!

In gereral: I'm facing also firmware issues with the current Kernel and graphics driver, so what I've found out that there is a voltage problem (which can result in errors) - so if your system is a bit slow or error'ish - may some over_voltage helps (https://www.raspberrypi.com/documentation/computers/config_txt.html#overclocking-options). Nevertheless expects minor errors from the raspberry pi kernel/vc4, but its mainly working well for small solutions!

my current config, which runs good (better):

# See /boot/overlays/README for all available options
over_voltage=6 #every step is 0.25mV, so this is 6*0.25mV added!
dtoverlay=vc4-fkms-v3d-pi4 #u may want vc4-kms-v3d-pi4 instead!
...

[pi4]
arm_boost=1
arm_64bit=1 #only the 64bit OS can handle this ofc!
gpu_mem=512
dtoverlay=rpivid-v4l2
...

what I've not tried yet is to powersupply the TPU with an powered usb-hub.

@emuell36
Copy link

@elgorro -

what I've not tried yet is to powersupply the TPU with an powered usb-hub.

What is exectly what you should do - my whole set up became instable when I connected the TPU the first time, after I connected it via an powerd Hub everything was back to normal - I think there are many otheres told that story befor!

The HwAccel Support is currently really bad - currently I found a config running on Pi 4 32Bit and 64Bit but doesn't give any performance improvements according to htop.

Have good one!

@bleszinske
Copy link

@elgorro - You were able to get the RPi4b to do hw accelerated h.264 decode to work with the modifications you listed above in your config.txt and adding it to your frigate.yml? I am still struggling to make the hw decode work...

@elgorro
Copy link

elgorro commented Aug 22, 2022

No - not like this and it's only "running" (: I'm on Arch 64 Bit with "linux-rpi"-Kernel where u have a /boot/config.txt - not sure what are your issues and feel free to submit an new issue ;)

@bleszinske
Copy link

I tried to use the /boot/config,txt changes you mentioned on this thread, combined with a bunch of frigate.yml changes... But I have failed to make the hw video decode work, so CPU utilization is very high... I did open a new issue... It is issue #3677

Just looking for other ideas...

@cmgerdes
Copy link

cmgerdes commented Oct 30, 2022

Can I confirm if this is fixed in 0.11.1 and have someone confirm my ffmpeg config? I ask because I'm running on a raspi4 with the latest OS as of maybe a week ago. I've tried the standard frigate addon 0.11.1, the frigate full access 0.11.1, and the frigate full access beta 0.11.1 and they are all getting the errors that are described in this thread as soon as I enable hardware accel. note that for the full access versions I've tried with protected mode both on and off. Below are the ffmpeg arguments I'm using (using the global args in frigate.yaml):

ffmpeg:
  hwaccel_args:
   - -c:v
   - h264_v4l2m2m
  global_args:
    - -hide_banner
    - -loglevel
    - info
  input_args:
    - -avoid_negative_ts
    - make_zero
    - -fflags
    - +genpts+discardcorrupt
    - -rtsp_transport
    - tcp
    - -timeout
    - '5000000'
    - -use_wallclock_as_timestamps
    - '1'

@NickM-27
Copy link
Collaborator

Can I confirm if this is fixed in 0.11.1 and have someone confirm my ffmpeg config? I ask because I'm running on a raspi4 with the latest OS as of maybe a week ago. I've tried the standard frigate addon 0.11.1, the frigate full access 0.11.1, and the frigate full access beta 0.11.1 and they are all getting the errors that are described in this thread as soon as I enable hardware accel. note that for the full access versions I've tried with protected mode both on and off. Below are the ffmpeg arguments I'm using (using the global args in frigate.yaml):

ffmpeg:
  hwaccel_args:
   - -c:v
   - h264_v4l2m2m
  global_args:
    - -hide_banner
    - -loglevel
    - info
  input_args:
    - -avoid_negative_ts
    - make_zero
    - -fflags
    - +genpts+discardcorrupt
    - -rtsp_transport
    - tcp
    - -timeout
    - '5000000'
    - -use_wallclock_as_timestamps
    - '1'

See #3780

@cmgerdes
Copy link

Can I confirm if this is fixed in 0.11.1 and have someone confirm my ffmpeg config? I ask because I'm running on a raspi4 with the latest OS as of maybe a week ago. I've tried the standard frigate addon 0.11.1, the frigate full access 0.11.1, and the frigate full access beta 0.11.1 and they are all getting the errors that are described in this thread as soon as I enable hardware accel. note that for the full access versions I've tried with protected mode both on and off. Below are the ffmpeg arguments I'm using (using the global args in frigate.yaml):

ffmpeg:
  hwaccel_args:
   - -c:v
   - h264_v4l2m2m
  global_args:
    - -hide_banner
    - -loglevel
    - info
  input_args:
    - -avoid_negative_ts
    - make_zero
    - -fflags
    - +genpts+discardcorrupt
    - -rtsp_transport
    - tcp
    - -timeout
    - '5000000'
    - -use_wallclock_as_timestamps
    - '1'

See #3780

Thank you! I’d read through this thread several times, and it seemed like towards the end people were saying the new update has worked for them. This clarifies things.

@skstussy
Copy link

skstussy commented Nov 8, 2022

I have a rpi4 8GB and have not been able to get hardware acceleration working. I've been trying to reduce the CPU usage overall. The ffmpeg process dies no matter what config I specify. the result is green screen. I wonder if the reason is what I just read in the rpi4 docs here under license key and codec section?

@NickM-27
Copy link
Collaborator

NickM-27 commented Nov 8, 2022

I have a rpi4 8GB and have not been able to get hardware acceleration working. I've been trying to reduce the CPU usage overall. The ffmpeg process dies no matter what config I specify. the result is green screen. I wonder if the reason is what I just read in the rpi4 docs here under license key and codec section?

The reason is most likely #3780

@MickPBduece
Copy link

MickPBduece commented Nov 9, 2022 via email

@skstussy
Copy link

I didn't have a coral in the beginning and was having the same problem with CPU detectors.
I did buy a coral couple weeks ago to offload some of the load on the CPU, but it hasn't reduced CPU usage as much as I'd liked. So now I'm back trying to get the hardware accel enabled. Power is supplied by 5V 5A adaptor to rpi4 and usb coral connected (no separate power source).

I assume the problem is related to what is being discussed in #3780 but I don't know how to go about downgrading kernel because I'm using the Home Assistant OS. those people that seems to have got it working I think are using containers which I assume gives them more flexibility. So I guess I just have to wait until it gets addressed..

@cmgerdes
Copy link

cmgerdes commented Nov 10, 2022 via email

@NickM-27
Copy link
Collaborator

Motion mask anywhere that has motion your don’t want to analyze

To be clear, this is in recommended against as it can cause glitches in tracking when large motion masks are included

https://docs.frigate.video/configuration/masks

@skstussy
Copy link

Thank you all for the replies, I'm humbled by the support provided. I'll give some of these suggestions another try, some I have already attempted without success like setting resolution. Masks was something I was planning to try because I had read about that before. I hadn't thought about reducing fps yet. Will give that ago as well -currently set to 5. Thank you! with any luck I can limp along until kernel is addressed.

@skstussy
Copy link

btw did anyone read this section of the rpi docs? license key and codec section

It's still bothering me and would be great if someone can explicitly tell me it's unrelated?

@NickM-27
Copy link
Collaborator

btw did anyone read this section of the rpi docs? license key and codec section

It's still bothering me and would be great if someone can explicitly tell me it's unrelated?

It's talking about MPEG2 and VC1 which I have not heard of cameras using, your camera is likely h.264 or h.265 making that unrelated

@skstussy
Copy link

Sigh of relief, thank goodness. Now I can rest easy thank you.
yes my cams on NVR are using main 264 and sub 265. I don't know this stuff that well and noticed VLC uses h264 MPEG-4 AVC. The MPEG part got me :|

@ChristopherGerdes
Copy link

Motion mask anywhere that has motion your don’t want to analyze

To be clear, this is in recommended against as it can cause glitches in tracking when large motion masks are included

https://docs.frigate.video/configuration/masks

Thank you, I hadn't been aware of this.

In my case, I was masking areas that I don't want detection to happen at all and don't expect detected objects to move into. For example: I masked a garden area where I don't expect someone coming up my driveway to walk into my garden. Similarly, I masked a bush whose movement was triggering motion because I don't expect an object to climb into the bush.

Are these safe/appropriate ways to mask?

@NickM-27
Copy link
Collaborator

NickM-27 commented Nov 10, 2022

In my case, I was masking areas that I don't want detection to happen at all and don't expect detected objects to move into. For example: I masked a garden area where I don't expect someone coming up my driveway to walk into my garden. Similarly, I masked a bush whose movement was triggering motion because I don't expect an object to climb into the bush.

Are these safe/appropriate ways to mask?

Yes that makes sense, as someone who was standing in your bushes would cause more motion outside the bushes anyway. I was mostly referring to the scenario I see here relatively often which is like "I don't care if someone is in my street so I put a motion mask across the entire street" which causes problems

@mantaalex
Copy link

Hey for all the people with google coral on raspberry pi
Its safer to use an powered USB hub
I had some trouble to in the beginning the google coral usb uses alot of power
I have a setup on an rpi 4 where i have an nvme ssd on usb that usb is connected directly in the pi
and the google coral usb in this one:
https://nl.aliexpress.com/item/1005001413424993.html?spm=a2g0o.order_list.order_list_main.52.3a6279d2O538lU&gatewayAdapt=glo2nld
Please trust me on my word its a great hub.
just make sure you order the version with the external USB C power
and put an original raspberry pi usb c power adapter of 3A on both the rpi4 and the usb hub with only the google coral on it
and make sure the wires are not crossed ;)

i hope this helps some people
I don't say it will solve all issues with hwaccess maybe some power issues
grz alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests