Better Streaming + Hosting on the Edge

Moving cottage cam to an edge provider ended up being easier than anticipated.

The cottage cam site recently had some changes behind the scenes. Users should notice:

  • 👓 Clearer Streaming Quality
  • 🚀 Faster Load Times
  • 🍿 More recordings

These were made possible to some technical updates that I'll share below!

Technical Improvements

The cottage cam was a nuxt 2 app hosted on Digital Ocean. It moved to 3 during the middle of last year, which brought a lot of opportunities to host on the edge versus the docker container.

I bit the bullet recently, and have made a few key improvements.

🛠️ Splitting the App from the Streaming

The app architecture and the restreamer instance are now separate. I still keep a docker-compose around to allow you to setup both on a dev machine, but they are now deployed separately.

🎥 h.265 Streaming

Streaming h.264 from the cottage is convenient because the restreamer instance didn't have to do any encoding. However, it takes up quite a bit more bandwidth to stream h.264 all day. Now, the camera outputs h.265 saving bandwidth, but needing more CPU in the restreamer.

I upgraded restreamer to restreamer-core, and it is now hosted on a dedicated hetzner vm. After trying a few different providers, hetzner has the best value for needing to be able.

⚡ Web App Hosting on the Edge

Updating to Nuxt 3 for the web app allows for dozens of different deployment combinations to different providers (Thanks to Nitro under the hood). The Digital Ocean box that did host the site via node was limited.

Now, the web app is deployed on vercel and can share caching across different regions. It makes for a much better user experience. While the stream itself will always be more single-threaded risk, the web app is much more reliable now. And, the API still listens for our old friend, the Lake Gauge!

If you'd like to share your story, let me know on the contact page.

back to updates

Copyright © 2023 - All right reserved