Again, I’ve not written here for a while. I would say ‘I should get better at that’ but I’ve been doing this long enough to know I probably won’t. Maybe I’ll just stop pointing it out. For today, I’m going to talk about a few little bits and pieces that I’ve built for OWMCC - the cricket club I sometimes call my own. This season, while failing to meet my aim of playing ten matches, I have also taken on the task of getting the matches streamed on YouTube and on play-cricket. It has given me a chance to be a bit geeky, and play around with a few things.

Before I go too far, if anyone who knows anything about Frogbox, NV Play, or cricket streaming generally, reads this you may know that there are straight forward ways to do some of the things I mention. But generally they cost more money than we wanted to spend AND give me less pleasure while setting things up.

The camera set up is pretty straight forward, with a Hollyland Pyro wireless transmitter system connecting a camera to a computer. The camera feed goes into a computer which runs play-cricket’s scorerpro software. This is the part that makes loads of people say “Why don’t you just use Frogbox? It’s really simple”. Scorerpro, unlike the Frogbox system, works alongside the laptop software that the majority of Oughtibridge scorers use on a weekly basis (I won’t start the debate about that here, but I am firmly on the laptop software side of it… from our experience it is far more reliable than the app based stuff)

Scorerpro is really good for video integration, it handles streaming to YouTube and adding to the match centre of play-cricket. It requires an NV Play subscription but that doesn’t cost a massive amount per season.

Anyway. To the point - where I actually get to write code… I’ve written three things for this.

A how to website
This was the simple bit, and also the bit that isn’t really finished. It’s a pretty basic Netlify setup, with Astro running as a flat site builder. Visually clean, and used to share some instructions on things like how to set up the cameras, how to set up the streaming computer, and what to do if things don’t work. It also contains a couple of quick links to other parts of the set up (more on that in a minute). This will be improved a little bit when I move the site over to Cloudflare!

A backend Laravel system
This is where things got a little bit more interesting. Initially I vibe coded a Python script that would take a fixture list (in CSV format) and interact with the YouTube API to create stream events for each match in the file. This worked well enough but there were still loads of manual bits needed so I created a Laravel Site (running on Forge) that handles this CSV. This in turn does a bunch of things:

  • Creates the stream events
  • Creates a PNG for the stream event title card
  • Handles the stream keys needed for the live streaming
  • Serves a protected API endpoint that delivers the stream key and embed code

I used the Laravel Starter Kit to get things going, forced some two factor authentication for the dashboard and created my own kind of middleware authentication requirement for the API endpoint. The API can also only be accessed by a site coming from localhost on a specific port. It’s not the most secure because I specifically didn’t want any login requirement on the retrieval end at the sports club. But it does the job, and it’s very much not accessible by anyone who stumbles across it online.

If someone got hold of the keys, they would have the ability to stream on our YouTube channel. But that’s all low risk.

A matchday dashboard
The final piece of the puzzle was the match day dashboard.

Each time there’s a match down at the ground, someone sets up the video camera and gets that working, but the actual streaming is done by the person scoring the cricket match. This means that the computer used for scoring needs to get the stream and the YouTube embed code into the software. But this changes each week so that the right stream is triggered, and the right match is fed through to the match centre on play-cricket.

OBS and other streaming platforms hook straight into the YouTube API and can create live events and things like that, but as of yet Scorerpro doesn’t have that feature so there’s a bit of “manual work” to. For this part I used expressjs and created a little batch file for the Windows computer that runs Scorerpro. They ‘secret’ key for the endpoint on Laravel is stored in an environment file, along with a few other details such as where the Laravel site is hosted and what port express should run on. The batch file runs the server and opens up the dashboard. The server only has one job - it serves the page which shows the stream key and the embed code. These are then simply copied by the scorer as they are needed.

I know I’ve not gone into a great deal of information about code I’ve used and such like. That’s mostly because everything is pretty standard code. It’s more the idea and then the plan that I’m pleased with… I saw something that needed doing, and using stuff I already knew, put together a working system in a couple of hours. At the moment it’s a system that’s only used by me (apart from the match day scoring part) but, once it’s running smoothly for a while, I’ll make sure others know what’s going on where.