I had a camera “front”.
I renamed it in the config to “front1” and added another camera called “front2”.
Once I was happy with my new higher resolution camera, I removed the old one and went back to just one camera in the config called “front”. I think that this caused all my recordings to disappear from disk.

However, the Frigate database seemed to think that they were still there. Deleting them all manually is somewhat tedious (especially because I had 29k of them!). So, I decided to delete them from the sqlite database with a command.

First I installed a sqlite client:

sudo apt install sqlite3

Then I worked out the date timestamp value that I needed by visiting Epoch Converter and picking the date time that I know I made a mess.

Yr Mon Day Hr Min Sec
2023- 6- 29 21 : 0 : 0 GMT
Human date to Timestamp
Epoch timestamp: 1688072400
Timestamp in milliseconds: 1688072400000
Date and time (GMT): Thursday, 29 June 2023 21:00:00
Date and time (your time zone): Thursday, 29 June 2023 22:00:00 GMT+01:00

I then copied the Timestamp in milliseconds into my delete command

$ sudo sqlite3 frigate.db
SQLite version 3.34.1 2021-01-20 14:10:07
Enter “.help” for usage hints.
sqlite> delete from event where start_time <= 1688072400; sqlite> .q

It took a few seconds, but dropped my events from 29k to 71.

Leave a Reply