Setting up Scrypted NVR on Ubuntu with Docker Compose and Coral TPU

Smart Home
Screenshot of Scrypted NVR camera with event list.

I’ve been using the free version of Scrypted for almost a year to bring my non-HomeKit security cameras and doorbell into HomeKit. I was able to quickly spin up the docker container on my Synology NAS (I’m running a DS918+), add my cameras (mostly Amcrest and a Reolink PoE Doorbell), and then add them to HomeKit. It’s worked great, with fast load times and no downtime issues. My kids get a kick out of hearing our HomePods announce when their grandma is at the door. It’s a fantastic free solution for bridging the gap between HomeKit (or Google Home or Amazon Echo) and numerous camera brands that don’t natively support it.

iPhone screenshot of Amcrest security camera in the Home app via Scrypted's HomeKit accessory bridge.
One of my non-HomeKit Amcrest security cameras added to the iOS Home app via Scrypted’s free HomeKit accessory bridge feature.

The developer has also created a subscription-based NVR solution that seems simple, responsive, and aligns with most of my goals for my security camera solution–local storage, smart person/object detection, notifications, and optional remote access. After running Blue Iris as a 24/7 NVR for the past couple of years, I decided to see if Scrypted could handle my NVR needs in addition to bringing my camera streams into HomeKit. To do this, I decided to backup Windows with Blue Iris–just in case I want to go back to it–and then install Ubuntu Desktop 22.04 onto my Blue Iris hardware (a refurbished Dell Optiplex 7050 with a Seagate Skyhawk HDD hooked up to a cheap monitor/keyboard/mouse) and follow the Scrypted documentation for installing on Linux using Docker Compose.

I downloaded the ISO for Ubuntu Desktop 22.04, flashed it to a USB flash drive using Etcher, then installed it to the SSD in my former Blue Iris computer. After completing the installation for Ubuntu, I wanted to change the file system of the internal HDD for recordings from NTFS (created by Windows) to ext4 which has faster performance on Linux–important for disk-intensive tasks like 24/7 recording and playback. I used the Disks application in Ubuntu to format the HDD and create a new partition using the entire disk space with ext4 as the file system. Careful, this wipes all Blue Iris recordings on the drive!

Now that the HDD was ready to be used, I needed to make sure it gets mounted automatically on boot; Ubuntu Desktop 22.04 does not do this by default. I followed some instructions to do this using fstab, and everything was ready for the Scrypted install script. Note that these instructions may prevent the computer from booting if the HDD fails or is unplugged and you will have to manually update fstab to boot into the desktop again–you can just comment out the line that mounts the HDD.

I ran the install script, modifying the docker-compose.yml file to use the mounted HDD in the volumes section. Mine ended up being at /media/nvr/NVR_STORAGE. I signed up for a Scrypted NVR subscription, configured my cameras, and saw that object detection was working great using the default setting (OpenVINO in my case using the Intel CPU/iGPU).

Coral Edge TPU

I’ve had a USB Coral Edge TPU for a few years. I first used it with Frigate, but it has been sitting in a closet since I switched to Blue Iris with DeepStack (and later Codeproject.AI) on an nVidia GPU. I wanted to take advantage of it with Scrypted, and a post on the Scrypted NVR Discord channel mentioned that Scrypted can use OpenVINO with an Intel CPU and TensorFlow Lite with a Coral TPU alongside each other for object detection. The developer does not recommend the USB version of the Coral TPU due to lesser performance, but I figured it would work OK alongside OpenVINO instead of on its own, and take a little load off the CPU. Maybe this won’t be a great solution long-term, but for now I wanted to try it.

To pass the Coral USB device into the docker container, I had to install the drivers for it in Ubuntu, then uncomment this line in the docker-compose.yml file under the devices section: "/dev/bus/usb:/dev/bus/usb",. I also had to add privileged: true to the file; I added it right before the environnment: section.

Scrypted privileged setting in docker-compose.yml

A quick docker compose down and docker compose up got things up and running. Then in Scrypted, I had to change the Settings for the Scrypted NVR plugin to use Tensorflow-lite for object detection, reload the Scrypted NVR plugin, then switch the object detection back to Default and reload the Scrypted NVR plugin again. After this I was seeing both OpenVINO and Tensorflow Lite used for object detection in the console.

Set the NVR plugin’s object detector to tensorflow-lite and reload the plugin.
Finally, set the NVR plugin’s object detector back to default and reload the plugin again.

Final Thoughts

I’ve been running Scrypted as my NVR solution for several weeks now, and it has done the job well. For me, there are several key differences from Blue Iris with their own pros/cons, but for now I’m sticking with Scrypted:

  • Scrypted’s NVR feature is subscription-based, meaning the NVR stops working if I don’t renew my subscription (free features still work, but no recordings!). Blue Iris is sort of a hybrid where you pay for a license that comes with up to 1 year of software updates, then after that you can renew the license each year for further updates. If you don’t, you still get to use the last version of Blue Iris that you have installed with all of its features.
  • Scrypted records high-res and low-res streams 24/7, unlike Blue Iris which I had configured to record just the low-res stream until motion was detected and then record the high-res stream. The result is that Scrypted uses up much more disk space per hour than Blue Iris. I’ll be upgrading my HDD to a larger one as a result.
  • I prefer the UI in the Scrypted iOS app compared to the Blue Iris iOS app overall, and rich notifications “just work” without any port forwarding, VPN, etc (I assume this is the NVR/Cloud plugin handling things automatically).
  • Scrypted does not have as many options to trigger cameras, or if it does, they are not documented or explained well. Blue Iris made it easy to set up tripwires, for example, whereas I have not seen a good tutorial for doing the same using Scrypted.
  • Scrypted has a Home Assistant add-on, custom integration, and custom cards maintained by the developer, while Blue Iris relies on manually setting up MQTT or a custom integration created by a third party developer to integrate with Home Assistant.
  • Documentation and community support for Blue Iris is extensive, whereas Scrypted is a newer project with less comprehensive documentation and a smaller community of users so far.
  • The developer for Scrypted is very active in the app’s Discord and responds quickly to questions or support requests there. Other community members also chime in to help frequently. I’m not aware of a similar experience with Blue Iris’ developer besides email support for licensed users.
  • I had one automatic update for Scrypted completely take down the NVR, and I was not the only one. It would not restart itself until I manually stopped the docker container, pulled the latest update which had the fix, and started up the container again. Kudos to the developer for rolling out a fix within hours, and Watchtower may have fixed this eventually on its own, but I may reconsider using auto-updates from now on. Other than that it has been reliable through dozens of other updates. Blue Iris would crash or stop working and restart itself (it was set up as a Windows service) every couple of days, even on a fresh Windows installation and minimal camera configuration while I troubleshooted the issue. 🤷🏻‍♂️
Photo of two Amcrest security cameras mounted under roof soffit
A couple of my Amcrest security cameras just after I installed them.

Comments

  1. fantastic article, thank you. For quite a while I am using Frigate/Coral-TPU on an I5-Intel NUC which is dedicated for Home Assistant in parallel with BlueIris/Codeproject on a Win10 PC. I liked both because they seem to complete each other very well for my needs. However, recently I upgraded Codeproject to 2.6.2 and it appears to me that at the same time object detection stopped working even though Codeproject says it is online and working. Now, among other ideas how to continue, I am thinking about the same way you are describing here.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*