blakeblackshear / frigate

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

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

Closed neildotwilliams closed 2 years ago

neildotwilliams commented 2 years ago

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:

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

Papadoma commented 2 years ago

@Papadoma this is an error stating that the hardware for 32bit OS can't be found. Are you certain you are running the full access addon version with protection mode disabled?

There was a banner that protection mode was disabled. To make sure, I enabled it so that I can disable it again but now I noticed that the toggle switch is missing. Not sure if HA changed something.

Edit: The protection mode toggle is there on other addons, like Glances.

blakeblackshear commented 2 years ago

@Papadoma probably means you don't have the full access addon installed.

Papadoma commented 2 years ago

Yeap. That was it. For some reason, upon updating, the addon changed over to the one without full access. Now, with the full access one, enabling hardware acceleration seems to be working.

healeydave commented 2 years ago

FYI: I've updated to Frigate 2.3 today as well as HA Supervisor 10.6 but still green screen with hwaccel enabled.

neildotwilliams commented 2 years ago

Still not working for me, I am just trying to provide some more info as I dont really know what I'm doing ;-) I have switched to using the 'full access' version of Frigate 2.3. Did some testing from the Frigate console, as you can see running ffmpeg, forcing the output format to null and piping the output to null.

Running ffmpeg WITHOUT hardware decoding and as few options as possible, forcing output format to null and also sending output to null. This runs ok until I hit CTRL-C root@ccab4aaf-frigate-fa:/usr/local/bin# ffmpeg -loglevel debug -i rtsp://:@192.168.0.206:554/av_stream/ch1 -f null /dev/null ffmpeg version 4.3.1 Copyright (c) 2000-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 Splitting the commandline. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. Reading option '-i' ... matched as input url with argument 'rtsp://:@192.168.0.206:554/av_stream/ch1'. Reading option '-f' ... matched as option 'f' (force format) with argument 'null'. Reading option '/dev/null' ... matched as output url. Finished splitting the commandline. Parsing a group of options: global . Applying option loglevel (set logging level) with argument debug. Successfully parsed a group of options. Parsing a group of options: input url rtsp://:@192.168.0.206:554/av_stream/ch1. Successfully parsed a group of options. Opening an input file: rtsp://:@192.168.0.206:554/av_stream/ch1. [tcp @ 0x55d2011840] No default whitelist set [tcp @ 0x55d2011840] Original list of addresses: [tcp @ 0x55d2011840] Address 192.168.0.206 port 554 [tcp @ 0x55d2011840] Interleaved list of addresses: [tcp @ 0x55d2011840] Address 192.168.0.206 port 554 [tcp @ 0x55d2011840] Starting connection attempt to 192.168.0.206 port 554 [tcp @ 0x55d2011840] Successfully connected to 192.168.0.206 port 554 [rtsp @ 0x55d200f670] SDP: v=0 o=- 1 1 IN IP4 rom t_rtsplin s=DYrtpsion c=IN IP4 0.0.0.0 t=0 0 a=control:* a=range:npt=0-
m=video 0 RTP/AVP 96 a=rtpmap:96 H264/90000 a=control:trackID=0 a=fmtp:96 packetization-mode=1; sprop-parameter-sets=R01AHpmgKAv+WEAAAPoAABOIIQ==,SO48gA==; profile-level-id=4D401E m=audio 0 RTP/AVP 8 b=AS:64 a=control:trackID=1 a=rtpmap:8 PCMA/8000/1 a=ptime:125 a=fmtp:8

Failed to parse interval end specification '' [rtsp @ 0x55d200f670] video codec set to: h264 [rtsp @ 0x55d200f670] RTP Packetization Mode: 1 [rtsp @ 0x55d200f670] Extradata set to 0x55d2012e40 (size: 31) [rtsp @ 0x55d200f670] RTP Profile IDC: 4d Profile IOP: 40 Level: 1e [rtsp @ 0x55d200f670] audio codec set to: pcm_alaw [rtsp @ 0x55d200f670] audio samplerate set to: 8000 [rtsp @ 0x55d200f670] audio channels set to: 1 [rtp @ 0x55d2014220] No default whitelist set [udp @ 0x55d20143e0] No default whitelist set [udp @ 0x55d20143e0] end receive buffer size reported is 425984 [udp @ 0x55d20246a0] No default whitelist set [udp @ 0x55d20246a0] end receive buffer size reported is 425984 [rtsp @ 0x55d200f670] setting jitter buffer size to 500 [rtp @ 0x55d2034bf0] No default whitelist set [udp @ 0x55d2034e80] No default whitelist set [udp @ 0x55d2034e80] end receive buffer size reported is 425984 [udp @ 0x55d2045140] No default whitelist set [udp @ 0x55d2045140] end receive buffer size reported is 425984 [rtsp @ 0x55d200f670] setting jitter buffer size to 500 [rtsp @ 0x55d200f670] hello state=0 [h264 @ 0x55d2012960] nal_unit_type: 7(SPS), nal_ref_idc: 2 [h264 @ 0x55d2012960] nal_unit_type: 8(PPS), nal_ref_idc: 2 [h264 @ 0x55d2012960] nal_unit_type: 7(SPS), nal_ref_idc: 2 [h264 @ 0x55d2012960] nal_unit_type: 8(PPS), nal_ref_idc: 2 [h264 @ 0x55d2012960] nal_unit_type: 5(IDR), nal_ref_idc: 2 [h264 @ 0x55d2012960] Format yuv420p chosen by get_format(). [h264 @ 0x55d2012960] Reinit context to 640x368, pix_fmt: yuv420p [h264 @ 0x55d2012960] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 Last message repeated 5 times [rtsp @ 0x55d200f670] All info found Guessed Channel Layout for Input Stream #0.1 : mono Input #0, rtsp, from 'rtsp://:@192.168.0.206:554/av_stream/ch1': Metadata: title : DYrtpsion Duration: N/A, start: 0.325000, bitrate: N/A Stream #0:0, 28, 1/90000: Video: h264, 1 reference frame, yuv420p(progressive, left), 640x360 (640x368), 0/1, 10 fps, 10 tbr, 90k tbn, 20 tbc Stream #0:1, 19, 1/8000: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s Successfully opened the file. Parsing a group of options: output url /dev/null. Applying option f (force format) with argument null. Successfully parsed a group of options. Opening an output file: /dev/null. Successfully opened the file. detected 4 logical cores [h264 @ 0x55d2075740] nal_unit_type: 7(SPS), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 8(PPS), nal_ref_idc: 2 Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native)) Stream #0:1 -> #0:1 (pcm_alaw (native) -> pcm_s16le (native)) Press [q] to stop, [?] for help cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [graph_1_in_0_1 @ 0x55d212aab0] Setting 'time_base' to value '1/8000' [graph_1_in_0_1 @ 0x55d212aab0] Setting 'sample_rate' to value '8000' [graph_1_in_0_1 @ 0x55d212aab0] Setting 'sample_fmt' to value 's16' [graph_1_in_0_1 @ 0x55d212aab0] Setting 'channel_layout' to value '0x4' [graph_1_in_0_1 @ 0x55d212aab0] tb:1/8000 samplefmt:s16 samplerate:8000 chlayout:0x4 [format_out_0_1 @ 0x55d212b080] Setting 'sample_fmts' to value 's16' [AVFilterGraph @ 0x55d20f2710] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 3 times [h264 @ 0x55d2075740] nal_unit_type: 5(IDR), nal_ref_idc: 2 [h264 @ 0x55d2075740] Format yuv420p chosen by get_format(). [h264 @ 0x55d2075740] Reinit context to 640x368, pix_fmt: yuv420p cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 1 times [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 1 times [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [graph 0 input from stream 0:0 @ 0x55d21c6890] Setting 'video_size' to value '640x360' [graph 0 input from stream 0:0 @ 0x55d21c6890] Setting 'pix_fmt' to value '0' [graph 0 input from stream 0:0 @ 0x55d21c6890] Setting 'time_base' to value '1/90000' [graph 0 input from stream 0:0 @ 0x55d21c6890] Setting 'pixel_aspect' to value '0/1' [graph 0 input from stream 0:0 @ 0x55d21c6890] Setting 'frame_rate' to value '10/1' [graph 0 input from stream 0:0 @ 0x55d21c6890] w:640 h:360 pixfmt:yuv420p tb:1/90000 fr:10/1 sar:0/1 [AVFilterGraph @ 0x55d214bed0] query_formats: 3 queried, 2 merged, 0 already done, 0 delayed Output #0, null, to '/dev/null': Metadata: title : DYrtpsion encoder : Lavf58.45.100 Stream #0:0, 0, 1/10: Video: wrapped_avframe, 1 reference frame, yuv420p(left), 640x360, 0/1, q=2-31, 200 kb/s, 10 fps, 10 tbn, 10 tbc Metadata: encoder : Lavc58.91.100 wrapped_avframe Stream #0:1, 0, 1/8000: Audio: pcm_s16le, 8000 Hz, mono, s16, 128 kb/s Metadata: encoder : Lavc58.91.100 pcm_s16le [null @ 0x55d208b240] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 6 >= 1 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [null @ 0x55d208b240] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 6 >= 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [null @ 0x55d208b240] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 6 >= 3 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [null @ 0x55d208b240] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 6 >= 4 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [null @ 0x55d208b240] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 6 >= 5 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [null @ 0x55d208b240] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 6 >= 6 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 5(IDR), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 5(IDR), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 5(IDR), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [null @ 0x55d208b240] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 56320 >= 56280 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 5(IDR), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 5(IDR), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2075740] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2153000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d20a4f30] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d210b0b0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 [h264 @ 0x55d2123a70] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 frame= 116 fps= 13 q=-0.0 Lsize=N/A time=00:00:12.15 bitrate=N/A speed=1.33x
video:61kB audio:192kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Input file #0 (rtsp://:@192.168.0.206:554/av_stream/ch1): Input stream #0:0 (video): 120 packets read (298208 bytes); 117 frames decoded; Input stream #0:1 (audio): 77 packets read (98560 bytes); 77 frames decoded (98560 samples); Total: 197 packets (396768 bytes) demuxed Output file #0 (/dev/null): Output stream #0:0 (video): 116 frames encoded; 116 packets muxed (62176 bytes); Output stream #0:1 (audio): 77 frames encoded (98560 samples); 77 packets muxed (197120 bytes); Total: 193 packets (259296 bytes) muxed 194 frames successfully decoded, 0 decoding errors Exiting normally, received signal 2.

Running ffmpeg WITH hardware decoding on incoming video stream, forcing output format to null and also sending output to null. This runs for a while showing 0 frames processed then exits root@ccab4aaf-frigate-fa:/usr/local/bin# ffmpeg -loglevel debug -c:v h264_v4l2m2m -i rtsp://:@192.168.0.206:554/av_stream/ch1 -f null /dev/null ffmpeg version 4.3.1 Copyright (c) 2000-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 Splitting the commandline. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'h264_v4l2m2m'. Reading option '-i' ... matched as input url with argument 'rtsp://:@192.168.0.206:554/av_stream/ch1'. Reading option '-f' ... matched as option 'f' (force format) with argument 'null'. Reading option '/dev/null' ... matched as output url. Finished splitting the commandline. Parsing a group of options: global . Applying option loglevel (set logging level) with argument debug. Successfully parsed a group of options. Parsing a group of options: input url rtsp://:@192.168.0.206:554/av_stream/ch1. Applying option c:v (codec name) with argument h264_v4l2m2m. Successfully parsed a group of options. Opening an input file: rtsp://:@192.168.0.206:554/av_stream/ch1. [tcp @ 0x558a5458c0] No default whitelist set [tcp @ 0x558a5458c0] Original list of addresses: [tcp @ 0x558a5458c0] Address 192.168.0.206 port 554 [tcp @ 0x558a5458c0] Interleaved list of addresses: [tcp @ 0x558a5458c0] Address 192.168.0.206 port 554 [tcp @ 0x558a5458c0] Starting connection attempt to 192.168.0.206 port 554 [tcp @ 0x558a5458c0] Successfully connected to 192.168.0.206 port 554 [rtsp @ 0x558a5436f0] SDP: v=0 o=- 1 1 IN IP4 rom t_rtsplin s=DYrtpsion c=IN IP4 0.0.0.0 t=0 0 a=control:* a=range:npt=0-
m=video 0 RTP/AVP 96 a=rtpmap:96 H264/90000 a=control:trackID=0 a=fmtp:96 packetization-mode=1; sprop-parameter-sets=R01AHpmgKAv+WEAAAPoAABOIIQ==,SO48gA==; profile-level-id=4D401E m=audio 0 RTP/AVP 8 b=AS:64 a=control:trackID=1 a=rtpmap:8 PCMA/8000/1 a=ptime:125 a=fmtp:8

Failed to parse interval end specification '' [rtsp @ 0x558a5436f0] video codec set to: h264 [rtsp @ 0x558a5436f0] RTP Packetization Mode: 1 [rtsp @ 0x558a5436f0] Extradata set to 0x558a546ec0 (size: 31) [rtsp @ 0x558a5436f0] RTP Profile IDC: 4d Profile IOP: 40 Level: 1e [rtsp @ 0x558a5436f0] audio codec set to: pcm_alaw [rtsp @ 0x558a5436f0] audio samplerate set to: 8000 [rtsp @ 0x558a5436f0] audio channels set to: 1 [rtp @ 0x558a5482a0] No default whitelist set [udp @ 0x558a548460] No default whitelist set [udp @ 0x558a548460] end receive buffer size reported is 425984 [udp @ 0x558a558720] No default whitelist set [udp @ 0x558a558720] end receive buffer size reported is 425984 [rtsp @ 0x558a5436f0] setting jitter buffer size to 500 [rtp @ 0x558a568c70] No default whitelist set [udp @ 0x558a568f00] No default whitelist set [udp @ 0x558a568f00] end receive buffer size reported is 425984 [udp @ 0x558a5791c0] No default whitelist set [udp @ 0x558a5791c0] end receive buffer size reported is 425984 [rtsp @ 0x558a5436f0] setting jitter buffer size to 500 [rtsp @ 0x558a5436f0] hello state=0 [h264 @ 0x558a5469e0] nal_unit_type: 7(SPS), nal_ref_idc: 2 [h264 @ 0x558a5469e0] nal_unit_type: 8(PPS), nal_ref_idc: 2 [h264 @ 0x558a5469e0] nal_unit_type: 7(SPS), nal_ref_idc: 2 [h264 @ 0x558a5469e0] nal_unit_type: 8(PPS), nal_ref_idc: 2 [h264 @ 0x558a5469e0] nal_unit_type: 5(IDR), nal_ref_idc: 2 [h264 @ 0x558a5469e0] Format yuv420p chosen by get_format(). [h264 @ 0x558a5469e0] Reinit context to 640x368, pix_fmt: yuv420p [h264 @ 0x558a5469e0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2 Last message repeated 5 times [rtsp @ 0x558a5436f0] All info found Guessed Channel Layout for Input Stream #0.1 : mono Input #0, rtsp, from 'rtsp://:@192.168.0.206:554/av_stream/ch1': Metadata: title : DYrtpsion Duration: N/A, start: 0.536000, bitrate: N/A Stream #0:0, 28, 1/90000: Video: h264, 1 reference frame, yuv420p(progressive, left), 640x360 (640x368), 0/1, 10 fps, 10 tbr, 90k tbn, 20 tbc Stream #0:1, 17, 1/8000: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s Successfully opened the file. Parsing a group of options: output url /dev/null. Applying option f (force format) with argument null. Successfully parsed a group of options. Opening an output file: /dev/null. Successfully opened the file. [h264_mp4toannexb @ 0x558a5434d0] The input looks like it is Annex B already [h264_v4l2m2m @ 0x558a5a7650] probing device /dev/video12 [h264_v4l2m2m @ 0x558a5a7650] driver 'bcm2835-codec' on card 'bcm2835-codec-isp' in mplane mode [h264_v4l2m2m @ 0x558a5a7650] v4l2 output format not supported [h264_v4l2m2m @ 0x558a5a7650] probing device /dev/video11 [h264_v4l2m2m @ 0x558a5a7650] driver 'bcm2835-codec' on card 'bcm2835-codec-encode' in mplane mode [h264_v4l2m2m @ 0x558a5a7650] v4l2 output format not supported [h264_v4l2m2m @ 0x558a5a7650] probing device /dev/video16 [h264_v4l2m2m @ 0x558a5a7650] driver 'bcm2835-isp' on card 'bcm2835-isp' in unknown mode [h264_v4l2m2m @ 0x558a5a7650] probing device /dev/video15 [h264_v4l2m2m @ 0x558a5a7650] driver 'bcm2835-isp' on card 'bcm2835-isp' in splane mode [h264_v4l2m2m @ 0x558a5a7650] v4l2 output format not supported [h264_v4l2m2m @ 0x558a5a7650] probing device /dev/video14 [h264_v4l2m2m @ 0x558a5a7650] driver 'bcm2835-isp' on card 'bcm2835-isp' in splane mode [h264_v4l2m2m @ 0x558a5a7650] v4l2 output format not supported [h264_v4l2m2m @ 0x558a5a7650] probing device /dev/video13 [h264_v4l2m2m @ 0x558a5a7650] driver 'bcm2835-isp' on card 'bcm2835-isp' in splane mode [h264_v4l2m2m @ 0x558a5a7650] v4l2 output format not supported [h264_v4l2m2m @ 0x558a5a7650] probing device /dev/video10 [h264_v4l2m2m @ 0x558a5a7650] driver 'bcm2835-codec' on card 'bcm2835-codec-decode' in mplane mode [h264_v4l2m2m @ 0x558a5a7650] Using device /dev/video10 [h264_v4l2m2m @ 0x558a5a7650] driver 'bcm2835-codec' on card 'bcm2835-codec-decode' in mplane mode [h264_v4l2m2m @ 0x558a5a7650] requesting formats: output=H264 capture=YU12 [h264_v4l2m2m @ 0x558a5a7650] output: H264 16 buffers initialized: 0640x0360, sizeimage 00524288, bytesperline 00000000 Stream mapping: Stream #0:0 -> #0:0 (h264 (h264_v4l2m2m) -> wrapped_avframe (native)) Stream #0:1 -> #0:1 (pcm_alaw (native) -> pcm_s16le (native)) Press [q] to stop, [?] for help cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) detected 4 logical cores [graph_1_in_0_1 @ 0x558a5a57d0] Setting 'time_base' to value '1/8000' [graph_1_in_0_1 @ 0x558a5a57d0] Setting 'sample_rate' to value '8000' [graph_1_in_0_1 @ 0x558a5a57d0] Setting 'sample_fmt' to value 's16' [graph_1_in_0_1 @ 0x558a5a57d0] Setting 'channel_layout' to value '0x4' [graph_1_in_0_1 @ 0x558a5a57d0] tb:1/8000 samplefmt:s16 samplerate:8000 chlayout:0x4 [format_out_0_1 @ 0x558a5dd9e0] Setting 'sample_fmts' to value 's16' [AVFilterGraph @ 0x558a5bfba0] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 2 times [h264_v4l2m2m @ 0x558a5a7650] capture: YU12 20 buffers initialized: 0640x0368, sizeimage 00353280, bytesperline 00000640 cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 49 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 9 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 9 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 9 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 7 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 9 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 9 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 7 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 9 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 9 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 9 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 9 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 9 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 9 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 8 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 9 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 7 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Last message repeated 9 times cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) Too many packets buffered for output stream 0:1. Conversion failed!

I ran 'lsmod' on the root of HA to get the ista;led kernal modules, if that makes a difference?! Use ha to access the Home Assistant CLI.

lsmod

Module Size Used by xt_comment 16384 0 rfcomm 53248 4 nf_conntrack_netlink 49152 0 nfnetlink 16384 4 nf_conntrack_netlink xfrm_user 40960 1 xfrm_algo 16384 1 xfrm_user algif_hash 20480 1 aes_neon_bs 28672 2 aes_neon_blk 36864 4 aes_neon_bs crypto_simd 24576 2 aes_neon_bs,aes_neon_blk cryptd 28672 2 crypto_simd algif_skcipher 20480 1 af_alg 32768 6 algif_hash,algif_skcipher bnep 28672 2 hci_uart 49152 1 btbcm 24576 1 hci_uart bluetooth 466944 31 hci_uart,btbcm,bnep,rfcomm ecdh_generic 16384 2 bluetooth ecc 32768 1 ecdh_generic sch_fq_codel 20480 8 i2c_dev 20480 0 brcmfmac 323584 0 brcmutil 24576 1 brcmfmac sha256_generic 16384 0 cfg80211 880640 1 brcmfmac rfkill 36864 4 bluetooth,cfg80211 raspberrypi_hwmon 16384 0 i2c_mux_pinctrl 16384 0 i2c_mux 16384 1 i2c_mux_pinctrl bcm2835_codec 49152 1 bcm2835_isp 32768 0 bcm2835_v4l2 45056 0 i2c_bcm2835 16384 0 v4l2_mem2mem 40960 1 bcm2835_codec bcm2835_mmal_vchiq 32768 3 bcm2835_codec,bcm2835_v4l2,bcm2835_isp snd_bcm2835 28672 3 videobuf2_vmalloc 20480 1 bcm2835_v4l2 videobuf2_dma_contig 24576 23 bcm2835_codec,bcm2835_isp videobuf2_memops 20480 2 videobuf2_vmalloc,videobuf2_dma_contig videobuf2_v4l2 32768 4 bcm2835_codec,bcm2835_v4l2,v4l2mem2mem,bcm2835 isp snd_pcm 131072 2 snd_bcm2835 videobuf2_common 61440 5 bcm2835_codec,videobuf2_v4l2,bcm2835_v4l2,v4l2_m em2mem,bcm2835_isp videodev 311296 7 bcm2835_codec,videobuf2_v4l2,bcm2835_v4l2,videob uf2_common,v4l2_mem2mem,bcm2835_isp snd_timer 36864 2 snd_pcm snd 102400 7 snd_bcm2835,snd_timer,snd_pcm vc_sm_cma 36864 23 bcm2835_mmal_vchiq,bcm2835_isp ch341 20480 1 rpivid_mem 16384 0 uio_pdrv_genirq 16384 0 uio 24576 1 uio_pdrv_genirq nvmem_rmem 16384 0 drm 557056 0 fuse 131072 1 drm_panel_orientation_quirks 20480 1 drm backlight 20480 1 drm

neildotwilliams commented 2 years ago

Digging around some more from the HA root console, I noticed that every 30 seconds the ffmpeg thread with the hardware acceleration turned on maxes out the CPU core for 30 seconds, then disappears, then reappears for 30 seconds, repeating this cycle. Image attached from running top. My poor CPU :-) I've left this running for a while but I'm going to disable hwaccel for the moment and just enable when I get more time to look at it.

2021-10-25 20_05_25-Window-Frigate100pct

healeydave commented 2 years ago

Yeah, I'm not running Frigate until we can get to the bottom of this, I don't want a dead Rpi either.

neildotwilliams commented 2 years ago

I'm going to keep running Frigate, I like it too much ;-) I will only enable hardware acceleration when I'm trying to debug it. Running 5 cameras on my Pi4 seems to hover all the cores at around 35%, I can live with that.

healeydave commented 2 years ago

Wow, how come only 35% with 5 camera's, mines spiking anywhere from 70-90% without HW acceleration and I've limited my config to only one camera whilst testing this issue.

alevike commented 2 years ago

hm, only 35% for 5 cameras?! i have 70-80% for 4 cameras with resolution 1280x720, detection at 2fps with coral tpu but without the hw acceleration. to be honest i don’t know what would be the expected load with hw acceleration as i’ve just started to use frigate…

On Mon, 25 Oct 2021 at 22:48, healeydave @.***> wrote:

Wow, how come only 35% with 5 camera's, mines spiking anywhere from 70-90% without HW acceleration and I've limited my config to only one camera whilst testing this issue.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blakeblackshear/frigate/issues/2030#issuecomment-951253037, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOQQY7HIAUM2IG7RPQYYR53UIWX77ANCNFSM5GDYNB6Q .

neildotwilliams commented 2 years ago

Depends on each setup I guess, you can see my config in my original post. My cameras are 1080p, not 4k. I use a sub-stream for detection on the lower resolution stream. And I have a Coral TPU which I think is essential anyway for anything AI.

neildotwilliams commented 2 years ago

Just checks CPU again, 35% was not correct, it's more like 50-60% with occasional spikes higher, definitely not 7090%. Maybe depends on camera activity and everything else that's running?

Papadoma commented 2 years ago

2 cameras, one 720p one 1080p 60% on a Rpi4 with a coral TPU

matthijsvdr commented 2 years ago

Running on a PI4 with 8 GB ram running with docker compose (eg outside of home assistant)

When running the camera on 640x480 everything works fine, but running it on 3840x2160 I get a green screen. No settings are changed other than the resolution and the rtsp url.

Logs are run with the verbose flag:

[2021-10-26 22:09:53] frigate.mqtt                   INFO    : MQTT connected
[2021-10-26 22:09:53] ws4py                          INFO    : Using epoll
[2021-10-26 22:09:53] frigate.app                    INFO    : Output process started: 220
[2021-10-26 22:09:53] frigate.app                    INFO    : Camera processor started for garage-view: 224
[2021-10-26 22:09:53] frigate.app                    INFO    : Capture process started for garage-view: 226
[2021-10-26 22:09:53] ws4py                          INFO    : Using epoll
[2021-10-26 22:09:56] frigate.edgetpu                INFO    : TPU found
[2021-10-26 22:10:13] watchdog.garage-view           INFO    : No frames received from garage-view in 20 seconds. Exiting ffmpeg...
[2021-10-26 22:10:13] watchdog.garage-view           INFO    : Waiting for ffmpeg to exit gracefully...
[2021-10-26 22:10:43] watchdog.garage-view           INFO    : FFmpeg didnt exit. Force killing...
[2021-10-26 22:10:43] frigate.video                  INFO    : garage-view: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2021-10-26 22:10:43] frigate.video                  INFO    : garage-view: ffmpeg process is not running. exiting capture thread...
[2021-10-26 22:10:53] watchdog.garage-view           ERROR   : FFMPEG process crashed unexpectedly for garage-view.
[2021-10-26 22:10:53] watchdog.garage-view           ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
[2021-10-26 22:10:53] watchdog.garage-view           ERROR   : You may have invalid args defined for this camera.
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : [tcp @ 0xaaaae1fe1e70] Starting connection attempt to 10.10.10.50 port 554
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : [tcp @ 0xaaaae1fe1e70] Successfully connected to 10.10.10.50 port 554
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : [rtsp @ 0xaaaae1fdf970] SDP:
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : v=0
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : o=- 1635286193794755 1635286193794755 IN IP4 10.10.10.50
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : s=Media Presentation
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : e=NONE
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : b=AS:5050
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : t=0 0
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : a=control:rtsp://10.10.10.50:554/Streaming/Channels/1/
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : m=video 0 RTP/AVP 96
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : c=IN IP4 0.0.0.0
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : b=AS:5000
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : a=recvonly
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : a=x-dimensions:3840,2160
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : a=control:rtsp://10.10.10.50:554/Streaming/Channels/1/trackID=1
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : a=rtpmap:96 H264/90000
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : a=fmtp:96 profile-level-id=420029; packetization-mode=1; sprop-parameter-sets=Z01AM42NQB4AIf/gLcBAQFAAAD6AAAnEDoYADlrAAAOThwu8uNDAActYAABycOF3lwo=,aO44gA==
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : a=Media_header:MEDIAINFO=494D4B48010300000400000100000000000000000000000000000000000000000000000000000000;
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : a=appversion:1.0
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   :
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : [rtsp @ 0xaaaae1fdf970] setting jitter buffer size to 0
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : [h264 @ 0xaaaae1fe3030] Reinit context to 3840x2160, pix_fmt: yuvj420p
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : Input #0, rtsp, from 'rtsp://*******:*********@10.10.10.50:554/Streaming/Channels/1/':
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   :   Metadata:
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   :     title           : Media Presentation
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   :   Duration: N/A, start: 1635275393.906789, bitrate: N/A
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   :     Stream #0:0: Video: h264, 1 reference frame, yuvj420p(pc, bt709, progressive, left), 3840x2160 [SAR 1:1 DAR 16:9], 20 fps, 20 tbr, 90k tbn, 40 tbc
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : [h264_mp4toannexb @ 0xaaaae1fdf680] The input looks like it is Annex B already
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : [h264_v4l2m2m @ 0xaaaae2000500] Using device /dev/video10
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : [h264_v4l2m2m @ 0xaaaae2000500] driver 'bcm2835-codec' on card 'bcm2835-codec-decode' in mplane mode
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : [h264_v4l2m2m @ 0xaaaae2000500] requesting formats: output=H264 capture=YU12
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : Stream mapping:
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   :   Stream #0:0 -> #0:0 (h264 (h264_v4l2m2m) -> rawvideo (native))
[2021-10-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : Press [q] to stop, [?] for help
[2021-10-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.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-26 22:10:53] ffmpeg.garage-view.detect      ERROR   : frame=    0 fps=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A

Config (just relevant parts)

cameras:
# ----------------------------------------------------------------------------------------------------------------
  garage-view:
    ffmpeg:
      global_args: -hide_banner -loglevel verbose
      inputs:
        # - path: rtsp://********@10.10.10.50:554/Streaming/Channels/2/ (low res stream)
        - path: rtsp://********@10.10.10.50:554/Streaming/Channels/1/
          roles:
            - detect
            - record
    best_image_timeout: 60
    motion:
      mask:
        - 640,0,640,199,499,108,428,66,427,0
rtmp:
  enabled: False

snapshots:
  retain:
    default: 14

record:
  enabled: False
  retain_days: 0
  events:
    retain:
      default: 10
    pre_capture: 5
    post_capture: 10

detect:
  # width: 3840
  # height: 2160
  width: 640
  height: 480
  fps: 5

detectors:
  coral:
    type: edgetpu
    device: usb

ffmpeg:
  hwaccel_args:
    - '-c:v'
    - h264_v4l2m2m

docker-compose

version: '3.6'
services:
  frigate:
    container_name: frigate
    restart: unless-stopped
    privileged: true
    image: blakeblackshear/frigate:0.9.4-aarch64
    devices:
      - /dev/bus/usb:/dev/bus/usb
    volumes:
      - /opt/frigate/database:/opt/database
      - /mnt/frigate/config:/config
      - /mnt/frigate/clip:/media/frigate/clips
      - /mnt/frigate/recording:/media/frigate/recordings
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 10000000000
    ports:
      - '5000:5000'
      - '1935:1935' # RTMP feeds
alevike commented 2 years ago

At this moment I'm thinking to separate frigate from HA - use Pi for HA only and buy a SH Intel NUC I5 dedicated for frigate - or just to move everything from Pi4(8GB model) to nuc. Was any HW acceleration issue reported for the other devices like NUC ?

healeydave commented 2 years ago

At this moment I'm thinking to separate frigate from HA - use Pi for HA only and buy a SH Intel NUC I5 dedicated for frigate - or just to move everything from Pi4(8GB model) to nuc. Was any HW acceleration issue reported for the other devices like NUC ?

I had been running Frigate on a 4GB Pi with Coral + HW Acceleration for several months with 4 cameras and I was happy with performance too, so I'm sure this is something that can be fixed again. Moving to better hardware might still be beneficial to you, especially if you're looking to use a lot more cameras but this issue is a recent manifestation we think with the latest HASSOS.

healeydave commented 2 years ago

Frigate doesn't use ffmpeg from Home Assistant OS. It bundles it's own and it's the same binary as the previous version. It may be that the new version of Home Assistant OS has some kernel updates that aren't compatible with the way ffmpeg was built. These things are often difficult to track down.

Hmmm, with trace, there's not a lot to see

I feared that would be the case.

I've opened a HA core case on the Home Assistant GitHub if nothing more than to hopefully discover if there have been any kernel updates specifically in 2021.10.X that could be causing these ffmpeg crashes.

neildotwilliams commented 2 years ago

Just to confirm, it didn't work for me on the previous version. I only logged it as an issue in this version as I only recently had some time to properly log it.

neildotwilliams commented 2 years ago

2 cameras, one 720p one 1080p

60% on a Rpi4 with a coral TPU

Have you masked out your on-screen camera clocks? And any other unnecessary areas, trees, clouds, bushes, tv's, etc.

blakeblackshear commented 2 years ago

@matthijsvdr I don't think this issue is your problem. The GPU on the Pi only has so much memory available. If you have already maxed out the gpu_mem, the hardware acceleration just can't handle resolutions that high. This is a known limitation.

alevike commented 2 years ago

Neil's workaround to use lower resolution detection and high resolution recording solved the issue for me, even without the hardware acceleration i was able to use 5 cameras with a load of 60-70% for the cpu... once the acceleration issue will be solved i'm expecting to have even less load - maybe i can connect the 6-th camera also...

jonandel commented 2 years ago

Agreed. Something broke for me after 18:00 (uk) time last night....I now have one camera that's green screening again...even at low detect resolutions...

Papadoma commented 2 years ago

2 cameras, one 720p one 1080p 60% on a Rpi4 with a coral TPU

Have you masked out your on-screen camera clocks? And any other unnecessary areas, trees, clouds, bushes, tv's, etc.

I have on the 1080p one that looks to the garden, but haven't on the 720p one which is in the living room. The only thing moving there is the clock, I doubt it creates any motion triggers but I will mask it out just to be sure.

Edit: No change but I noticed that during the night the CPU averaged below 40%, so either there was another process wasting resources or too many motion triggers.

deviant77 commented 2 years ago

Is HassOS based on Raspberry Pi OS/Debian by any chance? If so it could be the same kernel issue: https://github.com/blakeblackshear/frigate/issues/1882

They updated the kernel to 5.10.75 in the latest release (Home Assistant OS Release-6 build 6): https://github.com/home-assistant/operating-system/commit/a4edece7192dad13cbd8636fbf92e619820e8510

And they've just downgraded the kernel to 5.10.63: https://github.com/home-assistant/operating-system/commit/6a8b69f79302dc693671e07499cc375c71b3c234

neildotwilliams commented 2 years ago

It does seem to be based on the same kernel. https://www.home-assistant.io/blog/2021/06/11/home-assistant-os-release-6/#raspberry-pi

All Raspberry Pi versions were updated to use the Linux Kernel 5.10 from the Raspberry Pi team, just like Raspberry Pi OS. The latest Bluetooth firmware for CYW43455 (Raspberry Pi 3 B+/4) with security fixes is now part of the Raspberry Pi images.

My current HA kernel says:

uname -a

Linux homeassistant 5.10.17-v8 #1 SMP PREEMPT Tue Oct 5 01:46:25 UTC 2021 aarch64 HAOS

neildotwilliams commented 2 years ago

2 cameras, one 720p one 1080p 60% on a Rpi4 with a coral TPU

Have you masked out your on-screen camera clocks? And any other unnecessary areas, trees, clouds, bushes, tv's, etc.

I have on the 1080p one that looks to the garden, but haven't on the 720p one which is in the living room. The only thing moving there is the clock, I doubt it creates any motion triggers but I will mask it out just to be sure.

Edit: No change but I noticed that during the night the CPU averaged below 40%, so either there was another process wasting resources or too many motion triggers.

Going a bit off-topic, but is the living room camera watching the telly, or a reflection of the telly?

healeydave commented 2 years ago

Is HassOS based on Raspberry Pi OS/Debian by any chance? If so it could be the same kernel issue: #1882

They updated the kernel to 5.10.75 in the latest release (Home Assistant OS Release-6 build 6): home-assistant/operating-system@a4edece

And they've just downgraded the kernel to 5.10.63: home-assistant/operating-system@6a8b69f

I just reviewed that case (#1882) and it does look like exactly the same issue we are having here, so it appears this has been dragging on for some time. I've stopped running Frigate for the time being because I don't want my Pi's CPU battered without HW Acceleration on and I thought this would be a quick fix.

Now I don't know what to do because I don't want to be without Frigate for an indefinite period but after investing in a Coral, it seems daft to suffer high CPU because ffmpeg won't run :(

stamandr commented 2 years ago

I have been eagerly following this issue.... I am also experiencing the same problem on a RPI 4. It worked fine until I did a update/upgrade.

jonandel commented 2 years ago

mine is HW accel configured, and not giving errors in the log .. Im just not sure if its actually doing anyting, as turning it off, makes minimal (if any) difference from when I turn it off. RPi 4 2G Hassos 64 bit.

healeydave commented 2 years ago

@blakeblackshear What with this issue and issue #1882, it seems there is a a whole bunch of Rpi 4 users crippled by the newer kernel and ffmpeg incompatibility. I guess we've figured out its not really a Frigate issue, it just affects Rpi / Frigate users because of the ffmpeg dependancy but I'm not sure how to proceed. Should we be escalating this issue to ffmpeg developers, linux kernel developers, hass developers? I'm kinda out of my depth now and need advice from those way more intelligent than me :)

neildotwilliams commented 2 years ago

Had a bit of time spare today so I flashed MotionEyeOS on to a Raspberry Pi ZeroW, this gave me an RTSP stream. I added this to Frigate. This works WITH and without hardware acceleration. So I am now wondering if the hardware accel is sensitive to what it receives :-(

Here's the snippit of my Frigate config:

Test MotionEyeOS Camera

test_camera: ffmpeg: global_args: -hide_banner -loglevel info hwaccel_args:

blakeblackshear commented 2 years ago

I haven't had time to reproduce and troubleshoot this myself yet. I don't normally run HassOS, so I need to flash one of my Pi4s to reproduce it and try to come up with a fix.

healeydave commented 2 years ago

So I am now wondering if the hardware accel is sensitive to what it receives :-(

If your still using the same Frigate build as before and the only difference is you've managed to get a new camera source that works with hw accel turned on without any errors, then I guess you're right but I think the main issue is most of us haven't changed our camera setup since it last worked flawlessly. I think this flaky ffmpeg / kernel issue needs to be fixed rather than to start tinkering with my Hikvision setup (which is already providing an rtsp stream that was previously suitable).

healeydave commented 2 years ago

mine is HW accel configured, and not giving errors in the log .. Im just not sure if its actually doing anyting, as turning it off, makes minimal (if any) difference from when I turn it off. RPi 4 2G Hassos 64 bit.

It should make a difference, with HW Accel on, my setup used to hover around 20-25% with 4 cameras, now without HW Accel turned on (because I can't since the updates), CPU hovers 60%+ with just 1 camera in my current config.

neildotwilliams commented 2 years ago

I haven't had time to reproduce and troubleshoot this myself yet. I don't normally run HassOS, so I need to flash one of my Pi4s to reproduce it and try to come up with a fix.

If I can provide any more info to help, please let me know.

stamandr commented 2 years ago

Following further testing, I can confirm on my end that ffmpeg: hwaccel_args: -c:v h264_v4l2m2m

works on my RPI 4 4gb by rolling back the kernel from: Linux raspberrypi 5.10.63-v8+ #1459 SMP PREEMPT Wed Oct 6 16:42:49 BST 2021 aarch64 GNU/Linux to : Linux raspberrypi 5.10.60-v8+ #1448 SMP PREEMPT Sat Aug 21 10:48:18 BST 2021 aarch64 GNU/Linux

uname -a sudo rpi-update fb7c402191aa56c8982982b8f31a0bb41743bea1 sudo reboot

mitchross commented 2 years ago

I am in this same boat, minus hassos. I am just running native frigate UI on RPI4 + USB Coral temporarily as my server CPU fried. I tried enabling HW accel for RPI4 and it fails with similar issues. Not sure @blakeblackshear how much you are going to debug this with a Rpi4, but if you end up going down deep end with Rpi4 , I can post some configs/logs if you want.

Without HW Accel flags, it works fine, but the video stream is slow/laggy (as expected), so I figured id try HW Accel but running into similar issues in this thread.

healeydave commented 2 years ago

Following further testing, I can confirm on my end that ffmpeg: hwaccel_args: -c:v h264_v4l2m2m

works on my RPI 4 4gb by rolling back the kernel from: Linux raspberrypi 5.10.63-v8+ #1459 SMP PREEMPT Wed Oct 6 16:42:49 BST 2021 aarch64 GNU/Linux to : Linux raspberrypi 5.10.60-v8+ #1448 SMP PREEMPT Sat Aug 21 10:48:18 BST 2021 aarch64 GNU/Linux

uname -a sudo rpi-update fb7c402191aa56c8982982b8f31a0bb41743bea1 sudo reboot

What versions of HASSOS and Frigate are you on?

I was going to try that yesterday but I couldn't ssh into my pi, I think upgrading to OS 6.5 the other day must have wiped out my public key. I will have to re-instate and I might downgrade the kernel tonight. I'm assuming every HA update will upgrade it again though.

stamandr commented 2 years ago

Frigate NVR (Full Access) 2.3 core-2021.10.6 supervisor-2021.10.8 Docker version 20.10.10

healeydave commented 2 years ago

sudo rpi-update fb7c402191aa56c8982982b8f31a0bb41743bea1

Can you do this on HASSOS?

I'm getting: rpi-update: command not found

stamandr commented 2 years ago

No.. This is on RaspiOS ( Debian Buster )

https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2021-05-28/

blackjack75 commented 2 years ago

Thanks @stamandr reverting to the previous kernel as you indicated DID fix it for me. Your message was very helpful because I installed it for the first time today and couldn't understand what I was doing wrong. :-)

S-Przybylski commented 2 years ago

Thanks @stamandr - thanks for the hint - today installed Raspi os 64 bit. And with your recommendation it worked!

jdohn15 commented 2 years ago

I am having this same issue, but using home assistant os on raspberry pi 4.

mantaalex commented 2 years ago

I am having this same issue, but using home assistant os on raspberry pi 4.

if it could help you i was on HA OS 6.6 when i had some troubles to do in terminal or ssh: ha os update --version 6.5 if your allready on 6.6 to Maybe it helps your problem let me know Grz

healeydave commented 2 years ago

I am having this same issue, but using home assistant os on raspberry pi 4.

if it could help you i was on HA OS 6.6 when i had some troubles to do in terminal or ssh: ha os update --version 6.5 if your allready on 6.6 to Maybe it helps your problem let me know Grz

I'm pretty sure I only recently updated the OS to 6.6 and I think I was having the problem when I was on HA OS 6.5 too, so I'm not sure going down to 6.5 will be far enough. If its ok to downgrade the OS further whilst being on core-2021.11.2 without any issues, then I'm happy to give it a go.

mantaalex commented 2 years ago

I am having this same issue, but using home assistant os on raspberry pi 4.

if it could help you i was on HA OS 6.6 when i had some troubles to do in terminal or ssh: ha os update --version 6.5 if your allready on 6.6 to Maybe it helps your problem let me know Grz

I'm pretty sure I only recently updated the OS to 6.6 and I think I was having the problem when I was on HA OS 6.5 too, so I'm not sure going down to 6.5 will be far enough. If its ok to downgrade the OS further whilst being on core-2021.11.2 without any issues, then I'm happy to give it a go.

After i did that command i run on 6.5 with latest ha ...

healeydave commented 2 years ago

Following further testing, I can confirm on my end that ffmpeg: hwaccel_args: -c:v h264_v4l2m2m

works on my RPI 4 4gb by rolling back the kernel from: Linux raspberrypi 5.10.63-v8+ #1459 SMP PREEMPT Wed Oct 6 16:42:49 BST 2021 aarch64 GNU/Linux to : Linux raspberrypi 5.10.60-v8+ #1448 SMP PREEMPT Sat Aug 21 10:48:18 BST 2021 aarch64 GNU/Linux

uname -a sudo rpi-update fb7c402191aa56c8982982b8f31a0bb41743bea1 sudo reboot

So I have a support issue open with Home Assistant regarding this issue as downgrading the kernel using these commands is not possible in HAOS.

The response I got back was and I quote, "HAOS 6.6 is using 5.10.17, so a bit older kernel even".

Which is confusing since Debian users are reporting success downgrading the kernel back to 5.10.60 !?!?

tonitonae commented 2 years ago

Following further testing, I can confirm on my end that ffmpeg: hwaccel_args: -c:v h264_v4l2m2m

works on my RPI 4 4gb by rolling back the kernel from: Linux raspberrypi 5.10.63-v8+ #1459 SMP PREEMPT Wed Oct 6 16:42:49 BST 2021 aarch64 GNU/Linux to : Linux raspberrypi 5.10.60-v8+ #1448 SMP PREEMPT Sat Aug 21 10:48:18 BST 2021 aarch64 GNU/Linux

uname -a sudo rpi-update fb7c402191aa56c8982982b8f31a0bb41743bea1 sudo reboot

I have tested your solution, but no joy on my side. I am on DietPi distro, but kernel is vanilla. Just installed the rpi-update command and run it.

> uname -a
Linux DietPi 5.10.60-v8+ #1448 SMP PREEMPT Sat Aug 21 10:48:18 BST 2021 aarch64 GNU/Linux

My config file:

mqtt:
  host: <ip mqtt>
  port: 1883
  user: <user>
  password: <pass>
  topic_prefix: frigate
  client_id: frigate
  stats_interval: 60

detectors:
  coral:
    type: edgetpu
    device: usb

cameras:
  yi_outdoor:
    ffmpeg:
      inputs:
        - path: rtsp://x.x.x.x/xyz
          roles:
            - detect
            - rtmp
      hwaccel_args: -c:v h264_v4l2m2m
    detect:
      enabled: False
      width:  1920
      height: 1080

It is just the hardware acceleration that does not work. Commenting that line, it works. Any clues?

Thanks!

blackjack75 commented 2 years ago

@tonitonae Note that reverting the kernel to 5.6.10 worked for me on my 32bit install. I still had issues with accelerating more than 6 feeds (960x480). It worked stable with 6 feeds using hardware acceleration and 2 using software decompression (pushing the overlocked RPI to its limits).

I then switched this to the definitely host. another RPI4 but with a fresh 64 bit install in a good case and a m2 SATA SSD. Sadly switching to 64 bits instead of fixing my issue with hardware accelerated video decoding it made it much worse. Now I can only get two stable feeds with hardware acceleration. Anything more and I get green video feeds and console messages about memory allocation (GPU mem being at 896mb isn't the issue). So right now I use 6 feeds , of which two have hardware decoding and all the rest is done in software.

I suspect this has something to do with the building options of ffmpeg in docker image but I didn't went as far as trying compiling my own with other options (I have zero experience with that).