Local realtime person detection for RTSP cameras

Yes, frigate is running as an unraid docker container, where the images/clips are saved.
HA is running on a raspi4.

The question is, if there is some kind of wrapper, to show the media-browser content which come from frigate, in a gallery card.

1 Like

Anyone running frigate in docker on Windows?

Iā€™m successfully running frigate 0.7 for couple of month actually with absolutely minimum configuration needed to run. It proved to be reliable after I solved all issues related to my Dahua cam streams. Now I want to move to latest version and use available features to make my setup even better :slight_smile:

The point is Iā€™m running it on a server with not HW acceleration and USB 2.0 meaning that each camera needs own CPU Core. Meaning I needed to dedicate 7 with at least more 2 to come. At the same time I need to get machine with Windows running 24/7 and I was wondering if I could use it for frigate with coral without need of getting another specifically for frigate? I now it would be better to use purely linux, but if it could use HW accel + coral and work lets say on two cores, that would be perfect.

I want to record clips of an object but not get notifications, how can I do that with your code?

I changed the last action to open a specific part of the HA app:

            - action: URI
              title: View Cameras
              uri: '/lovelace-security/cameras'

Is there a way to run frigate on a window10? I had it as an add-on to my Hassio VM install but it eats up all my storageā€¦

I was thinking of running it on my windows10 where I have BlueIris installed. Was going to have a Coral mini pcie installed on there.

You donā€™t want to get notifications from where? HA? Just donā€™t include that camera label in your automation.yml which provides all the notification automation settings.

Yeah Iā€™ve started using the automation that @mate provided as it covers all cameras with a template but I donā€™t know how to exclude a specific object from a specific camera with it.

I was hoping I could just put objects: in the MQTT camera config to only publish messages for filtered objects but thatā€™s not supported.

Yeah you just need to specify the camera you want. Here is an example from his docs that contains three conditions before an action is triggered. You can use as many (or as few) conditions as you want. You definitely need to use the camera condition so you will only get notifications on the cameras you want and can ignore the ones you donā€™t.

- alias: Notify for dogs in the front with a high top score
  trigger:
    platform: mqtt
    topic: frigate/events
  condition:
    - "{{ trigger.payload_json['after']['label'] == 'dog' }}"
    - "{{ trigger.payload_json['after']['camera'] == 'front' }}"
    - "{{ trigger.payload_json['after']['top_score'] > 0.98 }}"
  action:
    - service: notify.mobile_app_pixel_3
      data_template:
        message: 'High confidence dog detection.'
        data:
          image: "https://url.com/api/frigate/notifications/{{trigger.payload_json['after']['id']}}/thumbnail.jpg"
          tag: "{{trigger.payload_json['after']['id']}}"
2 Likes

runs totally fine on docker for windows 10 using wsl2.

Yes i got it working but still in the early stages (Iā€™m new to docker). Had issues figuring out the directories to use under volumes. Now i canā€™t figure out how to find the IP for the GUI interface :slight_smile:

Need to also add the pcie coral afterwardsā€¦

Once step at a timeā€¦

the ip from local docker must be something like
127.0.0.1:5000

this settings worked for me with google coral

    devices:
      - /dev/bus/usb:/dev/bus/usb
1 Like

So pcie falls under usb? got the GUI to show up. Now looking into push notificationsā€¦I donā€™t have the coral pcie yet (just ordered it) but it will most definetly need to put into action since my cpu/ram are hitting 80+% :slight_smile:

Can you please share more details about your setup?

  1. What hardware you are running it on?
  2. Do you have coral?
  3. How many cams and what resolution?
  4. What is an average load?

Anyone running a docker in win10, how did you get the ffmpeg to work in docker? I have an intel i7 so I used this:

ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p

but whenever I add this it makes my videos go green.

the screenshot above was from last night. I tested custom created models with face recognition. And there was not a real camera pluged in. For testing porpuse i faked a local rtsp server which plays a video i created from people images from the front cam. So i cant tell you a lot about load on my windows 10 pc.

But i can track the load on my unraid server with running shinobi for face recoccnition and frigate for everything else.
Here are some screens from the last 14 days. The high cpu load from frigate may be missleading. Im running a dashboard here with the live view from the debug cam, which produce a lot more cpu load as normally.

I have only one rtsp cam. The 640px stream for detection stuff and the 4k stream for recording.
Running on
AMD Ryzen 7 3700X 8-Core @ 3600 MHz, 64gb ram,
Unraid Nvidia Version: 6.8.3
Shinobi use the Nvidia RTX2060 for encoding, Frigate a Coral USB Stick

Really excited to try this out but having trouble at the first step. Trying to install the add on and get the following error -

1-03-03 21:16:46 ERROR (MainThread) [supervisor.jobs] Unhandled exception: 'NoneType' object has no attribute 'is_file'
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 100, in wrapper
    return await self._method(*args, **kwargs)
  File "/usr/src/supervisor/supervisor/addons/__init__.py", line 182, in install
    await addon.instance.install(store.version, store.image)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 32, in wrap_api
    return await method(api, *args, **kwargs)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 491, in _install
    self._build(version)
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 500, in _build
    build_env = AddonBuild(self.coresys, self.addon)
  File "/usr/src/supervisor/supervisor/addons/build.py", line 32, in __init__
    super().__init__(
  File "/usr/src/supervisor/supervisor/utils/common.py", line 59, in __init__
    self.read_data()
  File "/usr/src/supervisor/supervisor/utils/common.py", line 72, in read_data
    if self._file.is_file():
AttributeError: 'NoneType' object has no attribute 'is_file'

Anyone come across this before?

This is my docker-compose file:

version: '3.9'
services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: blakeblackshear/frigate:stable-amd64
    devices:
      - /dev/bus/usb:/dev/bus/usb
      - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
    volumes:
      - /dev/bus/usb:/dev/bus/usb
      - /etc/localtime:/etc/localtime:ro
      - ./frigate/config:/config
      - ./frigate/clips:/media/frigate/clips
      - /storage01/frigate/recordings:/media/frigate/recordings
      - type: tmpfs
        target: /tmp/cache
        tmpfs:
          size: '1g'
    ports:
      - '5000:5000'
      - '1935:1935' # RTMP feeds
    environment:
      FRIGATE_RTSP_PASSWORD: 'password'
    depends_on:
      - ffmpeg
  ffmpeg:
    image: jrottenberg/ffmpeg:3.3

But I canā€™t get the ffmpeg to workā€¦
Getting: ffmpeg process is not running

How do I make ffmpeg work in win10 docker?

Under cli it seems as if ffmpeg is there:

# ffmpeg
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-libmfx --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-vaapi --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
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

This is my config.yml (I have an intel <10 gen):

ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p

I used this Dockerfile: https://raw.githubusercontent.com/alfg/docker-ffmpeg/master/Dockerfile

Hi,
I have a silly question:

there is a way to run frigate directly on a Coral Dev board or send the data to him?

Iā€™m trying to get the coral usb but is out-of-stock in many store,

care to share your flow? I want to send a notification using pushoverā€¦

Just tried to install also and Iā€™m having the same issue aswell.

Thank you!!! Worked like a charm <3