{"id":275,"date":"2023-06-29T22:05:15","date_gmt":"2023-06-29T22:05:15","guid":{"rendered":"https:\/\/www.zebadger.com\/wp\/?p=275"},"modified":"2023-06-29T22:15:05","modified_gmt":"2023-06-29T22:15:05","slug":"frigate","status":"publish","type":"post","link":"https:\/\/www.zebadger.com\/wp\/?p=275","title":{"rendered":"Frigate"},"content":{"rendered":"<p>I had a camera &#8220;front&#8221;.<br \/>\nI renamed it in the config to &#8220;front1&#8221; and added another camera called &#8220;front2&#8221;.<br \/>\nOnce 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 &#8220;front&#8221;.  I think that this caused all my recordings to disappear from disk.<\/p>\n<p>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.<\/p>\n<p>First I installed a sqlite client:<\/p>\n<blockquote><p>sudo apt install sqlite3<\/p><\/blockquote>\n<p>Then I worked out the date timestamp value that I needed by visiting <a href=\"https:\/\/www.epochconverter.com\/\" rel=\"noopener\" target=\"_blank\">Epoch Converter<\/a> and picking the date time that I know I made a mess.<\/p>\n<blockquote><p>Yr\tMon\tDay   Hr\tMin\tSec<br \/>\n2023-\t6-\t29    21 : \t0 : \t0    GMT<br \/>\nHuman date to Timestamp<br \/>\nEpoch timestamp: 1688072400<br \/>\nTimestamp in milliseconds: 1688072400000<br \/>\nDate and time (GMT): Thursday, 29 June 2023 21:00:00<br \/>\nDate and time (your time zone): Thursday, 29 June 2023 22:00:00 GMT+01:00<\/p><\/blockquote>\n<p>I then copied the Timestamp in milliseconds into my delete command<\/p>\n<blockquote><p>$ sudo sqlite3 frigate.db<br \/>\nSQLite version 3.34.1 2021-01-20 14:10:07<br \/>\nEnter &#8220;.help&#8221; for usage hints.<br \/>\nsqlite> delete from event where start_time <= 1688072400;\nsqlite> .q<\/p><\/blockquote>\n<p>It took a few seconds, but dropped my events from 29k to 71.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had a camera &#8220;front&#8221;. I renamed it in the config to &#8220;front1&#8221; and added another camera called &#8220;front2&#8221;. 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 &#8220;front&#8221;. I think that this caused all my recordings to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-275","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.zebadger.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zebadger.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zebadger.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zebadger.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zebadger.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=275"}],"version-history":[{"count":10,"href":"https:\/\/www.zebadger.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/275\/revisions"}],"predecessor-version":[{"id":285,"href":"https:\/\/www.zebadger.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/275\/revisions\/285"}],"wp:attachment":[{"href":"https:\/\/www.zebadger.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zebadger.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zebadger.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}