diff --git a/content/log/2025/construction-site-surveillance.md b/content/log/2025/construction-site-surveillance.md index 6a7fef3..f13bde8 100644 --- a/content/log/2025/construction-site-surveillance.md +++ b/content/log/2025/construction-site-surveillance.md @@ -4,9 +4,9 @@ date: 2025-02-24T22:01:14+02:00 draft: true --- -I am building a house, for which I decided I need a webcam. I have never set up -a security camera, so have zero knowledge before starting; one good thing — I -knew the requirements pretty well: +I am building a house, for which I decided I need a surveilance cameras. I have +never set up a security camera, so have zero knowledge before starting. Here +are the prelminary requirements *before I started*: - 24/7 on-demand live view, plus some recording: 7 days 24/7, plus some time for when and around "motion" is detected. @@ -17,7 +17,10 @@ knew the requirements pretty well: - Use off-the-shelf hardware, so I am only minimally required to maintain the setup (so no DYI webcams or routers). -# The Setup +This post highlights some things I wish I knew before buying & setting it all +up. + +# The Components Since the building site is "remote" (there is no existing infrastructure besides electricity), networking needs to be self-contained. This is the setup: @@ -39,7 +42,8 @@ besides electricity), networking needs to be self-contained. This is the setup: and why it matters. * One can easily "live view" directly in the camera stream. Cameras can usually record video into a builtin SD card. However, that's not very useful if it - gets vandalized or stolen, so better push that video somewhere safe. + gets vandalized or stolen, so better continuously push that video somewhere + safe. * *NVR* is a Network Video Recorder. Besides the camera, this is the *second most important component*. NVR captures a video stream from the camera, (optionally) detects people and vehicles, and records everything. Since NVR @@ -47,6 +51,21 @@ besides electricity), networking needs to be self-contained. This is the setup: important NVR has a good UX. You don't care about the camera UX after it's set up. +# Video codecs + +There are two codec choices, mostly: + +- *H.264* is a royalty-free video codec from 2003. According to a [reference I + found in Wikipedia][14], it was used by 91% of video industry developers as + of September 2019. Every screen-equipped device that I tried can play it. +- *H.265* (a.k.a. _HEVC_) is a royalty- and patent-ridden codec which offers + 25-50% better compression ratios[15]. In my experience, the compression ratio + was over 50%. It is amazing for transfer, un-playable on everything I've + tried except Google Chrome browser on Android[^1]. +- Footnote: *H.264+*, *H.264B*, *H.264H* and similar. They are "close" + derivatives of H.264. Software support is hit-or-miss, so I mostly ignore + those. + # Picking the camera [A friend of a friend](https://jpg.lt/), who has been setting up security @@ -57,25 +76,27 @@ There are a few variables you may want to check: - Pan, Tilt, Zoom (*PTZ*). Some cameras can change the viewing position remotely. I picked one with PTZ, but more out of curiosity than necessity. Turns out, ONVIF (the "open" protocol to control PTZ cameras) is very poorly - supported with the NVRs I've tried. + supported, or not at all, with the NVRs I've tried. - Resolution versus visibility in low light. [ipcamtalk.com][2] has decent recommendations, start there. - Do your research in the [website][2], there are some great tips. I wish I had known about it, or at least read the Dahua part, before purchasing mine. -Note that being surveillance companies, they unsurprisingly have [bad -reputation in the Chinese-controlled areas][1]. I also found out about it only -while researching open-source NVRs. +Note that most cameras are designed and manufactured in China. Which, +unsurprisingly, have [bad reputation in the Chinese-controlled areas][1]. I +also found out about it only while researching open-source NVRs. # Network Video Recorder Once you've settled on the camera (and the number of cameras), there are mostly -two NVR options: +two options for an NVR: - A dedicated set-top-box-sized device from the camera manufacturer. These are - completely hands-off. A hard drive is usually purchased separately, depending - on how much should be recorded. The UX experience is "it is what it is". I.e. - camera manufacturers may or may not be the best NVR UX designers, especially - when it comes to viewing the recordings or live stream remotely. + completely hands-off in terms of maintenance. A hard drive is usually + purchased separately, depending on how much should be recorded. The UX + experience is "it is what it is". I.e. camera manufacturers may or may not be + the best NVR UX designers, especially when it comes to viewing the recordings + or live stream remotely. However, they will for sure create the best Camera ⇔ + NVR integration. - Open source NVRs, which you can install to your existing home server. I considered [frigate][3], [Moonfire NVR][4] and [ZoneMinder][5]. Since I use a [home server]({{< ref "log/2023/nixos-subjective" >}}), I am self-hosting my @@ -87,8 +108,8 @@ detection, not even "in theory". I have relatively powerful hardware in the closet and want object detection for it. *Frigate* seems to be what the kids use these days. Documentation is extensive, -but sometimes not very accurate. It took a few evenings to get it to work, and -it works. +though sometimes not very accurate, but [their forums][13] compensate for it. +It took a few evenings to get it to work, and it works. *ZoneMinder* is the oldest and most established. I learned about it only after having set up Frigate. @@ -153,3 +174,8 @@ locally. [10]: https://mikrotik.com/product/mant_lte_5o [11]: https://teltonika-networks.com/products/accessories/antenna-options/wi-fi-dual-band-magnetic-sma-antenna [12]: https://headscale.net/stable/ +[13]: https://github.com/blakeblackshear/frigate/discussions +[14]: https://go.bitmovin.com/hubfs/Bitmovin-Video-Developer-Report-2018.pdf +[15]: https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding + +[^1]: or vlc. Thanks to the French who make a point about not caring about royalties