Closed neildotwilliams closed 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.
@Papadoma probably means you don't have the full access addon installed.
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.
FYI: I've updated to Frigate 2.3 today as well as HA Supervisor 10.6 but still green screen with hwaccel enabled.
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://
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://
video:61kB audio:192kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (rtsp://
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://
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://
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.
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
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.
Yeah, I'm not running Frigate until we can get to the bottom of this, I don't want a dead Rpi either.
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.
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.
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 .
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.
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?
2 cameras, one 720p one 1080p 60% on a Rpi4 with a coral TPU
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
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 ?
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.
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.
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.
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.
@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.
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...
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...
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.
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
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:
Linux homeassistant 5.10.17-v8 #1 SMP PREEMPT Tue Oct 5 01:46:25 UTC 2021 aarch64 HAOS
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?
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 :(
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.
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.
@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 :)
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_camera: ffmpeg: global_args: -hide_banner -loglevel info hwaccel_args:
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.
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).
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.
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.
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 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.
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.
Frigate NVR (Full Access) 2.3 core-2021.10.6 supervisor-2021.10.8 Docker version 20.10.10
sudo rpi-update fb7c402191aa56c8982982b8f31a0bb41743bea1
Can you do this on HASSOS?
I'm getting: rpi-update: command not found
No.. This is on RaspiOS ( Debian Buster )
https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2021-05-28/
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. :-)
Thanks @stamandr - thanks for the hint - today installed Raspi os 64 bit. And with your recommendation it worked!
I am having this same issue, but using home assistant os on raspberry pi 4.
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 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.
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 ...
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 !?!?
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!
@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).
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
Relevant log output
FFprobe output from your camera
Frigate stats
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