Local realtime person detection for RTSP cameras

You need https for remote, http work only local. I have it done with nginx, also added username and password for security

I am running virtualbox, ha and a coral usb. Running 4 camera streams and my coral does work with 80ms. Can i reduce that somehow?

UPDATE!
Ended up with installing unraid on my server and now i even get the PCIe M2 device to work with Frigate instead of running it all in Virtualbox.
SkƤrmavbild 2021-07-26 kl. 06.22.02

I think I might just have to cron a regular restart of the container for Frigate because after a day or two it loses itā€™s mind and can no longer record clips. It works for a day or two, then nothing. Looking at the log entries I see a whole bunch of this:


2021-07-25T14:27:32.861098806Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627223215.122179-kzbgch. There were no cache files for this event.,
2021-07-25T14:21:37.469689625Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627222864.637523-6ntnoe. There were no cache files for this event.,
2021-07-25T14:15:44.519126050Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627222487.689057-64e1zy. There were no cache files for this event.,
2021-07-25T14:10:45.031125360Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627222203.142801-acpxsd. There were no cache files for this event.,
2021-07-25T13:57:52.444735931Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627221434.580072-npmwpn. There were no cache files for this event.,
2021-07-25T13:51:04.187826413Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627221029.596954-ovivun. There were no cache files for this event.,
2021-07-25T13:53:17.129998308Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627221162.043652-8ptx3x. There were no cache files for this event.,
2021-07-25T14:08:11.220401179Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627222055.504688-bxkrpo. There were no cache files for this event.,
2021-07-25T14:15:19.382481322Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627222485.390142-pyr2yo. There were no cache files for this event.,
2021-07-25T14:20:55.373772098Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627222818.719276-j7gu87. There were no cache files for this event.,
2021-07-25T14:28:02.055927422Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627223244.870356-gag231. There were no cache files for this event.,
2021-07-25T14:28:27.273629226Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627223267.323-bzw4wb. There were no cache files for this event.,
2021-07-25T12:59:55.146578861Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627217959.198019-w0s8za. There were no cache files for this event.,
2021-07-25T13:14:50.013813889Z frigate.events                 WARNING : Unable to create clip for out_the_back and event 1627218853.843451-v31fnt. There were no cache files for this event.,
2021-07-25T13:14:24.790269170Z frigate.events                 WARNING : Unable to create clip for out_the_back and event 1627218834.039053-1qo4el. There were no cache files for this event.,
2021-07-25T13:15:15.147069500Z frigate.events                 WARNING : Unable to create clip for out_the_back and event 1627218863.828469-rjvhr6. There were no cache files for this event.,
2021-07-25T13:23:40.519496361Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627219386.762403-xrk004. There were no cache files for this event.,
2021-07-25T13:25:20.083011998Z frigate.events                 WARNING : Unable to create clip for east_yard and event 1627219486.750808-i8prj5. There were no cache files for this event.,
2021-07-25T13:43:34.848507240Z frigate.events                 WARNING : Unable to create clip for out_the_back and event 1627220583.694203-dap07y. There were no cache files for this event.,
2021-07-25T14:30:54.964253142Z frigate.events                 WARNING : Unable to create clip for out_the_back and event 1627223423.686949-egids7. There were no cache files for this event.,
2021-07-25T14:31:20.142146779Z frigate.events                 WARNING : Unable to create clip for out_the_back and event 1627223431.518857-5bo8ip. There were no cache files for this event.

I check the containerā€™s disk space and memory and itā€™s WIDE open:

root@frigate:/opt/frigate# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay         457G  116G  319G  27% /
tmpfs            64M     0   64M   0% /dev
tmpfs            63G     0   63G   0% /sys/fs/cgroup
shm             2.0G   70M  2.0G   4% /dev/shm
/dev/sdc2       1.8T   23G  1.7T   2% /media/frigate
/dev/sdd2       457G  116G  319G  27% /usr/bin/nvidia-smi
tmpfs           1.9G  1.3M  1.9G   1% /tmp/cache
tmpfs            63G   12K   63G   1% /proc/driver/nvidia
tmpfs            13G  4.8M   13G   1% /run/nvidia-persistenced/socket
udev             63G     0   63G   0% /dev/nvidia0
root@frigate:/opt/frigate#

I did notice that inside the container there are a TON of files in /dev/shm before I restart it.

I had this before and with me it was a memory and chache memory issue.

How did you solve it? Iā€™ve allowed 2G of shared memory /dev/shm and 2G of /temp/cache and Frigate is not using much of either.

Also, why would it work to begin with and over time stop working? Seems to be more like a bugā€¦

It is somewhere in this 5085 monstertopicā€¦ I do not exactly remember and cannot search it as I do not have access to a pc atm.

How memory is set and free in the docker container? And is this set correct:

I have just setup Frigate via Docker and i am doing some testing before purchasing any more kit so i am using the CPU detector for now.

I have YiHome camera with Yi-Hack v4 and RTSP stream into Frigate and this appears to work fine at 5fps and i have some issues/questions:

  1. The system shows it has detected a person when i view a camera via the web UI however the event page doesnt show any events, it is empty.

  2. I am using the ffmpg integration to currently bring the RTSP stream into Home Assistant, this is then also available to HomeKit. I tried to bring in the RTMP Stream from Frigate but it fails to load, which integration should i be using to see Real Time view at full FPS?

- platform: ffmpeg
  name: Camera
  input: -rtsp_transport tcp -i rtsp://CAMIP/ch0_0.h264
- platform: ffmpeg
  name: Camera_Frigate
  input: rtmp://ServerIP_of_Docker_Host:5000/live/CameraName
  1. My YiHome cameras have a high res and low res stream available. Can i use the low res for object detection and the high res for live view? If so how and where do i configure this - or would i simply continue to view the high res stream via my existing ffmpg integration?

For number 1: I canā€™t help.
Number 2: did you put the rtmp in your config?
Number 3: you can do both high res and low res streams. Just need to config what youā€™d like to do with each one.

If you post your config someone can likely help you better.

Think i fixed 1 and maybe 2

For 1 i had to enable clips in the roles - now shows events.
For 2 i have to use the port number 1935 instead of 5000. I have tested this in VLC but it seems to be pretty slow. More testing needed.
For 3 - still not sure how i use both streams in Frigate.

Did you look at the link I posted? Itā€™s explained pretty clearly in thereā€¦just keep reading.

Hey All,

I got 8 cameras working perfectly with frigate. I have all 8 cams latest picture as buttons for each camera, now How can i play the clips for each corresponding to their latest pictures?

Yeah I donā€™t think itā€™s 100% clear but from reading more yesterday I think I just define two inputs for the camera. High res has rmtp role and the low res has the detect role.

I need to do some playing. I noticed the camera feed in HA with the integration is the 5fps feed or it appears very laggy for me.

Sorry if this has been covered before but could Frigate be used instead of Blue Iris? Or does it work better in conjunction with Blue Iris? Basically looking for something to record streams to a disk as well the detection.

Frigate has added recording and it works pretty well as showing detected events.
I quit using surveillance station (Synologyā€™s DVR)

Likewise. Made me so happy to do so.

I have my outside cameras recording 24x7, with detection, then inside only recording on detection - some only when weā€™re away from home.

hello. iā€™m struggling to get frigate to work as a docker container. keep getting the following error when i run docker-compose up -d :

frigate    |  * Starting nginx nginx
frigate    |    ...done.
frigate    | Error parsing config: [Errno 21] Is a directory: '/config/config.yml'

Iā€™m a bit of docker noob, but from what i understand i needed to create the config.yml file and then point the container to where it is located. then fill that file with the bits and pieces iā€™d like for the frigate config. however, i guess i donā€™t know the correct syntax to point the container to the yml file.

this is what my docker-compose looks like:

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:
      - /etc/localtime:/etc/localtime:ro
      - /containers/frigate:/config/config.yml:ro
      - /containers/frigate:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "1935:1935" # RTMP feeds
    environment:
      FRIGATE_RTSP_PASSWORD: "password"

Any assistance would be super appreciated :slight_smile: i know iā€™m probably doing something daftā€¦

This would seem to say to me, that youā€™re mapping the frigate directory, to the yml fileā€¦ which likely accounts for the below:

frigate    | Error parsing config: [Errno 21] Is a directory: '/config/config.yml'

Although I use the HA addon approach, so not 100% :slight_smile:

Found you here as well.
It seems like the suggested usage of Frigate is opposite of what you suggest - the container is designed be upstream of HA and can restream the cameras to HA via RTMP.
I just tried out Frigate this past week and it works well but doesnā€™t quite match my needs/hardware, partially because of my hardware and partially due to the intended configuration mentioned above.
Have you tried DOODS? I might try that next.

Anyone with a D-Link cam?
Can you share you ffmpeg settings for that brand.

Yeah definitely not a normal use case. i think the problem these folks need solved is a way for frigate to consume a nest url and the only way they have to get that is via HA since it manages authentication with oauth, refreshing the expiring urls, and discontinuities across stream resets via HLS. HA would act like a stream proxy.

So Iā€™m just curious if it would even work, before deciding of it makes sense as a supported use case (e.g. providing a stable video stream url)