Ever found an awesome project on GitHub, only to set it up and find it's so outdated that a dependancy, image, or software that it depends on is outdated or incompatible?
That's what happened when my wife asked me to setup a camera to see our cat when we're gone. I searched for a project online but wanted something simple. From stage left: github.com/benjamin-maynard/Pi-Camera-in-a-box/.
It's a simple Docker container that pulls in another couple custom-made containers so you don't have to compile ffmpeg and nginx on a low-powered RPI and "save[s] you significant time" Benjamin Maynard Jun 24, 2018
First order of business: Update the Dockerfile to use the new version of the base image (balenalib/rpi-raspbian/ from resin/rpi-raspbian, which doesn't exist anymore). This was a simple change, but it only produced more errors - now the nginx version was out of date with the nginx-rtsp module that was being integrated. I updated the nginx version to the latest version and since the nginx-rtsp module was being pulled directly from it's git repo main branch, I wasn't surprised that it compiled correctly without any errors the first try. Plus, it may have been helpful that I'm compiling on a current-gen Ryzen 7 system with multiple cores and gigawatts of RAM. (For those curious readers, one gigawatt of RAM is about 333,333,333 sticks of RAM, and I have 32GB of RAM, so I have about 0.000000096 gigawatts of RAM in reality.)
With that problem solved, I moved on to the next issue: repackaging the software into a Docker container. I haven't used Docker very much (mostly because everyone was raving about it when I first discovered it, and a natural notion of mine is that if the world is crazy for it, there must be some reason, but I didn't want to be swept up in it. I normally consume Docker-related things in the form of a docker-compose.yml file.) Surprisingly, I had a Docker account tied to an SSO and created my first repo. I then docker login'd and figured out how to build and push at the same time (It's the --push flag for those following along at home).
I pushed it, pulled the repo on my RPI, and ran it. It worked!
... Until it didn't. I knew there were issues with the m3u8
playlist that the nginx-rtsp backend was serving up, but I haven't tackled that yet. The only other time
I've encountered these mystery files is 1: Pulling a playlist to play save using VLC or iTunes, or 2:
Figuring out why youtube-dl fails.
That's for another day.