Local realtime person detection for RTSP cameras

This will probably help: https://github.com/blakeblackshear/frigate/discussions/406

Thanks again, I will have look, certainly looks promising

Made the same changes, no luck, still filling the logs up with errors. Frigate is running on a Pi4 kubenertes cluster with node affinity to the node with the USB Coral TPU, not sure if that matters here or not (it does see the TPU when it starts.)

Hello all.

I too wish to get away from Zoneminder. It works ok. But its so clucky to work with and it has so many extra bits you have to code to get working as it should. Not happy with it in its current state. But really can’t complain. It is free open source after all.

I have been looking at this for the last few days. And I have been going round the bend. My google fu has failed me.

I have never been able to work well with docker. I am just not a programming type guy. Alas, I am a one of them folks that need to have their hand held for them.

Has anybody seen or know of a “For Dummy’s install” copy paste into Ubuntu command line install tutorial?

I am running a 18.04 LTS of Ubuntu as a virtual machine on a UnRAID system. Yes I understand that virtual machines are not the best way. But I am unwilling to put my core UnRAID data at risk. Please don’t shoot me for it.

I have already followed the pages from coral.AI website for getting a Edge TPU working on my system.

I get good working results.

peter@aitpuodd:~/coral/pycoral$ python3 examples/classify_image.py --model test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite --labels test_data/inat_bird_labels.txt --input test_data/parrot.jpg----INFERENCE TIME----
Note: The first inference on Edge TPU is slow because it includes loading the model into Edge TPU memory.
15.2ms
2.7ms
2.7ms
2.7ms
2.9ms
-------RESULTS--------
Ara macao (Scarlet Macaw): 0.75781

So I just need a good easy to copy paste style tutorial for Home Assistant with Frigate. I really do hope somebody can help.

Thanks for taking the time to read.

Oddsodz

Try adding

global_args: -hide_banner -loglevel info

to the ffmpeg section and

logger:
  default: debug

to the logger section of your frigate config file. That should cause ffmpeg to show you the exact reason for the errors.

1 Like

Ok, unless I didn’t add them correctly, I redeployed the pod, but not sure I’m seeing what I expected:

ffmpeg.middle_driveway.clips_record ERROR   : [segment @ 0xaaaafaa4d630] Opening '/tmp/cache/middle_driveway-20210218190603.mp4' for writing
ffmpeg.middle_driveway.clips_record ERROR   : frame=  563 fps= 26 q=-1.0 size=N/A time=00:00:22.35 bitrate=N/A speed=1.04x    
ffmpeg.middle_driveway.clips_record ERROR   : frame=  576 fps= 26 q=-1.0 size=N/A time=00:00:22.87 bitrate=N/A speed=1.03x    
ffmpeg.middle_driveway.clips_record ERROR   : frame=  589 fps= 26 q=-1.0 size=N/A time=00:00:23.39 bitrate=N/A speed=1.03x    
ffmpeg.middle_driveway.clips_record ERROR   : frame=  601 fps= 26 q=-1.0 size=N/A time=00:00:23.90 bitrate=N/A speed=1.03x    
frigate.video                  INFO    : middle_driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : middle_driveway: ffmpeg process is not running. exiting capture thread...
ffmpeg.middle_driveway.clips_record ERROR   : frame=  615 fps= 26 q=-1.0 size=N/A time=00:00:24.44 bitrate=N/A speed=1.03x    
ffmpeg.middle_driveway.clips_record ERROR   : frame=  628 fps= 26 q=-1.0 size=N/A time=00:00:24.96 bitrate=N/A speed=1.03x    
ffmpeg.middle_driveway.clips_record ERROR   : frame=  641 fps= 26 q=-1.0 size=N/A time=00:00:25.48 bitrate=N/A speed=1.03x    
ffmpeg.middle_driveway.clips_record ERROR   : frame=  652 fps= 26 q=-1.0 size=N/A time=00:00:26.06 bitrate=N/A speed=1.03x    
ffmpeg.middle_driveway.clips_record ERROR   : frame=  669 fps= 26 q=-1.0 size=N/A time=00:00:26.60 bitrate=N/A speed=1.03x    
ffmpeg.middle_driveway.clips_record ERROR   : frame=  682 fps= 26 q=-1.0 size=N/A time=00:00:27.11 bitrate=N/A speed=1.03x    

Thank you!

Did you set up the global_args in the head ffmpeg section of the file, not under a camera or role?

Got distracted by work, good point, let me take a look. Thanks!

Looking like a networking issue maybe?

ffmpeg.middle_driveway.detect  ERROR   : frame=  185 fps=5.7 q=-1.0 q=-0.0 size=    1313kB time=00:00:36.80 bitrate= 292.3kbits/s dup=1 drop=0 speed=1.14x    
ffmpeg.middle_driveway.detect  ERROR   : [NULL @ 0xaaaada934c20] missing picture in access unit with size 20
ffmpeg.middle_driveway.detect  ERROR   : [h264 @ 0xaaaadaaf9e10] no frame!
watchdog.middle_driveway       INFO    : Terminating the existing ffmpeg process...
watchdog.middle_driveway       INFO    : Waiting for ffmpeg to exit gracefully...
ffmpeg.middle_driveway.detect  ERROR   : frame=  187 fps=4.9 q=-1.0 q=-0.0 size=    1315kB time=00:00:37.20 bitrate= 289.5kbits/s dup=1 drop=0 speed=0.981x    
ffmpeg.middle_driveway.detect  ERROR   : frame=  187 fps=4.3 q=-1.0 q=-0.0 size=    1315kB time=00:00:37.20 bitrate= 289.5kbits/s dup=1 drop=0 speed=0.864x    
ffmpeg.middle_driveway.detect  ERROR   : frame=  187 fps=3.9 q=-1.0 q=-0.0 size=    1315kB time=00:00:37.40 bitrate= 288.0kbits/s dup=1 drop=0 speed=0.777x    
ffmpeg.middle_driveway.detect  ERROR   : Error while decoding stream #0:0: Invalid data found when processing input
ffmpeg.middle_driveway.detect  ERROR   : frame=  187 fps=3.5 q=-1.0 q=-0.0 size=    1315kB time=00:00:37.40 bitrate= 288.0kbits/s dup=1 drop=0 speed=0.702x    
ffmpeg.middle_driveway.detect  ERROR   : frame=  187 fps=3.2 q=-1.0 q=-0.0 size=    1315kB time=00:00:37.40 bitrate= 288.0kbits/s dup=1 drop=0 speed=0.64x    
ffmpeg.middle_driveway.detect  ERROR   : frame=  187 fps=2.9 q=-1.0 q=-0.0 size=    1315kB time=00:00:37.40 bitrate= 288.0kbits/s dup=1 drop=0 speed=0.589x    
ffmpeg.middle_driveway.detect  ERROR   : [flv @ 0xaaaada943560] Failed to update header with correct duration.
ffmpeg.middle_driveway.detect  ERROR   : [flv @ 0xaaaada943560] Failed to update header with correct filesize.
ffmpeg.middle_driveway.detect  ERROR   : frame=  187 fps=2.9 q=-1.0 Lq=-0.0 size=    1315kB time=00:00:37.40 bitrate= 288.0kbits/s dup=1 drop=0 speed=0.589x    
ffmpeg.middle_driveway.detect  ERROR   : video:93876kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
frigate.video                  INFO    : middle_driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : middle_driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : middle_driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : middle_driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : middle_driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : middle_driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : middle_driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : middle_driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : middle_driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : middle_driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : middle_driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : middle_driveway: ffmpeg process is not running. exiting capture thread...

Try swapping your width height values in your config for that camera

1 Like

Same issue, just redeployed with it swapped:

ffmpeg.middle_driveway.detect  ERROR   : frame=  152 fps=5.9 q=-1.0 q=-0.0 size=    1150kB time=00:00:30.20 bitrate= 311.9kbits/s speed=1.17x    
ffmpeg.middle_driveway.detect  ERROR   : [NULL @ 0xaaab0b599c20] missing picture in access unit with size 20
ffmpeg.middle_driveway.detect  ERROR   : [h264 @ 0xaaab0b6c3000] no frame!
ffmpeg.middle_driveway.detect  ERROR   : frame=  154 fps=4.9 q=-1.0 q=-0.0 size=    1152kB time=00:00:30.60 bitrate= 308.4kbits/s speed=0.977x    
watchdog.middle_driveway       INFO    : Terminating the existing ffmpeg process...
watchdog.middle_driveway       INFO    : Waiting for ffmpeg to exit gracefully...
ffmpeg.middle_driveway.detect  ERROR   : frame=  154 fps=4.2 q=-1.0 q=-0.0 size=    1152kB time=00:00:30.60 bitrate= 308.4kbits/s speed=0.84x    
ffmpeg.middle_driveway.detect  ERROR   : frame=  154 fps=3.7 q=-1.0 q=-0.0 size=    1152kB time=00:00:30.60 bitrate= 308.4kbits/s speed=0.736x    
ffmpeg.middle_driveway.detect  ERROR   : Error while decoding stream #0:0: Invalid data found when processing input
ffmpeg.middle_driveway.detect  ERROR   : frame=  154 fps=3.3 q=-1.0 q=-0.0 size=    1152kB time=00:00:30.60 bitrate= 308.4kbits/s speed=0.655x    
ffmpeg.middle_driveway.detect  ERROR   : frame=  154 fps=3.0 q=-1.0 q=-0.0 size=    1152kB time=00:00:30.60 bitrate= 308.4kbits/s speed=0.591x    
ffmpeg.middle_driveway.detect  ERROR   : frame=  154 fps=2.7 q=-1.0 q=-0.0 size=    1152kB time=00:00:30.60 bitrate= 308.4kbits/s speed=0.538x    
ffmpeg.middle_driveway.detect  ERROR   : [flv @ 0xaaab0b5a8560] Failed to update header with correct duration.
ffmpeg.middle_driveway.detect  ERROR   : [flv @ 0xaaab0b5a8560] Failed to update header with correct filesize.
ffmpeg.middle_driveway.detect  ERROR   : frame=  154 fps=2.7 q=-1.0 Lq=-0.0 size=    1152kB time=00:00:30.60 bitrate= 308.4kbits/s speed=0.538x    
ffmpeg.middle_driveway.detect  ERROR   : video:76884kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
frigate.video                  INFO    : middle_driveway: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video                  INFO    : middle_driveway: ffmpeg process is not running. exiting capture thread...

I’ve tried reading back over your comments. I can’t see that you tried the same URL in VLC and checked media codec information to confirm

1 the stream url works
2 the actual w & h for that stream

I will check it out, I can stream in vlc, but haven’t checked codec info. Thank you for the help!

Think it’s in Tools > Media Info >codec tab

Maybe networking. Or something with kubernetes? It’s receiving a couple hundred frames before it dies, it seems.

So I am starting to wonder… So when I initially set this up, I had this isolated to it’s own switch only connected to my DVR running bluecherry as didn’t want anything having access to the camera except the DVR. I later added routing on that box to allow the rest of the network access to it only, but starting to wonder if that’s not working properly. Now that I know what I am seeing is not normal, let me see about moving that off there and to it’s own segment off my firewall instead. Thank you guys for all the help and ideas, I’ll report whatever I find.

@hawkeye217 @konradwalsh Thank you guys for the help today, it was a networking issue. Something on the Linux box wasn’t routing properly obviously, as even though looked like it was working. I moved the CCTV lan over to my firewall and set up the routing through there, and no more errors. Sorry to waste your time today.

2 Likes

Any instructions on enabling hardware acceleration?
Get an error No device available for decoder: device type vaapi needed for

Question for people using Frigate add-on HassOS on Raspberry Pi 4 and Coral USB. What’s the average detection fps you get?