Another Raspberry Pi Zero (#4 in the house along with a Model B Pi) and the 4 port USB hub (that works kind of like a HAT):
https://thepihut.com/collections/raspberry-pi-zero/products/zero4u-4-port-usb-hub-for-raspberry-pi-zeroThis one is for my 5-a-side (just a bunch of friends, not a league, but still quite competitive) football project:-
* a rugged box hung up on the fence next to the 5-a-side pitch (it's got to survive being hit by a football kicked hard!)
* level with the centre line and above head height on a fence
* sponge/foam padding inside and on the back (the fence vibrates a lot when the ball, or a player, hits it) and bungees to hold it in place
* Two wide angle USB cameras to cover the pitch (and overlapping somewhat)
* 32GB micro-SD card to record everything
* microphone to record sound (the microphones in most USB cameras are crap)
* 2 x two-digit 7 segment displays (4" tall digits probably) for the current score
* buttons to press to increment/decrement/reset the counters (nearest person presses the right button after a goal has gone in, we do kickoffs after each goal so there will be someone nearby it)
* 6 digit 7 segment display clock module to show the current time (so we know how long to go and also make it easier for people to time their turns in goal)
* all powered by a 5000mAh USB power pack and possibly batteries for the 7 segment displays
* 4 USB ports for: camera #1, camera #2, wifi dongle, USB microphone
Not sure whether to have the Raspberry Pi control/power the 7 segment displays or whether to just have a couple of up/down counter circuits and copy the button press pins to the raspberry pi. Probably safer (because of button bounce) to have the Pi control things, that way it knows for sure what the score is since it is controlling the displays.
When the game is finished I press a button to save everything and shut down and it gets shoved in my bag. At home I'll plug the micro-SD card into a reader and copy the files (two video streams, audio stream and the timestamps for goal button increments/decrements) over to a server for post processing.
The post processing needs to:-
* stitch the two overlapping video feeds together and get them in sync (I may have to put a couple of markers, like in the corner of QR codes, on the far fence to make this easier)
* sync the audio (I'll do a clapperboard impression in front of the box before the start of the game)
* rationalise the goal button feed (to get rid of accidental double increments and subsequent decrement or people pissing around with it)
* find the exact frames where the goals are scored (for each goal just display on a web page a choice of 20 frames from the preceding 5 seconds of the button press and I just have to click on the best one or ask it for further back/forward or some in between frames)
* this then creates a graphic overlay in the top left of the final video with the time and current score (bibs vs non-bibs)
* encode it all in something friendly to youtube (so that it doesn't have to transcode it further)
* upload it to youtube
* email out the resulting link to the players
Once I've got the frames where I know a goal has gone in I can also show short snippets of the previous n seconds and then select which player got the goal and who got the assist. For more full opta-style stats (passes, pass completion, unforced errors, length of stints in goal [some people are cheeky and don't do their full turn], etc) I'm tempted to try shipping it off to Amazon Mechanical Turk. I'm sure someone out there will spend a couple of hours wading through an hour long youtube video making notes for a few $.
Anyway, it lends itself to a nice project with lots of incremental steps (start with one camera, no microphone, no 7-seg displays, no buttons, etc) and I get to play with toys and slowly build it up.
Also a nice variation of stuff to do:-
* hardware bodging (rugged container, vibration damping, waterproofing [eventually])
* delicate hardware bodging (soldering, up/down counters [16F628A maybe])
* python coding (Raspberry Pi GPIO pin stuff)
* AV fun (frame extraction, marker detection and splicing, syncing, audio syncing, score/time overlay generation, re-encoding)
* scripting it all together (machine boot into the right state ready for the start button to be pressed, etc) and also the post-processing VM
* networking (it may have a wifi connection so it can get to NTP via a hotspot on my iPhone and get the time right as Pi doesn't have a battery powered internal clock to keep the time when it's not powered on)
Sadly two hour long 1080p video feeds (3.6GB each if 8Mbps) will be too much to upload via Wifi for post-processing whilst I'm in the pub and I don't really want to have to lug a laptop with me to do it, so it can wait until I'm home and do it all whilst I'm asleep.