The Idea
Wouldn’t it be cool to have a dedicated webcam to stream the DnD battlemat to your friends while playing remotely? Online tools like DnDBeyond are good but there’s something about seeing the board that really helps the imagination for me.
Maybe you just want to have your own CCTV camera set up to monitor your front door without having to pay a monthly subscription to Ring (plus, having the freedom to store your footage AND piece of mind knowing exactly who has access to that footage.)
Also hey, we want to learn how to build cool things right? So let’s talk about how to do that.
The Build



This build is pretty simple from a hardware standpoint.
–Raspberrypi Zero 2w– A significant improvement from the Zero w. I actually made an attempt at this project with a zero before and struggled with it until I gave up. Which is silly when the price is a $5 difference at this point. ($10 vs $15)
–Raspberry Pi Camera Module 3– 12 MP camera. I would consider this a solid “mid-range” camera for the RaspberryPi coming in at around $25.
–64 GB MicroSD Card – You can get away with much less. Things should work fine on 16GB or so but I wanted the flexibility of adding more functions to this down the road.
–Power Supply – Okay here I would like to upgrade to a PiSugar or another specialized battery module eventually. But for now my AA – microUSB does the job.
–Case– Easy 3D print
https://www.printables.com/model/16323-cctv-enclosure-for-raspberry-pi-zero-w-with-pi-cam
Software and Code
The libcamera software library is the recommended way to interact with camera modules on the RaspberryPi, and it really is plug-and-play for the most part. The documentation is very clear and gives plenty of options for different projects:
https://www.raspberrypi.com/documentation/computers/camera_software.html
I am interested in doing a video player hosted by this website at some point (or a secret third location). But in order to get something off the ground and learn about how this kind of data is handled, I decided to send it to my personal twitch channel.
I did a bit of tinkering on the commands here until I found something that worked.
Here I ssh’d into the Pizero 2 and opened two terminal windows. The first terminal will capture the data stream that is being produced by the camera module, and the second will send that video data to our target location. You could also run the ffmpeg command in the background and run the next one in the same terminal window, but I was having issues with it and this seemed to run easier for some reason.
Terminal 1: sudo libcamera-vid -t 0 –inline –listen -o tcp://0.0.0.0:8888
Terminal 2: ffmpeg -i tcp://127.0.0.1:8888 -c:v copy -f flv rtmp://live.twitch.tv/app/(Your_unique_stream_key_goes_here)

Terminal 1 should start showing the data flowing through if it’s working correctly
And there it is! Video homebrew that we’re able to send out to the internet with full control over.
Up next in this project:
-Using Google Drive’s API to store our video remotely.
– Saving it locally to a shared folder on the desktop (or NAS)