<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Brian on Medium]]></title>
        <description><![CDATA[Stories by Brian on Medium]]></description>
        <link>https://medium.com/@beegeenz?source=rss-6feb48c6f3ea------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fJB7CeJTfnxPB1vf5NLRhA.jpeg</url>
            <title>Stories by Brian on Medium</title>
            <link>https://medium.com/@beegeenz?source=rss-6feb48c6f3ea------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 00:00:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@beegeenz/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Optimising the Rockchip RK3588 SBC for Frigate NVR: CPU, GPU, NPU and VPU offloading.]]></title>
            <link>https://medium.com/@beegeenz/optimising-the-rockchip-rk3588-sbc-for-frigate-nvr-cpu-gpu-npu-and-vpu-offloading-ee226ee85cf1?source=rss-6feb48c6f3ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee226ee85cf1</guid>
            <category><![CDATA[low-power]]></category>
            <category><![CDATA[diy-projects]]></category>
            <category><![CDATA[network-video-recorder]]></category>
            <category><![CDATA[npu]]></category>
            <category><![CDATA[single-board-computer]]></category>
            <dc:creator><![CDATA[Brian]]></dc:creator>
            <pubDate>Sat, 27 Jun 2026 04:36:16 GMT</pubDate>
            <atom:updated>2026-06-27T04:36:16.011Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How I turned a low cost SBC into a hardware-accelerated Network Video Recorder (NVR). Offloading video decoding, object detection, and transcoding to the CPU, GPU, and NPU and drawing under 10W at full load.</em></p><p>Most home NVRs force you to choose: buy a power-hungry x86 mini-PC, or settle for a basic recorder with no AI. I wanted; , 8-channel 1080p recording, real-time motion and object detection with extension capabilities into license plate recognition, facial recognition and AI linkage. All without the heat, noise or large power draw. The answer was hiding in a ‘hobbyist level’ single-board computer with dedicated hardware and onboard AI silicon</p><p>My design goals were simple but demanding:</p><ul><li><strong>8 × 1080p 25fps recording streams</strong> plus <strong>8 × 640×480 5fps detection streams</strong></li><li>Motion filtering, object detection, and transcoding <strong>entirely on-device</strong></li><li>Deliver <strong>real-time</strong> facial, pet, and license plate recognition</li><li>Integrate cleanly with <strong>Home Assistant</strong></li><li>Run like an appliance: <strong>&lt;10W loaded</strong>, silent, and thermally stable even during hot Sydney summers</li></ul><h4><strong>Why the ArmSOM Sige7?</strong></h4><p>The Sige7 from ArmSOM fits this brief because Rockchip’s RK3588 isn’t just a CPU — it’s a media SoC with lots of compute and dedicated co-processors:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n_KPx4ctW9njm00aJbxFHQ.png" /><figcaption>Rockchip RK3588 specifications</figcaption></figure><p>A huge thanks to Platima Tinkers for the board introduction: <a href="https://www.youtube.com/watch?v=dwth8_nQvG4">https://www.youtube.com/watch?v=dwth8_nQvG4</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*mv9LqfnlLATPxyRUvgzLWw.png" /><figcaption>External cameras view</figcaption></figure><h3>Step 1: NVMe Boot (Skip the SD Card)</h3><p>ArmSOM ships firmware configured to support SD or eMMC boot, but an NVMe SSD is faster to boot and much better at handling sustained multi-channel writes. The process to configure for NVMe boot is straightforward using Joshua Riek’s Ubuntu Server 24.04 image which includes an ubuntu rockchip installer;</p><p>a. Flash the Ubuntu Server image to an SD Card and boot from it</p><p>b. Clone the running system to NVMe with the following command:</p><pre>sudo ubuntu-rockchip-install /dev/nvme0n1</pre><p>c. Flash the U-Boot loader to the eMMC so the board boots directly from NVMe:</p><pre>cd /usr/lib/u-boot<br>sudo dd if=idbloader.img of=/dev/mmcblk0 seek=64 conv=notrunc<br>sudo dd if=u-boot.itb of=/dev/mmcblk0 seek=16384 conv=notrunc</pre><p>d. Remove the SD card and reboot. lsblk<strong> </strong>should show the root filesystem on nvme0n1p2.</p><p>That’s it. The board now boots in seconds from the NVMe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6iBnJlG-X2nzAm8ydZWtxw.png" /><figcaption>lsblk showing nvme0n1p2 as / root</figcaption></figure><h3>Step 2: Cooling and OS Tuning</h3><p><strong>a. Cooling.</strong> Sydney summers regularly exceed 40°C so I installed the ArmSOM active cooling kit which is a low-profile heatsink with builtin PWM fan for only $12. On Joshua Riek’s image, the kernel device tree handles fan curves natively with no fancontrol daemon required. The standard presets are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*zUNArz-Ebr3aCcydFpHNpA.png" /><figcaption>Ubuntu Server default fan speeds</figcaption></figure><p><strong>b. Memory Tuning.</strong></p><p><strong>Docker shm_size.</strong> In the compose file I set shm_size: &quot;512mb&quot;. This is generous for the 8 x 640x480 detection streams and can support a camera or two at the higher 1080p detection (for example if required for License Plate Recognition at distance).</p><p><strong>Frigate tmpfs swap size.</strong> Within the frigate config file set the tmpfs size: 26843545. Frigate uses tmpfs as a ram-drive to store recording camera streams. With 8 cameras a 256mb tmpfs is enought for 1–2 minutes. As the queue is flushed to SSD every 10 seconds this is ample headroom and a reduction from the Ubuntu default.</p><p><strong>OS Swap file.</strong> As a final guard-rail to protect from out-of-memory errors I implemented an 8GB swapfile with low swappiness.</p><p>LPR and facial recognition each take RAM so there is a possibility of running out of memory if everything is happening at once. A swap file provides final insurance that the system will remain stable.</p><pre>sudo fallocate -l 8G /swapfile<br>sudo chmod 600 /swapfile<br>sudo mkswap /swapfile &amp;&amp; sudo swapon /swapfile<br>echo &#39;/swapfile none swap sw 0 0&#39; | sudo tee -a /etc/fstab<br>echo &quot;vm.swappiness=10&quot; | sudo tee -a /etc/sysctl.conf &amp;&amp; sudo sysctl -p</pre><h3>Step 3: Docker and Optional Monitoring</h3><p>The system runs Frigate in Docker with a simple folder structure under /home/ubuntu/smarthome/ (~.smarthome/). Install Docker from the official repository, then add your user to the docker group.</p><p>I also run a lightweight monitoring stack:</p><ul><li>Portainer (:9000) — container GUI</li><li>Beszel (:8090) — server monitoring platform with graphics</li><li>Glances (:61208) — deep system metrics</li><li>Scrutiny (:8080) — NVMe SMART monitoring</li><li>Duplicati (:8200) — encrypted cloud backups</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n-ANAIoA0uqdqUdE_1-40w.png" /><figcaption>Beszel monitoring of Frigate NVR</figcaption></figure><h3>Step 4: Frigate with RK3588 Hardware Offload</h3><p>This is where the magic happens. The Frigate stable-rk image supports Rockchip’s VPU, NPU, and GPU out of the box.</p><p>Here is mu woprking Docker Compose file.<br>Key points: privileged: true, network_mode: host, and mapping the specific /dev/ nodes for the RK3588 media pipeline for the respective hardware offloading.</p><pre>services:<br>  frigate:<br>    container_name: frigate<br>    network_mode: host<br>    privileged: true<br>    restart: unless-stopped<br>    stop_grace_period: 30s<br>    image: ghcr.io/blakeblackshear/frigate:stable-rk<br>    platform: linux/arm64<br>    shm_size: &quot;512mb&quot;<br>    security_opt:<br>      - apparmor=unconfined<br>      - systempaths=unconfined<br>    devices:<br>      - /dev/rknpu:/dev/rknpu<br>      - /dev/dri:/dev/dri<br>      - /dev/mali0:/dev/mali0<br>      - /dev/dma_heap:/dev/dma_heap<br>      - /dev/mpp_service:/dev/mpp_service<br>      - /dev/rga:/dev/rga<br>      - /dev/bus/usb:/dev/bus/usb<br>    volumes:<br>      - /sys:/sys:ro<br>      - /etc/localtime:/etc/localtime:ro<br>      - /home/ubuntu/smarthome/frigate/config:/config<br>      - /home/ubuntu/smarthome/frigate/storage:/media/frigate<br>      - type: tmpfs<br>        target: /tmp/cache<br>        tmpfs:<br>          size: 268435456<br>    environment:<br>      FRIGATE_RTSP_PASSWORD: &quot;password-here&quot;<br>    healthcheck:<br>      test: [&quot;CMD-SHELL&quot;, &quot;python3 -c &#39;import socket; s = socket.socket(); s.connect((\&quot;127.0.0.1\&quot;, 5000))&#39; || exit 1&quot;]<br>      interval: 30s<br>      timeout: 10s<br>      retries: 3<br>      start_period: 45s</pre><p><strong>For the Frigate config file, here are some key snippets from config.yml </strong>for optimal Frigate setup.<br>Tell Frigate to use the hardware decoder and the 3-core NPU:</p><pre>ffmpeg:<br>  hwaccel_args: preset-rk-h264<br><br>detectors:<br>  rknn:<br>    type: rknn<br>    num_cores: 3</pre><p>Enable enhanced features:</p><pre>lpr:<br>  enabled: true<br>  model_size: small<br><br>face_recognition:<br>  enabled: true<br>  model_size: large<br>  detection_threshold: 0.7<br>  recognition_threshold: 0.85<br>  min_area: 500</pre><p>Use go2rtc to pull both high-res (record) and low-res (detect) streams from each camera. Frigate becomes the single client connecting to the camera; everything else — Home Assistant, browsers, mobile apps — reads from Frigate’s restream. This slashes camera CPU load and lets the VPU handle all inbound compression.</p><pre>go2rtc:<br>  ffmpeg:<br>    bin: /usr/lib/ffmpeg/7.0/bin/ffmpeg<br>  streams:<br>    garage_hires: rtsp://user:pass@ip:554/av_stream1/ch0<br>    garage_detect: rtsp://user:pass@ip:554/av_stream2/ch1<br>    # ... repeat for all cameras</pre><p>I keep Birdseye on continuous mode with restream: true so the dashboard is available to LAN users as a camera stream which can display on any browser, including the family TV.</p><pre>birdseye:<br>  enabled: true<br>  restream: true<br>  idle_heartbeat_fps: 2<br>  mode: continuous</pre><p>Frigate metrics view shows the CPU and GPU just idlingduring normal daily operation…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5jMtcj1bLP7FtEM5FmnMVw.png" /><figcaption>Frigate Metrics view</figcaption></figure><h3>Step 5: Camera Tuning and Network Isolation</h3><p>My first four-camera setup failed with continuous board overloading and overheating: wind-triggered motion on trees and shrubs saturated the CPU because every pixel change was fed to object detection.</p><p>The following fixes were simple but transformative:</p><ol><li><strong>Detection masks</strong> in Frigate to ignore swaying foliage, reducing CPU load</li><li><strong>Resolution split</strong>: 1080p H.265 for recording; 640×480 H.264 at 5fps for detection. Object recognition works fine on 640 x 480</li><li><strong>Substreams for clients</strong>: Household devices range from PCs and phones to a Samsung AI fridge and NS PanelPro. Standardizing on the low-res H.264 detect stream guarantees universal compatibility.</li></ol><p>With eight cameras running, inbound traffic is only ~18 Mbps—not a big load for 2.5GbE. Still, for security and to keep video off the family Wi-Fi, I connected the POE cameras to a small managed switch on the <strong>second Sige7 ethernet port</strong>. Camera traffic is completely isolated now and with the PoE management software I can even power-cycle individual cameras remotely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R8J1Z63W0c6PM82TWh9JXQ.png" /></figure><h3>Step 6: Backing Up a Live Database</h3><p>Frigate uses SQLite, and copying a live .db file will corrupt it. The Duplicati backup uses two shell scripts to snapshot the database cleanly:</p><ul><li><strong>Pre-backup</strong>: docker exec frigate sqlite3 /config/frigate.db &quot;.backup &#39;/config/frigate_backup.db&#39;&quot;</li><li><strong>Post-backup</strong>: Delete the temporary snapshot.</li></ul><p>Duplicati grabs the media folders and the static snapshot, excluding the transient /frigate/media/cache. To restore, you stop Frigate, restore the snapshot, and run a SQLite VACUUM INTO to rebuild the live database.</p><h3>Results: An Appliance-Grade NVR</h3><p>By distributing work across the RK3588’s dedicated silicon and using the SoC onbaord hardware for all the heavy lifting, the system barely sweats:</p><p>Typical Load is;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pQoxyOoVOPd4pfoOEEj0UA.png" /><figcaption>Typical Sige7 load</figcaption></figure><p>The system boots in seconds and simply stays up. After months of operation, I’ve stopped SSHing in to check on it.</p><h3>Future Upgrades</h3><p>With headroom remaining, I’m expanding the system:</p><ul><li><strong>Indoor POE cameras</strong> to broaden coverage and for cat tracking</li><li><strong>Garage door state detection</strong>: Training Frigate’s model to recognize open/closed states as the house has no door sensors. The Frigate status can feed directly into Home Assistant security automations</li><li><strong>Mail/courier alerts</strong>: Frigate supports monitoring Loitering zones on the camera feeds which can trigger WhatsApp messages with snapshots. Using external AI calls to analyse the images to determine courier vs. regular mail</li><li><strong>Smart arrival</strong>: LPR identifies the family car in the driveway fast enough and opens the garage door on arrival (target &lt;2 seconds).</li><li><strong>Cat finder</strong>: With indoor cameras, I can query the last-known location of our hiding cat by working backward through detection events—no GPS collar required.</li></ul><h3>Conclusion</h3><p>Building an AI NVR doesn’t require an expensive x86 server or cloud subscriptions. The Rockchip RK3588—when properly configured—turns the ArmSOM Sige7 into a genuinely appliance-grade platform: silent, stable, sub-10W, and capable of real-time object detection across eight cameras. The key was respecting the hardware architecture: let the <strong>VPU</strong> decode, the <strong>NPU</strong> infer, the <strong>GPU</strong> render, and keep the CPU almost idle.</p><p>ArmSOM’s documentation rewards patience, and using the pre-built Ubuntu images remove much of the kernel-level grunt work. If you’re comfortable with Docker and YAML, this is one of the most cost-effective ways to add privacy-first, local AI surveillance to a smart home.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee226ee85cf1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>