6 ms·
Open Source security camera on Raspberry Pi
- hcfman 2y agoVery nice to be able to see how to do this C.
- Sean-Der 2y agoCheck out the initial commit of https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c https://github.com/awslabs/amazon-kinesis-video-streams-webr... it was Pure C and simple. Early versions of https://github.com/pion/webrtc https://github.com/pion/webrtc used lots of cgo its an enjoyable read I find. The glue is higher level (interesting part) but the parts you don’t need the details on (DTLS, SRTP….) are abstracted away
- atum47 2y agoI was working on a similar think a while back [1] I was living in an apartment while building my house. My idea was to have a camera making a time lapse video with the secondary effect of being able to be accessed by me from the internet so I can take a look at how the crew was doing. Unfortunately every single ideia that I have is already had and developed by anybody else. In this case, china. Ali express have some pretty good cameras that does that and more; with a better finish then a 3D print shitty case... 1 https://youtube.com/watch?v=5E7_40PWqiQ https://youtube.com/watch?v=5E7_40PWqiQ
- marcodiego 2y agoSome (maybe most or all) of these devices require an external service to be used. That means it will work as longs as the service exists. You are in the hands of the vendor. My dream is to make devices like this and make them remotely accessible through Tor; that way it can be fully local but remotely accessible from anywhere in the world.
- idunnoman1222 2y agoWhy did you throw Tor in there?
- marcodiego 2y agoBecause that gives me independence with a decentralized service.
- roywashere 2y agoExposing a service to tor is actually useful as a way to circumvent NAT issues
- fimdomeio 2y agoThe other option would probably be a vpn.
- atum47 2y agoI have a 6 dollars month VPS on digital ocean that I use for everything. Host my website, send server events to my devices, socket connections...
- amluto 2y agoA lot of cheap Chinese cameras work just fine without ever being connected to the Internet. Look for ONVIF.
- Sean-Der 2y agoONVIF is getting WebRTC [0]! So you will be able to use it in your LAN (or over ) without using proprietary middleware :) [0] https://www.onvif.org/specs/stream/ONVIF-WebRTC-Spec.pdf https://www.onvif.org/specs/stream/ONVIF-WebRTC-Spec.pdf
- amluto 2y agoChallenge for open source developers: make a nice system for using this feature without connecting the camera to the Internet. :)
- jchoksi 2y agoAn alternative project I was looking to use with my Raspberry Pi Zero WH's was mediamtx. https://github.com/bluenviron/mediamtx?tab=readme-ov-file#raspberry-pi-cameras https://github.com/bluenviron/mediamtx?tab=readme-ov-file#ra...
- nubinetwork 2y ago> Raspberry Pi 5 [...] do not support v4l2 hardware encoding I'm not sure I get the point of that... they go through the effort for video decoding, but why doesn't it have an encoder?
- bmh 2y agoThey decided to use the silicon space for other things. The Pi5 CPU is powerful enough to decode most h264 streams in software. The Pi5 has an h265 hardware decoder.
- hcfman 2y agoShame. Cause h265 is problematic wrt licensing etc. I would have preferred that they kick out h265 and used the silicon for h264. And maybe the pi5 has enough cpu to do the decoding. But how much would be left over for more interesting AI tasks ?
- bmh 2y agoI agree 100%
- moffkalast 2y agoWell it's not fast enough for most AI tasks as it is, you'd need to offload that bit to a pcie accelerator.
- hcfman 2y agoNot true actually. If by offloading you mean to a device that uses a really small model with 8-bit quantized weights you are not actually solving anything.
- knowitnone 2y agosure it's powerful enough but I'd rather it built into the hardware for energy efficiency. But I guess we can't have our cake.
- 2y ago
- gz5 2y agonice use of WebRTC, which somehow is still underutilized. >If you're self-hosting and you want to access the signaling server remotely via mobile data, you may need to set up DDNS and port forwarding if your ISP provides a dynamic IP. this also exposes your server to the internet. instead you can use one of the open source solutions which creates a private connection between your Pi and server (so there is no network access to the server - make it unreachable), and doesn't require static IPs or port forwarding.
- Sean-Der 2y agoIt’s my passion in life to see WebRTC utilized to its full potential! When I learned about P2P/NAT Traversal I could never go back :) Why do you think it’s had trouble? Poor software, educational materials etc… always looking for new projects
- gz5 2y agoi believe the p2p strengths should play better with other in-progress tech transitions - e.g. transition of all thick apps to the browser, decentralized identity, micropayments, distributed IoT and IIoT devices. what do you think?
- IgorPartola 2y agoWe need wider IPv6 deployment now. If only someone like Zoom put their foot down and said “our shit doesn’t work without IPv6” we would see 90% deployment virtually overnight.
- hnuser123456 2y agoOf course, the catch being zoom would not become the most popular tool if it didn't support ipv4...
- tzuhuantai 2y agoIf you build the mqtt server on the pi, the problem is solved :)
- yu3zhou4 2y agoNeat, I was looking for exactly something like this to run person detection! I'm using yolov3-tiny, not quite a new but very lightweight computer vision ML model, and just right now I'm trying to maximize performance of inference with C++, to perform real-time person detection around my house (I want to know when someone enters the parcel at night so a siren and lights can turn on automatically to deter the intruder) - https://github.com/jmaczan/yolov3-tiny-openvino https://github.com/jmaczan/yolov3-tiny-openvino
- 6510 2y agoMade me think of alarms randomly going of in the middle of the night. Then had this thought, imagine triggering lights and siren gradually as one approaches. That way it can trigger much earlier and give a could-be intruder enough signal to stay away. I suspect gradual adrenaline in a feedback loop is more effective too. A sudden effect only needs to be considered once.
- yu3zhou4 2y agoThis is interesting approach! I'd be worried that they would manage to hide in some camera dead zones if I don't react with all-in (siren, all lights etc) quickly enough
- hcfman 2y agovery small amount of code to make a functional webrtc implementation.
- Sean-Der 2y agoI love that WebRTC re-uses existing IETF standards. Makes it easy to plug existing pieces together. I tried to capture that with webrtcforthecurious.com breaking it down by subsystem. I should do a companion piece ‘Build yourself a WebRTC’ that shows how to build WebRTC yourself in Python or other popular language.
- hcfman 2y agoNice work! I’ll be reading this
- bityard 2y agoA while back, I had the need to remotely monitor a house while it was under renovation. A few friends of mine recommended a particular brand of highly-advertised security system. It was not cheap. As I was setting it up, I found out that most of the features that I wanted required broadband internet. This was not disclosed in ANY of the marketing materials. This house didn't have Internet and I wasn't going to purchase it because it would have been $60 minimum on top of the $40 or so the security system was going to cost. What I did instead: I bought a Raspberry Pi camera, hooked it up to a RPi Zero 2W that I already had, bought an LTE hotspot and a $5/mo prepaid SIM from T-Mobile. On the software side, I used imgcomp (https://github.com/Matthias-Wandel/imgcomp https://github.com/Matthias-Wandel/imgcomp) to take a photo every second and save it to a RAM disk. If the two pictures differed (modulo noise), the Pi would upload the changed picture to a directory on my VPS, which would then trigger a notification to my phone via Gotify containing the link to the picture. It was all very Rube Goldbergian but it worked quite flawlessly for a couple of years.
- Topgamer7 2y agoIs not all tech basically rube goldbergy XD
- ptero 2y agoVery cool! This is, IMO, perfectly in the spirit of all tinkerers and hackers, building their own solutions when they need from what they have. There is nothing Rube Goldbergian about this. My 2c.
- zeagle 2y agoThat's pretty nifty. Now a days I'd say you could probably then run it through codeproject.ai's GPU or TPU based coral module after.
- bongodongobob 2y agoWere you expecting to monitor the cameras over the Internet without an Internet connection? This reads like you were expecting the cameras to have built in LTE without some kind of subscription.
- Abismith 2y ago[dead]
- OhNoNotAgain_99 2y ago[dead]
- rubicks 2y agoI'm interested in doing something similar, except using a board with open-source firmware. What kind of options do I have (if any)?
- Sean-Der 2y agoI’m working on this! A WebRTC implementation for my microcontrollers exist https://github.com/sepfy/libpeer https://github.com/sepfy/libpeer it requires more work to use then most want (but it is the perfect building block for higher pieces) I am trying to make it easier with a SDK for LiveKit https://github.com/sean-der/embedded-sdk https://github.com/sean-der/embedded-sdk
- codelion 2y agoThis is very cool, I had worked on something similar back at https://securade.ai https://securade.ai using a Nvidia Jetson as the edge device. I am now excited about reCamera - https://www.seeedstudio.com/blog/recamera/ https://www.seeedstudio.com/blog/recamera/
- ezst 2y agoI've been using https://github.com/TinkerTurtle/Sentry-Picam https://github.com/TinkerTurtle/Sentry-Picam for a similar purpose with great success. The recorded images/videos folder is syncing up with 3 other machines for redundancy using syncthing, and I hooked-up a push notifications script based on sendxmpp to have alerts on all my devices in real-time if something happens.
- aa-jv 2y agoI recently built an always-on recording device, primarily for recording audio consistently and constantly - this is not for surveillance purposes, but rather for musicians and creatives who don't want to have to remember to press the Record button in the middle of a great performance. I used the Zero-W and some tricky shell scripts pushing arecord/aplay around, with a turboLua front-end, and .. it works pretty well! I set it up to record continuously, deleting audio content only once it gets 'stale' as per the users preferences, with options ranging from 1 minute - 5 minutes - 15 minutes - 30 minutes - 1 hour - 3 hours - 5 hours - 24 hours .. and built a front-end to allow the user to Keep the time-period they feel they might have captured something great. This heuristic is somewhat similar to the deadman-switch/security-camera mechanism used in a lot of surveillance products. It works so well, I kind of wonder why its not really a standard already. I guess there is still a kind of 'economy preference' where folks don't really want to fill up their storage space, but these days 128Gigs can go a long way. I'm pretty sure this heuristic should become a norm, one of these days. Its so inspiring to set up, forget, and then - after a few hours of jamming - come back and find the stuff you want to keep, having all the rest of the house-keeping done for you.
- Dowwie 2y agoIf I just want to record sound, is webrtc a good solution for that?
- deleted 2y ago[deleted]
- rzr999 2y agoLet's not forget the old RPi Cam web interface project. It's a really old one but it's still running on my Pis. It's running in a perinneal environment so it doesn't ruin the SD card it's on, while saving to a server. The interface is also neat. https://elinux.org/RPi-Cam-Web-Interface https://elinux.org/RPi-Cam-Web-Interface