Local realtime person detection for RTSP cameras

It looks like if I mount local host folder for clips, I don’t get the database locked error but if I use network shared folder, I get the error even though frigate can write the clips (version 0.7.0) on the network shared drive.

Local folder without error:

drwxrwxrwx 2 user user 4096 Dec  9 15:34 beta
drwxr-xr-x 2 root root 4096 Dec  9 19:51 clips
drwxrwxrwx 2 user user 4096 Dec  9 11:10 config
drwxrwxrwx 2 root root 4096 Dec  9 11:10 config7
drwxr-xr-x 2 root root 4096 Dec  9 19:50 recordings
root@hp:/home/user/data/frigate# cd clips/
root@hp:/home/user/data/frigate/clips# ls -l
total 20
-rw-r--r-- 1 root root 20480 Dec  9 19:51 frigate.db

Network folder with database locked error but version 0.7.0 can write clips

drwxr-xr-x 2 root root 0 Dec  9 19:07 clips
-rwxr-xr-x 1 root root 0 Dec  9 19:03 frigate.db
drwxr-xr-x 2 root root 0 Dec  9 19:01 recordings
drwxr-xr-x 2 root root 0 Dec  9 06:11 snapshot
drwxr-xr-x 2 root root 0 Dec  9 19:19 webcam

Same experience here. Like I mentioned before, I get the error when I bind mount an smb share to the container.

Same for me as well.

I’m running proxmox with Hassio VM + LXC Container for Frigate.

Currently using Hassio Samba addon to share media directory and Frigate LXC container mount it using fstab.

Now i’m trying to use NFS to share the clips folder from LXC to Hassio VM. I’m getting connection refused while trying to mount the directory from Hassio VM.

I’m thinking to abandon my proxmox setup and go for debian supervised instead. Less headache running 2 separate VM/Container

If it helps, I’m running home assistant container in docker on bare metal Ubuntu, in the same stack with frigate. Not sure it should matter, but the smb share is hosted by an Ubuntu VM on a separate proxmox server running next to the home assistant server.

Media browser issue?

I’m not that familiar with the media browser, but when I browse it I consistently see only 50 thumbnails.
When I go to clips it shows:

Clips (1422)

When I scroll down through the 50 thumbnails I see at the bottom individual folders:

Today (133)
Yesterday (827)
This Month (1422)
Voordeur (1422)
Person (133)
Car (1289)
Oprit (38)
Straat (1238)

Clicking through I still get to see only 50 thumbnails of the selected item.

Any hints?

Ok, installed the Frigate NVR Beta 1.0 in HA. Still don’t see where I can add my actual Frigate host that is running on the NUC. On HA in Frigate NVR Beta -> Configuration I can see where I can change ports for the RTMP streams and Web Interface.

Am I missing a tutorial or something from somewhere? I feel like I’ve having a hard time getting this figured out for some reason and I’m no slouch when it comes to software.

You have installed the integration haven’t you? https://github.com/blakeblackshear/frigate-hass-integration

Then go to Configuration > Integrations > Add Integration

No. I’ve never seen that page you linked. It is not linked from anywhere on the “official” README.

Alright, I’ll mess with it again later. Thanks for the tip.

You can continue to drill down until you see an “All” folder. That folder should have a limit of 10,000. The limit of 50 is by design. HomeAssistant does not support lazy loading of items nor does it offer caching of thumbnails. Over slow/mobile networks, showing lots of items means you have to load every thumbnail with each click and it ends up being way too slow. My assumption was that most of the time you are looking for what happened recently with a few quick filters, but that you can still get to everything if needed.

The beta readme has been updated with a link in several places.

So it looks like sqlite databases aren’t reliable when run from a network share. I can add a configuration option for the database to allow you to store it elsewhere. This database does have all of the metadata for clips, so if it is lost, HomeAssistant won’t show them in the media browser anymore.

3 Likes

Given how many people are trying to get support in a single thread here, I thought it would be helpful to setup the new Discussions feature on Github directly: https://github.com/blakeblackshear/frigate/discussions

6 Likes

I wasn’t aware of the “all” folder. I was actually expecting something like a page by page browsing, but I’m not that familiar with the media browser.
But yes, it makes sense to limit the number reduce the i/o.
Anyways, selecting the "All, is in my case to much for the PI to handle. That is to say it eventually gets there, but it takes a few minutes (which looks like a freeze, but isn’t).

@blakeblackshear: You’ve done an amazing job here:

  • After looking at doods I thought the USB Coral Edge TPU on my j4105 board just wasn’t capable of doing the job with my 3 Foscam + 1 reolink HighRes cameras. Detection rate was rather bad, from comments I thought the TensorFlow Lite models were the root cause. Frigate just worked (Software was key?) for >3 month now & WAF is high due to cat door tracking :slight_smile:
  • Your latest Beta rocks. 24x7 recoding, image cropping, Media Browser, lower CPU usage, HA Integration, Dokumentation style - just what i was looking for and didn’t find in Milestone, Shinobi, iSpy Agent DVR, Zoneminder, …
  • The professional, unagitated way you appear (to me) in this forum. Great style!

I’m a (scotish, sorry) sponsor of yours now - hope to vanish in the crowd soon (come on guys - we could be more…)

Thanks!
Alex

PS: Sorry, but:

+1 for the ‘turn of detection when person at home’

Would love to have /media/frigate/[clips|recordings] on an NFS / SMB share instead of the docker host. I do that with a number of containers, currently frigate doesn’t seem to like it. Even with clips + db locally recodings don’t play out in media browser

PPS: Ignore the whining - suck in the compliment.

4 Likes

New sponsor here, too. Enjoy the coffee, Blake!

Same here for the thought that tensorflow lite is giving less than stellar results. Also using Doods and it works well, but using the heavier models.
This is why I never bought a coral. I thought it was limited to the lite version.

Does frigate do more than tensorflow lite? Or is that not an option? Looks interesting and I have got some time off coming up. Maybe I’ll try it just to try it and see.

I am storing my recordings over NFS, and it works great. Simply mount the NFS on the docker host, and add this volume on Frigate docker image.

Can u share how you mount the nfs share in hass os?

I’ve tried the mount command but got connection refused

@blakeblackshear I’ve started having a weird issue with the HA addon.

2 of my cameras are bouncing back and forth with each other when I view the feed.
One called hot_tub with a feed from rtsp://xyz:[email protected]:554/h264Preview_05_sub
The other called pool with a feed from rtsp://xyz:[email protected]:554/h264Preview_06_sub

When I go to 192.168.XX.XX:5000/hot_tub I see the feed from hot_tub, then it jumps to the feed from pool, then back to hot_tub and it flips back and forth. Same happens when I view the feed from pool. My side_yard, side_door, back_door cameras are all working fine.

When I view the individual rtsp feeds there are no issues. I’ve rebooted the camera feeds, frigate, HA. Renamed the cameras. All was working fine (or at least it was last time I looked at the frigate feed). This morning I added a poly mask for the pool camera and that’s when I noticed this strange issue.

Looking at the startup log you can see it’s starting 2 processes with different feeds for pool

Camera process started for hot_tub: 20
Camera capture process started for pool: 21Creating ffmpeg process...
ffmpeg -hide_banner -loglevel panic -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -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://xyz:[email protected]:554/h264Preview_05_sub -r 5 -f rawvideo -pix_fmt yuv420p pipe:
Camera process started for pool: 25Creating ffmpeg process...
ffmpeg -hide_banner -loglevel panic -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -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://xyz:[email protected]:554/h264Preview_06_sub -r 5 -f rawvideo -pix_fmt yuv420p pipe:

EDIT: I uninstalled/re-installed and same thing. Then I moved to the beta and now ALL my camera’s are doing the same thing. If I re-order the order of the cameras in the config it changes which camera it jumps back and forth with.

ffmpeg.side_door.detect        ERROR   : [rtsp @ 0x5632fd27b880] RTP: PT=60: bad cseq 1c52 expected=0fe2
ffmpeg.side_door.detect        ERROR   : [rtsp @ 0x5632fd27b880] RTP: PT=60: bad cseq ff3a expected=0fe2
ffmpeg.side_door.detect        ERROR   : [rtsp @ 0x5632fd27b880] RTP: PT=61: bad cseq 505b expected=f3ce
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 462e expected=e17e
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 9364 expected=6a02
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq c2eb expected=9368
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 2c1b expected=9368
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 286b expected=9368
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq c2ec expected=9368
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 2c1c expected=9368
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 286c expected=9368
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq c2ed expected=9368
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 2c1d expected=9368
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 286d expected=9368
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 674b expected=4632
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 5cd6 expected=4632
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq c617 expected=4632
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 674c expected=4632
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 5cd7 expected=4632
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq c618 expected=4632
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 674d expected=4632
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 5cd8 expected=4632
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq c619 expected=4632
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 674e expected=4632
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 5cd9 expected=4632
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq c61a expected=4632
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq c2ee expected=9368
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 2c1e expected=9368
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 286e expected=9368
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=60: bad cseq bcaf expected=3b78
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq 4382 expected=2949
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq a9d8 expected=4385
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq 136a expected=4385
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq a9d9 expected=4386
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq 136b expected=4386
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq a9da expected=4387
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq 136c expected=4387
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq a9db expected=4388
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq 136d expected=4388
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq a9dc expected=4389
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq 136e expected=4389
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq a9dd expected=4389
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq 136f expected=4389
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq a9de expected=4389
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq 1370 expected=4389
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=60: bad cseq 744b expected=bcb3
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=60: bad cseq bcb4 expected=744d
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=60: bad cseq 744e expected=bcb6
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=60: bad cseq 3b78 expected=7452
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq 2949 expected=4389
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 6a02 expected=9368
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq e17e expected=4632
ffmpeg.side_door.detect        ERROR   : [rtsp @ 0x5632fd27b880] RTP: PT=61: bad cseq ea77 expected=505f
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=60: bad cseq 2443 expected=7452
ffmpeg.side_door.detect        ERROR   : [rtsp @ 0x5632fd27b880] RTP: PT=61: bad cseq 505f expected=f3d1
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 4632 expected=e181
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 9368 expected=6a05
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=60: bad cseq e5f1 expected=244a
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq bbac expected=4389
ffmpeg.side_door.detect        ERROR   : [rtsp @ 0x5632fd27b880] RTP: PT=60: bad cseq 1c53 expected=0fe3
ffmpeg.side_door.detect        ERROR   : [rtsp @ 0x5632fd27b880] RTP: PT=60: bad cseq ff3b expected=0fe3
ffmpeg.side_door.detect        ERROR   : [rtsp @ 0x5632fd27b880] RTP: PT=60: bad cseq 1c54 expected=0fe3
ffmpeg.side_door.detect        ERROR   : [rtsp @ 0x5632fd27b880] RTP: PT=60: bad cseq ff3c expected=0fe3
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq 294a expected=bbae
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=60: bad cseq 3b79 expected=e5f3
frigate.edgetpu                INFO    : TPU found
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 674f expected=4634
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 5cda expected=6751
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq c2ef expected=936a
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 2c1f expected=936a
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 286f expected=936a
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq c61b expected=6751
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 5cdb expected=6751
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq c61c expected=6751
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq c2f0 expected=936a
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 2c20 expected=936a
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 2870 expected=936a
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq c2f1 expected=936a
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 2c21 expected=936a
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 2871 expected=936a
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=60: bad cseq bcb6 expected=3b7b
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 5cdc expected=6752
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq c61d expected=6752
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq 4389 expected=294c
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=60: bad cseq 7452 expected=bcb8
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq a9df expected=438b
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq 1371 expected=438b
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq a9e0 expected=438b
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=60: bad cseq 1372 expected=438b
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=60: bad cseq 244a expected=7454
ffmpeg.side_door.detect        ERROR   : [rtsp @ 0x5632fd27b880] RTP: PT=61: bad cseq f3d1 expected=5061
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq e181 expected=6752
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 6a05 expected=936a
ffmpeg.side_door.detect        ERROR   : [rtsp @ 0x5632fd27b880] RTP: PT=61: bad cseq ea7a expected=f3d3
ffmpeg.hot_tub.detect          ERROR   : frame=   34 fps= 22 q=-1.0 q=-0.0 size=N/A time=00:00:02.00 bitrate=N/A dup=3 drop=8 speed= 1.3x    
ffmpeg.hot_tub.detect          ERROR   : [rtsp @ 0x55f10c628c80] RTP: PT=61: bad cseq 936a expected=6a08
ffmpeg.side_door.detect        ERROR   : frame=    9 fps=5.9 q=-0.0 size=    2970kB time=00:00:01.80 bitrate=13516.8kbits/s dup=0 drop=5 speed=1.18x    
ffmpeg.side_door.detect        ERROR   : [rtsp @ 0x5632fd27b880] RTP: PT=61: bad cseq 5061 expected=ea7d
ffmpeg.pool.detect             ERROR   : frame=    8 fps=5.0 q=-0.0 size=    2640kB time=00:00:01.60 bitrate=13516.8kbits/s dup=3 drop=7 speed=   1x    
ffmpeg.pool.detect             ERROR   : [rtsp @ 0x55fe6c978880] RTP: PT=61: bad cseq 4634 expected=e184

EDIT2: I was able to get the cameras to stop bouncing. I changed all the feeds to the 4k feed, restarted frigate, then changed them back to the substream and that seems to have fixed it. But my log is still loaded with the error above.

Sorry, I don’t use HASS. Frigate runs on a Docker system on top of ubuntu.
I NFS to a Synology system, using a simple mount command after modifying the /etc/fstab file.