Using Bunny CDN to embed and stream videos on static websites
As with other such posts on my blog, this is not sponsored in any way, I just write about the things I personally use and think are worth sharing.
In the process of rewriting my blog I changed how I host my videos.
I currently have two posts with embedded short videos:
How to make a timelapse with a Raspberry Pi
I started using ESPhome and now I have a local smarthome
Previously I stored the video files in the CDN's storage (first Cloudfront, then Bunny CDN, here is the blog post about switching my CDNs) and served them using the video.js library. This in general worked, and I had no issues with it, but when rewriting the blog I wanted to try out something else, and I saw that Bunny CDN has a dedicated service for hosting videos: Bunny Stream.
Bunny Stream is a service that allows to upload videos to Bunny, and then the rabbit handles streaming them through their own player. The player can then be embedded in a website by adding the generated code snippet. There is a few options to edit the player, change the thumbnail, set autoplay on or off, play in a loop. You can even add chapters and subtitles. Also with subtitles, Bunny offers autogenerating subtitles using machine learning for an additional cost.
As for the cost, the hare company always chargers 1 USD minimum with any incurred cost on top of that. They have a calculator that allows to forecast the monthly cost based on the video size and traffic. And again, for people like me who would like to serve a few videos on a less than popular site, the monthly costs should not exceed 2-3 USD, which I found reasonable. In my case, I have not exceeded a few cents of costs for video streaming yet. I will be monitoring the costs and if they become unacceptable high, I will write another blog post.
Here's how the player looks and works: I haven't made any interesting videos recently, so I dug up something fun from my archive.
A short video I made in 2021 during one of the Pride events.
Why am I sharing this?
One of the reasons why I am writing about hosting videos this way is the lack of good, open PeerTube instances.
PeerTube is a federated platform for hosting videos, one could call it the
Youtube of the Fediverse. The issue is that hosting and streaming videos
requires much more significant resources that text or images, and so there
aren't many people willing to do it. The Polish part of the Fediverse had
tube.pol.social, but that ended with the general demise of pol.social.
And so I think that using Bunny Stream and embedding videos on a personal site is a reasonably cheap and easy to implement alternative for PeerTube, for people like me who have just a few short videos and want to put them online. Of course the open source and federation aspects are lost, but embedding videos on a personal static website keeps it POSSE. So it's better than nothing, you keep control over your content and not give it to the whims of the Algorithm like on Youtube.
Thanks for reading!
Previous: Human JSON - community against AI generated content