In September of 2018 a big company that specializes in passenger information contacted us to talk about their surveillance system software. It was one of very popular products from their offer. However, it had some major issues that needed to be taken care of. It was a very important product for the company. They really wanted to step things up and offer a whole new experience to their customers.
This project was based on an old version of video recorder that was able to connect to only 14 IP cameras per device. It was using most of its resources and had many errors. This CCTV surveillance system run on one of the first versions of gstreamer that had many restrictions and was extremely loaded.
The challenge for this project was to maximally optimize the surveillance system software to connect more IP cameras per device without changing hardware platform. To do so, we had to update the the entire system. Moreover, we needed to really customize the software to fit the specific requirements.
The most important task that the whole project was pretty much about was maximizing the number of cameras per recorder. Another important part was to optimize the libraries used in the old version. Last but not least, the project also required the implementation of modularity to the software.
Moreover, new version had to support H.264 and H.265 video codec.
A team of 3 senior developers from BoostHigh sat down with our client to make strategic project decisions. They decided to update Linux Ubuntu Server to 16.04 version for the maximum efficiency and stability. Moreover, new Qt 5.12.4 played a key role in making the application more stable and efficient. Gstreamer was going to be responsible for intercepting streams and recording them on a hard drive. The old application was based on widgets where the new recorder is using QML. To optimize the surveillance system software even more, our developers decided to use Bash Scripts instead of writing some of the procedures in Qt.
Here’s how we were able to optimize the system to fit 32 cameras (with maximum bitrate of 4 Mbps each) instead of 12. We did software implementation of RAID 0. It is responsible for mirroring the contents of a hard drive to the one next to it to prevent video loss in case of hardware failure. Video recorder is able to contain up to 6 2.5” HDDs. It means that 3 of them are the twins of the remaining 3. It’s also important to add that to limit the load of the system our developers decided to copy the footage from hard drives in the background. It was one of the solutions to optimize the system’s work.
A picture of the recorder (orange) that is installed in buses and connects to the cameras from the bus.
Video recordings from the surveillance system are divided into segments and it’s up to the user to define the length of it. When the hard drive is full it starts to erase the oldest recordings. It does that to make space for the new ones. The new version has an option of saving important footage. The driver can protect currently recording segment and two in between by pressing the physical button in his cockpit or a button on the screen. Because of that, the footage won’t be deleted.
In the old version, the segments were sent straight to the hard drive after they ended. For example, the segment was 3 minutes long and a bus had 10 IP cameras installed in the vehicle. In that case, after every 3 minutes the hard drive would receive 30 minutes worth of footage at the same time. The load was too much for a hard drive to handle. Moreover, in case of an accident and the damage of the hard drive (old version didn’t have a copy) there would be no footage from the moment of the accident.
That’s why we implemented data buffer that stores the footage. Moreover, it sends it to the hard drive individually so the hard drive is not loaded. This also protects the footage in case of an accident. Our team added a footage repair functionality. It can correctly play the footage even if the segment wasn’t finished (for example due to an accident).
Speaking of an accident, what if our client needs to give the footage to the police? The new surveillance system software is equipped in video ordering system. And here’s how it works. A transporting company has an application where they can see what recordings are available on a recorder. From there they can order the selected ones to be send to them. When the bus is on the depot it receives an information about the order and sends the footage using WiFi.
Preview available to the driver in a cockpit
The driver has an access to the preview footage from a dedicated monitor. If needed, the recorder can be connected to any other device (for instance onboard computer) using Internet Protocol. Moreover, to optimize the resources usage, the preview is displayed in lower quality than the recorded stream.There are previously defined events and chosen cameras that are being shown to the driver. It helps to minimize the times where the driver has to change the image displayed. For example, the preview automatically changes where the bus is on a bus stop and shows footage from the entry cameras etc.
Every footage has GPS, onboard computer informations as well as events happening during the route (for example door opening).
The recorder can also record audio if there’re microphones inside the vehicle.
During a development process we achieved the results we were aiming for. A new, updated surveillance system software for public transport was now able to record footage from 32 IP cameras. Moreover, the preview from the cameras can now be viewed in 5 different resolutions between 1024×768 and 1920×1080. The old version was able to only preview on 800×600.
Watchdog was installed to detect immediately when the system is down. The system is now able to restart and continue the work just after 1 second of being down.
The end result allowed our client to sell the surveillance system software that can connect to 32 cameras per recorder. It increased the overall value of the product. We achieved a maximum stability of the system in continuous operation. The bandwidth was now 4 Mbps/stream and the system uses 25% of its resources during regular load and 50% during maximum load