page-header

Camera Control Software

Camera Control Software

Premise

During my employment at a motorsport company I was responsible for the 360° vision cameras that were mounted to the cars during the race weekend. They were developed by an external company and were based off of one of their existing products, however that company had since folded and had stopped offering software support for the camera; both with mobile applications and desktop applications. Whilst the applications continued to work with the cameras, certain features were missing, incomplete from the applications, or were outdated in their functions and no longer worked as desired.

The Old Way

The company had been using the provided software application to perform the following:

  • Update the system time of the camera
  • Change the system name of the camera
  • Convert the raw video to a panning 360° video where footage was requested

The process of updating the system time required was as follows:

  1. Connect to a WiFi network on host device
  2. Connect to camera via Bluetooth
  3. Enable camera WiFi
  4. Record a 30s video
  5. View the video file name to ensure that the time had been synced
  6. Delete the video and disable the camera WiFi

All in all it would take roughly 5 minutes per-camera, and when you had cameras running on 20 cars over varying days of the event, spending almost 2 hours just to sync the time was a lot of time wasted; even moreso as the cameras would drift approximately 3 seconds every day when fully charged, and up to 3 hours a day when the battery was low.

After a while of using this system I thought that there had to be a way to change the system time easier than using an outdated application. Having a bit of a probe with the old software application I realised that they were running on an Android 4 build so I could use the ADB tools and the Android API to change some system attributes directly, without having to use the manufacturers tools. Making a quick Powershell script allowed me to parse the UTC time directly to the connected device, reducing a 5 minute task down to only a few seconds.

Python GUI

After using the Powershell script for longer than I’d like to admit (4 months), I finally decided it would benefit from a proper GUI and some added featuresets:

  • Retime devices to UTC
  • Check battery status & estimated runtime
  • Change system name
  • Send custom ADB commands

So over the course of a couple of weeks a basic Python GUI was made, with a few calls made using external libraries and direct terminal passthroughs in order to wrap the commands into a usuable GUI.

Epoch Time

Whilst the longest process would typically be retiming the cameras over the event, getting desired footage from them using timestamps provided by the production team would also complicate and lengthen the task. The devices would mount as USB drives once connected to a computer, and whilst they stored the footage in 4 minute chapters with the UTC timecode embedded, it would always be a slow process to cross-reference timestamps between file names and desired videos.

Extrapolating the file naming structure from the chaptered files, I could form a epoch time for the file creation time in UTC which was the timezone that footage timestamps were requested in. By scanning the entire mounted directory of files and generating a list of epoch start times for every video file in the directory, it was possible to work out which video files that certain timestamps were located in. Several revisions of this process tree, and I was able to allow for overflow/inaccuracies in the timestamps provided by adding buffers onto either end, again all in UTC. The Python GUI was updated to include start/end timestamp input boxes, as well as an optional slider to set the additional buffer time either end of the given timestamps.

File Manipulation

Knowing which files contained which portions of video was half the battle – getting the video into a usable format was the other. Looking into the application files of the manufacturers software, there was a lot of mentions to FFMPEG so I decided to take a look as to what FFMPEG was – low-and-behold it’s a video decoding/reencoding extension. Running FFMPEG in a terminal prompt and parsing the timestamped video files as part of a list allowed it to merge the chaptered files into a single video file and also enable it to be recognised as a panning video for the post-production team.

All in all, not half bad for a couple of weeks’ worth.

  • API Interfacing
  • UI Design
  • Standalone Deployment Package
  • Video Encoding

Clientele: Private Company

Design Requirements: Interfacing, UI

Deliverables: Software, Technical Documentation, User Training

Release Date: November 2021