Live Streaming Video with Nginx

My wife was in the hospital recently and missed watching the birds and squirrels who visit our bird feeders. So we decided to set up a live stream she could watch while in the hospital.

At the time I didn't know anything about streaming video, but I did know its possible. I also knew I didn't want to go through a normal platform like YouTube for this, I wanted it to be private (as in Big Tech doesn't have my data) but shareable with a url. After some searching, I ran across this DigitalOcean article which was exactly what I needed!

First I had to get my GoPro working as a webcam, which turns out GoPro has a small utility for this. I then hooked the GoPro up to OBS (Open Broadcaster Software) which lets you stream the video to an RTMP server. The DO article covers this as well as showing how to set up the RTMP server via an Nginx module. I skipped the part about streaming with ffmpeg and went straight to serving from OBS. I used a small DO droplet ($7), installed Nginx, then followed the article. At the end I had a working RTMP server! But having somewhere to send the video is only half the battle, I still needed to figure out how to serve it. The article does get HLS set up (HTTP Live Streaming) with Nginx, but how to view the resulting HLS stream?

This is where Video.js comes in. I created a super simple webpage where I hooked up Video.js to to the HLS stream, pushed the webpage up to Netlify and, after a few iterations, had a working video stream! You can see the site at birds.alleysmith.family, but it probably isn't live now.

Dan Smith

Dan Smith

Cleveland, OH
Find me on Mastodon