Local realtime person detection for RTSP cameras

the thing is I do want it to detect when a car pulls onto my drive, yet ignore it once it’s there and hasn’t moved.

This morning it picked a delivery man (Person) and picked up my car that hasn’t moved

This is probably a cache issue with the browser. I’ve seen it using Chrome. A restart of Chrome or hard refresh of the Frigate UI mask editor clears it.

Then you will need to use zones and alert for movement into a zone if using HA.

Frigate begins looking for objects on motion, so once motion is detected it looks EVERYWHERE to find objects except inside any objects filter masks you setup ahead of time. It doesn’t matter if those objects are moving or not. If Frigate begins looking for them it will find them without filter masks.

1 Like

could this have the same issue if a person walks into the zone where the car is, it’ll trigger both.

It might me my misunderstanding, I thought it would check multiple frames and determine what’s different

Default detection is person I thought. I’d have to go back and look at the docs. So if you are detecting both car and person then, yes, if a person walks into the scene it will trigger on the person and a car. Once the person moves out of the scene it will continue to detect the car even though it isn’t moving.

1 Like

A post was split to a new topic: Camera system help

Have not used this for some time, decided to upgrade to the current version and have loaded up a new config file with one camera just to get it going (used the values from the old bulky config file).

I am however getting these errors in the log:

ffmpeg.garage_outdoor_camera.detect ERROR : Option rtsp_transport not found.
frigate.video INFO : garage_outdoor_camera: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video INFO : garage_outdoor_camera: ffmpeg process is not running. exiting capture thread...

In the preview window the screen is just green, even though the link opens fine in VLC.

Ive copied and pasted the input params for the Reolink RLC-410 but i cant seem to find the issue. Can anyone see anything that seems obviously wrong?

cameras:
  garage_outdoor_camera:
    ffmpeg:
      input_args:
        - -avoid_negative_ts
        - make_zero
        - -flags
        - low_delay
        - -strict
        - experimental
        - -fflags
        - +genpts+discardcorrupt
        - -rtsp_transport
        - tcp
        - -stimeout
        - '5000000'
        - -use_wallclock_as_timestamps
        - '1'    
      inputs:
        - path: rtmp://192.168.*.*/bcs/channel0_sub.bcs?token=254&channel=0&stream=0&user=*&password=*
          roles:
            - detect
            - rtmp

    width: 640
    height: 480
    fps: 6

I do apologise if this has been answered before, the thread is just becoming so huge to search.

Update: Changed the path to RSTP and it’s working fine. Not sure why it doesn’t support RTMP anymore.

A google coral and your choice of cameras are all that is needed. I run the USB coral and it works great.

Thanks I bought it. Awaiting delivery.

Is it preferable to use it on a separate pi4 (I do have one laying around), or shall I use it on my NUC i5?

I use it on the NUC directly. I run HA OS, and nothing else so it works great.

Hi,
this is a question regarding the coral

I’ve linked only one camera to my HA that runs on a RPI 4 8GB SSD would I see any benefit adding a coral?

Sorry for late reply, thx for info.
So how you access the Frigate from HASSOS?

You cannot access Frigate UI from HA interface, I am using IP of the Nas with the port 5000 in the browser, but I don’t need to access the Frigate very often as I have the Frigate Integration installed on the HA and that is giving me the cameras from Frigate and as well I have clips and recordings in HA Media Browser tab.

**Edit: For those who may have been having trouble with this, I tried a different PCIe slot and that seems to have resolved all of my issues.

Hoping someone help me out trying to get this working with the M.2 version of the Coral.
I’m running a Debian based VM in Proxmox. I have successfully passed the PCIe device to the VM, installed the dependencies, and can run the example processing script in the VM without issue.

When I try to run the add-on in Home Assistant, with protection mode off, and with config,

detectors:
  coral_pci:
    type: edgetpu
    device: pci

I get, “No EdgeTPU detected”, and then the error:

ValueError: Failed to load delegate from libedgetpu.so.1.0

If I try and run Frigate through a Docker container, I don’t get the No EdgeTPU detected error, but instead get the error:

File "/usr/lib/python3.8/multiprocessing/shared_memory.py", line 100, in __init__
    self._fd = _posixshmem.shm_open(
FileExistsError: [Errno 17] File exists: '/cameraname'

Where camera name is the name of the camera specified in the config.

I know that the PCIe device is successfully passed through to the VM, but can’t seem to get Frigate to run as a HA add-on or as a Docker container.

Anyone else have this successfully running with a similar set-up as mine?

I can’t seem to find a coral in stock, but I’ve been wondering if I could do something very similar. Differences would be I run HassOS in a VM and I would use the pcie version vs M.2.
So are the drivers installed on proxmox or the VM?

Specifically, I’m using the M.2 Accelerator B+M key, that’s into an M.2 to PCIe adapter. I installed the drivers on the VM, and can run the examples script in the VM. Works without a problem. It’s when I try and use Frigate with Docker am I running in to issues.

Frigate can be run separate to HomeAssistant. If you cannot get Frigate to work in HassOS running in Proxmox then maybe try running Frigate in Proxmox container LXC, I think Frigate Docs already including some info on this. You won’t have to deal with passthrough of PCI to VM which is very painful.

2 Likes

That would be amazing! I ran it in an ubuntu but that kept crashing my entire proxmox (nuc8) :thinking:

Hello. I have the same problem that has been mentioned some times in here but still haven’t understand what to do.

 * Starting nginx nginx
   ...done.
frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
peewee_migrate                 INFO    : There is nothing to migrate
frigate.mqtt                   INFO    : MQTT connected
frigate.app                    INFO    : Camera processor started for outdoor_front: 39
detector.cpu1                  INFO    : Starting detection process: 36
frigate.app                    INFO    : Capture process started for outdoor_front: 40
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x555a40e72140] moov atom not found
/media/frigate/recordings/outdoor_front-20210402174622.mp4: Invalid data found when processing input
frigate.record                 INFO    : bad file: outdoor_front-20210402174622.mp4

Running Home Assistant OS 5.12, core-2021.3.2, supervisor-2021.03.4, on Intel NUC 8th gen.

detectors:
  cpu1:
    type: cpu
ffmpeg:
  global_args: -hide_banner -loglevel warning
  input_args: -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt 
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p

Any suggestions?

Hi,

started to use Frigate from being a complete noob: I have it now up and running and going through performance optimization process.

In particular I have 2 questions: I have a cheap hacked Yi 1080p camera capable of streaming 2 RTSP streams (high and low res) both at 20fps, without ability to adjust fps into the camera.
I read through the thread an option is available take_frame but this when I add it Frigate complains it does not recognize it: it has been deprecated?

Second point is: you can specify only 1 width and height per camera: in case of 2 stream assigned to the camera which values should be set?

EDIT: so regarding point 1) I found this which basically means what you set for FPS, if not matching camera native FPS, FFMpeg will take care to change frame rate.
In shot i guess take_frame is depracated