So far this project has been a journey of around 20 years, with the last 8 supported by B4X and who knows how and where it will go from here . . .
Its current incarnation enables display of the scoreboard, player statistics and game video on a large video screen at my basketball club’s home venue as a means of enhancing the enjoyment of our spectators; achieved using B4J, B4R and B4A.
Back in 2001 and born out of a League requirement to record video of basketball games at my local basketball club, as an electronics hobbyist I explored ways in which the scoreboard could be superimposed on the recorded video like professional broadcasters did; this at a time when VHS tape was the recording format.
The result was a Z8 microprocessor based interface box which consumed the serial data from the venue scoreboard and activated 4016 analog switches connected across the keypad of the optional Panasonic M7 VHS video camcorder character generator in order to superimpose the scoreboard team scores and game clock on the recorded game video.
After several years of successful use, the VHS camcorder was replaced with a small digital video camera in 2007 and so superimposition of the scoreboard on our game video went into a hiatus.
It was during this time I discovered Basic4android and being an engineering student of the 1970s, its syntax was much more aligned to languages I was familiar with, like Fortran and Basic. With the subsequent release of B4J in 2013, my first B4J application was of course basketball related, being a port of a VB6 application I’d previously developed to analyse statistics, but one of our coaches had a Mac and so B4J’s cross platform capability was a savior for me.
In 2015 I revisited how we could once again superimpose the scoreboard on recorded game video and landed on a solution using the vMix vision mixing software to combine video from the camera with the “desktop capture” of an application displaying the scoreboard data. In lieu of the Z8, an Arduino compatible LeoStick was used as a protocol converter between the venue scoreboard native serial data and the laptop’s USB port. A B4J application was developed to consume the USB serial data and display the scoreboard in a very simple way initially.
One of the first times this was used was when our local club hosted a game against a team from Yale University which toured Australia in 2015. As well as recording the video, it was livestreamed via YouTube and it was rewarding to see a “viewer” post on Facebook how good it looked.
Further development has seen the shot clock added, along with enhancements to the user interface enabling adjustment of various elements of the display, plus the ability to save and recall configuration settings.
In late 2019 our club gained assess to a new venue which has a large (6m) video screen adjacent to the playing court and so my mind began thinking about how to make best use of that. Statisticians courtside at our games record and upload on-court actions in realtime to a data warehouse to allow display of the game situation on websites for consumption by interested people. An API provides access to the data warehouse and so again using B4J, I developed an application that would enable download of each player’s statistics as any were updated, particularly points and fouls.
Combining the original scoreboard application with this new player statistics application and including a “blue screen” rectangle on one B4J form so that it could be used as an overlay via desktop capture in vMix so game video could be added, created a great display on the large video screen.
A second B4J form provides a user interface similar to the standalone scoreboard application, but also includes controls to switch the video from the small blue screen size to fullscreen by making HTTP calls to the vMix API.
Unfortunately due to COVID, our 2020 basketball season was cancelled and so the application was never seen publicly and for the 2021 season, the data warehouse API was changed, requiring redevelopment of the player statistics application from using a long running HTTP call to MQTT over a websocket connection.
This is an appropriate time to acknowledge the great support provided by @Erel and the whole B4X community because both of the above API connection arrangements required creation of a new class or update of an existing library, both of which @Erel did with incredible speed on becoming aware of the requirement. I also thank the many others who have also responded constructively to questions when I’ve hit a road hump along the way.
Fortunately basketball has to returned courts in Victoria, Australia and so in June 2021 we were able to unveil the new scoreboard, player statistics and game video display to our spectators. Here is a link to a sample of what they saw on the large video screen: https://youtu.be/iqpV724qs04
But as well as B4J being used for the desktop display application, B4R has been used to code an ESP8266 variant of the protocol converter which sends the venue scoreboard data to the display laptop using UDP via WiFi where hard wired cabling is not possible. B4A has been used to create an Android app which enables the court commentator to remotely flash graphics on the screen to encourage spectator engagement, such as “MAKE SOME NOISE” and “D-FENCE”.
Who knows where this journey will go from here, but I know that B4X will enable me to get there!