Local realtime person detection for RTSP cameras

I didn’t see much of an improvement on my machine either, but it would fail if it wasn’t using the GPU. My CPU supports both drivers, and I do see substantially lower CPU usage with the other driver. I was hoping you would see better results. I’m not sure what else to try, but feel free to open an issue on GH and I can look into it further in the future.

No improvement when using hardware acceleration? is it due to CPU too powerful or GPU driver not fully utilizing the hardware?

1 Like

I’m not sure. There are 2 drivers for VAAPI, iHD and i965. The 10th Gen processors require the iHD driver. I see big improvement with the i965 driver, but only a 20% improvement with the iHD driver. I’m sure there is something else to it, but it’s going to take some digging.

I’m trying to upgrade to 7. I started fresh with the config.yml from the github and tweaked it for my needs but I get this error. This is a fresh docker pull so it should be 7.2 on a nuc (stable-amd64)

As a test I copied the example config exactly and made no changes and get the same error.

sudo docker-compose up  
Creating network "frigate-7_default" with the default driver
Creating frigate-7 ... done
Attaching to frigate-7
frigate-7  | Fontconfig error: Cannot load default config file
frigate-7  | On connect called
frigate-7  | Traceback (most recent call last):
frigate-7  |   File "detect_objects.py", line 440, in <module>
frigate-7  | Starting detection process: 19
frigate-7  |     main()
frigate-7  |   File "detect_objects.py", line 202, in main
frigate-7  |     ffmpeg_output_args = ["-r", str(config.get('fps'))] + ffmpeg_output_args
frigate-7  | TypeError: can only concatenate list (not "NoneType") to list

I tried to comment out a few things to see what identified as not a list but cannot get past this.

Can you post your config?

blakeblackshear,

FYI the Hassio addon Info page has a link for " Configuration Reference" that is invalid.

https://github.com/blakeblackshear/frigate/blob/b6f7940b10e72f252332fc097d78cd854ef556ec/config/config.example.yml

Loving the addon and just want to also say thank you! :slight_smile:

1 Like

I am running a HASSOS VM on a Unraid server With Xeon X5675 processors (Westmere) The page your Frigate links to https://trac.ffmpeg.org/wiki/Hardware/QuickSync does not list Westmere

I have several Reolink RLC-420-5MP, when I have tried these in Zoneminder and motioneye using RTSP I used to get smearing of the image, from reading a lot of posts I was advised to use RTMP instead.

RTSP I was using was rtsp://auser:[email protected]:554/h264Preview_01_sub

2 options for RTMP, I don’t notice a difference but if someone knows please let me know?

rtmp://192.168.1.117/bcs/channel0_main.bcs?token=254&channel=0&stream=0&user=aUser&password=aPassword

rtmp://192.168.1.117/bcs/channel0_main.bcs?channel=0&stream=0&user=aUser&password=aPassword

I’m struggling to understand how to set up or if I need/should change the ffmpeg ‘input_args:’ to improve performance?

( I have ordered a Coral PCI card but I’m waiting delivery ) Once I have installed it and changed the ‘detectors:’ do these ‘input_args:’ stay the same?

cameras:
  garage:
    take_frame: 1
    fps: 5
    snapshots:
      show_timestamp: true
    ffmpeg:
      input: >-
        rtmp://192.168.1.121/bcs/channel0_main.bcs?channel=0&stream=0&user=aUser&password=aPassword
      input_args:
        - '-avoid_negative_ts'
        - make_zero
        - '-fflags'
        - nobuffer
        - '-flags'
        - low_delay
        - '-strict'
        - experimental
        - '-fflags'
        - +genpts+discardcorrupt
        - '-vsync'
        - drop
        - '-use_wallclock_as_timestamps'
        - '1'

Appreciate any help or advice given! thanks :slight_smile:

Edit, just found this https://github.com/blakeblackshear/frigate/blob/3ff98770c11f7a38e40db2351bb692e54066c7bf/docs/cameras.md

and removed

        - '-vsync'
        - drop

Should removing them improve performance? Thanks

It doesn’t look like your CPU supports QuickSync, so you won’t get any better performance for decoding the video from ffmpeg without lowering the frame rate or resolution on your camera. The Coral provides hardware acceleration for running detections, not decoding the video. The input_args are for ffmpeg and have nothing to do with the Coral, so nothing about your input parameters will change.

1 Like

Here ya go.

At first I took the github config and did all my adjustments. When I couldn’t get past the error I started over and tried to keep the config as default as possible thinking it should at least start w/ basic adjustments. All I did was paste the config from the github docs and change the mqtt host, camera input, and comment out the mqtt username/pass.

https://paste.ubuntu.com/p/vR5BCWvbMg/

I will further tune (turning on hw accel, remove poly mask, change names, etc) once I get this working

Thanks!

I see the problem.


Comment out or remove the optional ffmpeg params at the camera level if you aren’t using them. I was worried that would be confusing. I will see if I can find a better way to handle them.

argh! i never tired that, I was too focused on the global declaration of them.

sorry and thanks!

Hello,

For some reason since .70 best.jpg no longer is showing boxes of detection. Is there a way to add them back in?

1 Like

Not in the current version. I will be adding that back in the future.

In my excitement to do this I made a mistake and bought the MINI pcie Coral card https://www.mouser.co.uk/ProductDetail/Google/G650-04528-01?qs=XeJtXLiO41RDsI9w8m%2Bkgg%3D%3D&gclid=Cj0KCQjw59n8BRD2ARIsAAmgPmLnWjh1emR9NJHSbR7O9HkiA86c4e_-ZAqTwcNuGmZ0oHssdEC_T6IaAoVHEALw_wcB

Anyone know of a good MINI pcie to pci adapter for my Dell R710 so I can still get it to work?

Any Amazon UK links would be appreciated! Thank you

I think this is suitable but I would like a sanity check please https://www.amazon.co.uk/gp/product/B07MCCRRMP/ref=ox_sc_act_title_1?smid=A59LVFM0R7G3S&psc=1

This is looking great. I know its new and you probably have some big things planned. I wanted to mention two things to get your thoughts.

I think the NVR feature can replace my need for motioneye (triggered when frigate sees motion). There are two gaps I see right now.

  • For the NVR side of things general file management.
  1. have you thought about a max age of saved clips?
  2. Adjusting the naming of files for human readable dates
  3. Folder structure for organization by something (camera/zone/date/etc)
  • And a record X more seconds after motion even stops.
1 Like

Has anyone got Frigate working on a Coral Dev Board? I’ve tried to search the 2,255 posts on this thread and have found it mentioned but no-one actually running it.

I’m starting Frigate with

docker run --rm --name frigate --privileged \
-v /dev/bus/usb:/dev/bus/usb \
-v /home/mendel/frigate:/config:ro \
-v /etc/localtime:/etc/localtime:ro \
-p 5000:5000 \
-e FRIGATE_RTSP_PASSWORD='password' \
blakeblackshear/frigate:stable-armv7

And I’ve set the detector to pci in my config file. It starts up OK

On connect called
ffprobe -v panic -show_error -show_streams -of json "rtsp://192.168.1.6:7447/lIRVfkMALJNwaNXv"
Starting detection process: 18
Attempting to load TPU as pci
TPU found

But then I just get this in a loop

Creating ffmpeg process...
ffmpeg -hide_banner -loglevel panic -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://192.168.1.6:7447/lIRVfkMALJNwaNXv -r 5 -f rawvideo -pix_fmt yuv420p pipe:
No frames received from right in 5 seconds. Exiting ffmpeg...
Waiting for ffmpeg to exit gracefully...
right: ffmpeg sent a broken frame. something is wrong.
right: ffmpeg sent a broken frame. something is wrong.
right: ffmpeg sent a broken frame. something is wrong.
right: ffmpeg sent a broken frame. something is wrong.
right: ffmpeg sent a broken frame. something is wrong.
right: ffmpeg sent a broken frame. something is wrong.
right: ffmpeg sent a broken frame. something is wrong.
right: ffmpeg sent a broken frame. something is wrong.
right: ffmpeg sent a broken frame. something is wrong.
right: ffmpeg sent a broken frame. something is wrong.
right: ffmpeg process is not running. exiting capture thread...

So it would appear there’s some sort of problem running ffmpeg - I worked that much out for myself - but I’ve been unable to find out exactly why it’s dying.

If anyone has got Frigate working on a Dev Board could you let me know what I have to tweak? Just to address the obvious question - the same config file works fine on a Linux box with a USB accelerator so there’s definitely a stream from the camera.

Try turning on the ffmpeg logs to see why ffmpeg fails. Take a look at the bottom of the Readme for an example.

Yep. All of that and more is in the works.

2 Likes

hi,

i can see there is 10% higher cpu usage under the same config from 0.7.0 to 0.7.3. Any idea?

awesome. The new HA media browser feature is awesome and was one other big reason I could leave motion eye. I have mine pointing to the clips now, very nice.