[Kernel Panic 3.0] Video streaming for fun and profit!

Applying for: [Eyes wide shutter, Instant, Cloud city, HUD, Native, Savvy]

The SmartHjelm is outfitted with a full-HD camera. Several of the components on the helmet are consumers of this data, e.g. in order to present a rear view, and to detect dangerous situations so that they can be avoided. In order to provide data to all of these consumers, a streaming server has been set up on one of the two Raspberry Pi computers running on the SmartHjelm!

Running a HTTP Live Streaming server on a low powered device such as the Raspberry Pi can be done by recompiling ffmpeg to include hardware support for x264. Then, a simple server can be set up which other services can listen to.

After spending much time cross-compiling ffmpeg in order to achieve hardware support for H.264, it was found to still be insufficient for our purposes, having a lag of about 15 seconds. A simpler solution using an MPEG1 stream was used instead, which provided imperceptible delay. This video is streamed to the heads up display, providing an instantaneous view of the area behind the cyclist.

Video streaming from Raspberry Pi camera to native application on cellphone

Shown above is a short clip of the rear view mirror feature in the amazing SmartHjelm. The video is also sampled at a 1 second interval; the sampled image is sent to the Google Vision API for analysis, and the results are made available as a REST service which continuously streams analysis results to any listeners. The results include a label describing the detected object, a bounding box describing its location in the image, and a value indicating the confidence of the labelling.

[
{
“name”: “Man”,
“bounding_poly”: {
“normalized_vertices”: [
{
“y”: 0.4150000512599945,
“x”: 0.4150000512599945
},
{
“y”: 0.4150000512599945,
“x”: 0.9040588140487671
},
{
“y”: 0.9850000739097595,
“x”: 0.9040588140487671
},
{
“y”: 0.9850000739097595,
“x”: 0.4150000512599945
}
]
},
“mid”: “/m/04yx4”,
“score”: 0.9365513324737549
}, …

These results will be used among other things to warn drivers behind the cyclist, by activating the rear brake light in case of a potentially dangerous situation. Look out for more on this, and other exciting features, from the SmartHjelm team in the near future!

Leave a Reply

Your e-mail address will not be published. Required fields are marked *