Local Security Camera Recording with Frigate NVR

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
security cameras are apparently one of the most effective deterrents against crime i found several articles online that interviewed former burglars and they all said that cctv was likely to put them off breaking into a house or stealing a car they are apparently even more of a deterrent than a burglar alarm system in this video series i'm going to show you how i use an open source ai powered security camera system called frigate to get notified when the cameras around my house detect people vehicles or foxes frigate is a free-to-use nvr which stands for network video recorder that can be installed on an old computer or a nas using docker or as a home assistant add-on it uses ai running locally on your computer to make sense of what your camera is looking at and only alerts you when it's something you care about not wind blowing leaves on trees or shadows passing over your garden in this video i'll show you how to install frigate connect your ip-based cctv cameras and record your security camera footage locally to your hard disk this will create a foundation for future videos in this series which will show you how i connect frigate to home assistant so that i can alert me when my cameras detect people vehicles or other objects in specific areas that they shouldn't be in i'll show you the settings that i tweaked to reduce false positives increase performance and optimize my storage space make sure you subscribe to the channel so you don't miss any episodes and now let's take a look at how you can get frigid installed in your own home [Music] these days there are a huge range of smart security cameras on the market like those made by google nest amazon ring rio link and many many other providers unfortunately many of these smart security cameras require an internet connection and for you to pay for a monthly cloud subscription in order to access your video footage remotely or look at past recordings not only is this expensive but there are also huge privacy implications when your video footage gets sent across the internet to some random company's cloud servers amazon previously had to fire some employees because they accessed the private footage of some of their customers video cameras that's creepy the advantage of frigate is that everything is done locally on your own computer and inside your home network none of your video footage goes into any third-party company servers and your security cameras are not directly accessible via the internet sure you can still view the footage through home assistant or the frigate ui directly when you're outside of your home network but the cameras themselves are not directly internet accessible so it dramatically reduces the risk of them getting hacked and your camera footage leaking out onto the internet before you get started you're going to need some ip-based security cameras and to work with frigate they'll need to meet some pretty specific requirements firstly they need to support h.264 video encoding this is supported by a lot of cameras out there but make sure you check first i had a newer rheolink camera and it only supported h.265 so it didn't work that well with frigate and i had to send it back secondly i would highly recommend that you hardwire your cameras using power over ethernet or poe as it's known poe is a way of connecting and powering network devices over an ethernet cable this means that you can run one cable from your network switch to the camera and it will transfer both the data from your camera as well as the electricity to power it to support this you'll need a network switch that supports poe but if you don't have one of those you can use a normal network switch and a poe injector which adds power to a normal network cable i strongly urge you not to use battery or wi-fi cameras for this they are not very reliable if you want to record 24x7 footage and if you try it will eat through the battery pretty quickly battery cameras work fine if you're only interested in recording movement or short clips but they don't work so well with frigate you can find a set of recommended cameras listed on the frigate website so that's a great place to start i personally use unifi cameras and they work great with frigate i wouldn't necessarily recommend them though as they are quite expensive and they're designed to work with unifi's own recording software i'm only using them because i already had them before i started using frigate and have been pretty reliable there are loads of youtube videos where people review and compare network security cameras i've linked a playlist by a youtube channel called the hookup in the description below that has tons of info just make sure that you get cameras that are h264 compatible are hardwired to your network and preferably support rtsp streams every camera will have a different way of setting them up so follow the manufacturer's instructions for your devices once you've got your security cameras installed and connected to your network you can test them by opening vlc media player and opening the rtsp stream url for your camera if you can see the live footage here then you're good to go the next thing you'll need to have running in your home automation setup is an mqtt server if you don't know what mqtt is or how to set it up then check out the video i did about this which is linked in the description it should tell you everything you need to get that set up obviously you will also need a computer or device to run frigate on i run mine on the same intel nock pc that i run home assistant on and i use docker but you can just as easily run it on a nas device or other system via docker and it can even be installed as a home assistant add-on just make sure that the computer you're running it on is quite powerful as it will be doing a lot of image processing it won't work too well on a raspberry pi you'll also need a lot of free disk space to store the recorded footage on i just plugged a one terabyte usb drive into my intel noc and used that to store my footage on you can also store the footage on a network device like a naz which is a better solution because usb drives aren't the most reliable and if something breaks on it i'll lose all my video footage that's not something that i'm personally too worried about but it is worth pointing out so we've got our camera set up our mqtt server running and some hard disk storage to store our recorded footage onto it's time to set up the frigate application itself if you're running the home assistant operating system then the easiest way to do this is to use the frigate add-on if you're running home assistant container you'll need to install frigate using docker i'll be showing you both methods now starting with the home assistant add-on method to install the frigate add-on you need to follow the instructions on the frigate website which is linked in the description below navigate to the installation section and scroll down to the home assistant operating system area these are the instructions i'm going to take you through now frigate is not part of the official home assistant add-on library so you'll need to manually add the frigate repository to home assistant start by copying the github url and then switch over to your home assistant operating system go down to the settings section and then over to the add-ons area click on the add-on store button on the bottom right and then on the three dotted kebab menu in the top right from here you can add the frigate private repository by pasting in the github url you copied earlier you should now see frigate in the list of add-ons that are available to install and you should be able to install the normal frigate nvr add-on click the install button and go make a cup of tea because this is going to take a while once it's installed i recommend toggling the option to show it in the sidebar and then go over to the documentation tab you can see that it's telling you to create the frigate.yaml configuration file in the home assistant config directory before you launch the add-on you can create this yaml file using the file editor plugin or the studio code server plugin i'm going to use the file editor to plug in i'm going to create a new file called frigate.yaml to create the basic configuration file i recommend following the steps and the guides in the frigate documentation you can copy and paste the relevant sections of the configuration from the template directly into your file editor plugin you need to start by adding the details of your mqtt server so copy these items out if you don't have any authentication on your mqtt server you can ignore the user and password sections enter the ip address of your mqtt server usually the same ip address as your home assistant server and then add any authentication information in now we need to add our first camera switch back to the documentation and find the camera's sample from the config file copy it out and paste it into the file editor again name your camera something sensible and then change the input path to match the rtsp stream url of your camera this should be the same one that you tested in vlc player earlier in the roles section add the record role i'll talk a bit more about roles in the next video but we essentially need to add the record role here because we want to record the footage from this camera to our hard disk repeat this step to add more camera entries for each of the security cameras that you have in your house i remove the rtmp section because my security cameras are all h264 compatible and then finally you need to check if the camera resolution here matches that of your camera stream i also like to add the fps that my camera supports here by adding the fps key once that's all done we can go and save the file go back to the add-on and start it up i always recommend checking the logs area to make sure that nothing has gone wrong once it started up you should see a new frigate item in the left hand navigation menu click on that and if you've done everything right you should see your video picture finally we want to enable recording to the hard disk by adding the record options to the configuration file go back to the configuration guide scroll down to the recording area and copy out the sample paste it back into the file editor to plug in save the file and now we'll need to restart the add-on to make these changes take effect i recommend that you adjust the recording parameters in this configuration file for your own environment so you find the right balance between how far back in time you want to be able to go and view your footage and not eat up all of your hard disk space this will be totally dependent on your camera's resolution how many cameras that you have and the size of your storage the frigate documentation has a lot of information about how to tweak these recording options and there are dozens of different settings that you can configure just remember to restart frigate after you make a configuration change so that these settings are applied you now have frigate running as an add-on and you can log into home assistant at any time to see your cameras in real time and go back in time to see what happened earlier if you're running home assistant container on docker then you'll need to run frigate in a separate docker container if you're used to running docker and using docker compose then you'll find this pretty straightforward firstly go to the frigate documentation to the installation section and find the sample docker compose snippet there are different docker images available for different cpu types if you're using an intel or amd cpu then use the amd 64 image copy the sample configuration and then go to whatever you use to edit your docker compose file and paste it in there i personally use vs code which is connected directly to my ubuntu linux server i've previously created a whole series of videos of how i use home assistant with docker so go check that out after this video if you've not already seen it i put a link to the docker video playlist in the description below anyway paste in the sample docker compose entry into your own docker compose file and make sure that you're happy with the defaults you will need to change the image that you're using to the amd64 or whatever one you're using though i remove the pcie coral entry which i'll again talk about in the next video in the series and change the mapped volumes so that the config file and the media storage location are in my slash opt directory where i keep all of my docker files i'd recommend mapping a different location for your media you can use a network attached storage or an external usb hard disk somewhere where you've got lots of free disk space available there's plenty of documentation available online for how to map docker compose volumes to different types of storage i leave everything else as default and then save the file just like when we use the home assistant add-on we first need to create the folders that we want the container to access and the configuration yaml file i use vs code to create a frigate directory in my slash opt folder and then the media and config directories inside that i then create a new file called config.yaml in the config folder inside this configuration file i copy the exact same stuff that i had in the frigate home assistant add-on configuration file i showed you earlier you should once again adjust the recording options to be suitable for your environment once you're happy with the file save it and open up a terminal to your docker server now run the docker compose up hyphen d command to pull down the frigged image and create the container once it's done you should see the frigate container running in your docker stack i verify this using portainer and quickly check the log files to make sure nothing's failed if it's running as expected you should be able to navigate to your docker server ip and port 5000 which will bring up the same frigate user interface we saw before you can now access your camera stream in real time or click on the recording link to view all the footage that has been recorded and saved to your hard disk you now have a fully featured network video recorder that is recording your security camera footage locally to your hard drive 24 hours a day seven days a week and all of this without passing any of your video footage to another company and will even work when your internet connection is down but frigate is far more than just video recording software it has the ability to detect specific objects using artificial intelligence and can then send a clip to your smartphone of the object it detected using home assistant and it does all of this completely locally in your own network without passing any information to the cloud i've been using this for several months and it is super accurate it has really cut down all the false positive notifications i was getting before when my camera sent me hundreds of notifications because it thought some leaves blowing in a tree were people i'll be showing you how i've configured frigate to do all of this in the next video in the series so make sure that you hit that subscribe button so that you know when that video is released and then together we can make your home smarter
Info
Channel: Home Automation Guy
Views: 130,146
Rating: undefined out of 5
Keywords:
Id: 3pWQg4-VQ8o
Channel Id: undefined
Length: 13min 46sec (826 seconds)
Published: Wed May 25 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.