HACKER Q&A
📣 DietaryNonsense

Self-hosted open source IP security cameras?


There are many options for IP security cameras and multi-camera setups. Ubiquiti, Foscam, Nest, Ring, and all of the things. But they all involve running untrusted internet connected devices on a local network. I want to improve my physical security with these devices without providing nodes to some future DDoS botnet or whatever else these poorly secured IoT devices will get repurposed for. I also don't want my system to be useless if the internet goes down or if BigCompany decides to change their terms or drop service for their APIs or whatever else.

Wondering if anyone has had success in setting up a self-hosted (maybe open source) camera system for their site? And if so, any advice? recommendations? sources for information that you found useful?


  👤 dervjd Accepted Answer ✓
Once you step up from consumer level (Nest/Ring/Wyze) cameras, you'll find that nearly every IP camera supports the standard RTSP/ONVIF format. They don't need any internet access to function. Standard practice is to secure them by using a dedicated VLAN (so they can't talk to anything else on your network) and default deny firewall rules (so they can't get to the Internet or other parts of your network). It's definitely not plug-and-play, but if you have experience setting up networks it's pretty straightforward. If you want remote access to the cameras while off your local network, you'll need to set up a VPN.

I have a bunch of Hikvision cameras (DS-2CD2342WD-I) that were about $120/each that I'm happy with. I don't have any security concerns about them phoning home or doing anything nefarious, because they're completely segregated on their own locked down network.

If you want to record, you'll need to set up an NVR. You can buy one (i.e. https://amzn.to/3HFNEWw) or run software on your own server. I use Milestone XProtect's free license at one site, and Synology's Surveillance Station at another. You could also look for cameras that have an SD card slot built in, and configure recording directly on the camera.


👤 larsla
I use Frigate (https://frigate.video/) on a rPI for recording and doing person detection for 3 Reolink cameras. Connecting that to HomeAssistant for dashboard and notifications. It works great! I boot the rPI (model 4 with 8gb RAM) from a USB-SSD to not worry about SD-cards. I connected a Coral USB device for the person detection since the rPI itself can only manage about 2 frames/s.

👤 arwineap
My goals were mostly the same, and I realized I needed RTSP/ONVIF cameras with poe links

Started using kerberos.io but got frustrated with their licensing. I had thought using their hooks would be enough for my use case.

In the end I wrote some code that uses opencv to monitor the stream, look for motion, then I isolate the motion and use yolov3 to classify what is in the motion area. The motion isolation ended up being required because I didn't want the car in my driveway to be classified on every video.

Then some simple rules to control how things get saved and if I get alerted. If I am alerted the video gets uploaded to an s3 bucket, and a presigned link gets sent over telegram. Of course, I keep a local copy for some time as well :)

My cameras are all on an isolated network. The server monitoring them has two nics so it's able to route to the cameras and externally. The server consumes a lot of CPU, but I hope to eventually get a minor gpu for it to offload some of the work

It's been a very fun and rewarding project, and I hope to keep iterating.


👤 sterlinm
There's a channel on YouTube called "The Hook Up" that has a lot of good videos about home automation. Here's his playlist of videos he's made on security cameras:

https://www.youtube.com/playlist?list=PL-51DG-VULPom8Ud6vdf5...

Most relevant to your question might be this video: Build The BEST Security Camera NVR: Free Locally Processed AI Computer Vision with Blue Iris.

https://www.youtube.com/watch?v=fwoonl5JKgo


👤 kotaKat
Not open source, but fairly open standard, I'm in love with Milestone XProtect Essential+[1] because I'm a Windows Server guy.

Free for 8 cameras, has extremely universal support for cameras (you can add in RTSP streams, Onvif, MJPEG/HTTP grab, etc) and some really good SDK support[2] - and a PowerShell module[3] to boot.

And, more importantly, a really good view on ethics[4]:

> We require employees, partners, and customers to comply with applicable laws and to respect human rights. We do not accept discrimination, human rights violations, violations of child labor laws. We have incorporated human rights language into our licensing terms, which were supplemented by the Copenhagen Clause in 2019.

[1] https://www.milestonesys.com/solutions/platform/video-manage... [2] https://www.milestonesys.com/community/developer-tools/mip-a... [3] https://www.milestonepstools.com/ [4] https://www.milestonesys.com/about-us/csr/


👤 the-smug-one
Axis cameras aren't open source, but they're just Linux running systemd and Axis (or other) software. You can ssh into them, write your own apps, etc. They're not particularly locked down. They support ONVIF and VAPIX, which are API:s that VMS's such as Milestone and Genetec target.

> poorly secured IoT devices will get repurposed for.

Don't let it have access to the outside net then?


👤 lormayna
I have several cheap chinese cameras (Sricam) in a separated VLAN without internet access in my home LAN. The camera are connected via ONVIF to a Raspberry running [motion](https://motion-project.github.io/).

👤 eternityforest
I tried pretty much all of them, now I'm working on my own NVR(https://eternityforest.com/doku/doku.php?id=tech:nvr).

For the cameras themselves, Amcrest is good enough for me, but the PineCube looks like it has potential.


👤 zikduruqe
I am running Wyze v2 cameras with RTSP firmware on them, using Homebrige and Scrypted. People are also liking camera.ui too.

Homebridge - https://github.com/homebridge/homebridge

scrypted - https://github.com/koush/scrypted/wiki/Installation:-Docker-...

camera.ui - https://github.com/SeydX/camera.ui


👤 tedchs
Check out the Pine Cube: https://www.pine64.org/cube/

👤 maybebill
For open source and self-hosted, I've been pretty pleased with openmiko (https://github.com/openmiko/openmiko). I put this on a couple $20-ish wyze cams that are used adhoc right now, but will be combined with frigate and home assistant when I can get ahold of a Coral USB device.

👤 mindslight
I had been planning to make security cameras with RPi, HQ Camera, and a 3d-printed case. But that was back when Pi 4's were $30, rather than unobtainable. I hadn't really figured out the software story, but my previous attempts with Pi Zero and basic camera left me wanting more horsepower.

👤 epakai
I setup a WYZE/Dafang camera with dafang-hacks firmware. Then run a MQTT server to pass messages on motion activity. A basic script runs ffmpeg and records the RTSP stream on a separate server.

I was just tracking rodents temporarily though. Not that well suited for security applications.


👤 giantg2
You can used ZoneMinder with various PoE cameras and put the system on it's own network/segment.

👤 squarefoot
Check the ESP32-CAM. Very cheap, although there's some diy involved.

https://dronebotworkshop.com/esp32-cam-intro/


👤 mustava
AgentDVR in docker is a great alternative to blueIris if you don't want to run Windows. You can plug any onvif camera into it easily enough. Works with home assistant too.

👤 fulafel
It seems everyone is resigned to crunchy/gooey 90s style networks for these. I guess an alternative could be some sort of VPN dongle to put in front of each one.

👤 boxingrock
Shinobi is another option to consider. Besides the typical web gui, it gives you a decent "REST" API, so I ended up building a little flutter app for android which runs on top of a wireguard tunnel back to the site.

The only thing not open source is the cameras and don't hold your breath waiting on something to come out at a decent price. There's only like 5 MFGs that make the actual hardware so most consumer products are rebranded, software locked and sold at a loss to hook you into the subscription. I know Pine64 had some dev kits but nothing you could buy in quantity.


👤 nwmcsween
Reolink cameras using Shinobi as an NVR

👤 your_username
Flussonic might be worth checking out.