Skip to content

Overview#

In order to directly monitor the experiment and the setup that is remotely controlled by PirAtE and to make the measurements more engaging, a webcam solution was found.

Architecture Spyglass

This solution uses the existing Raspberry Pi and a Raspberry Pi Camera Module (or a USB Webcam with integrated H264 encoder) to capture video and provides a endpoint to stream this data to a webpage.

Getting Started

Requirements#

The Goals for the Camera Implementation have been:

  • Works on Raspberry Pi
  • Low Ressourcen Usage on server and client side
  • Low Latency
  • Low Bandwidth
  • Viewable from Browser
  • Works in Reutlingen University's network

Requirements

Implementation#

This video implementation is based on the project berrymse from Chris Hiszpanski.

Description from the berrymse project

H.264 Network Abstraction Layer (NAL) units are read from /dev/video0, a
Video4Linux2 compatible camera interface. Each unit corresponds to one frame.
Frames are packaged into MPEG-4 ISO BMFF (ISO/IEC 14496-12) compliant
fragments and sent via a websocket to the browser client. The client appends
each received buffer to the media source for playback.

This camera stack has three major components, the hardware/driver stack, the server and the client.

Further details on Implementation

Validation#

The implementation was tested in multiple hour stress tests.

Currently the Implementation runs with the following characteristics:
- CPU utilization: sub 10%
- Bandwidth: 1.5 Mbit/s
- Latency: < 200ms
- Resolution: 1280x720
- Works with university Network
- USB Video Class devices are not well supported
- Safari support has not been tested

With these characteristics it matches the requirements and is suitable.

Validation

Research and Theory#

The information collected throughout the implementation has been placed into the sub folders.

The Theory folder contains important information about the current solution.

Further details on streaming

The Research folder contains the research notes collected during the development of both solutions.

Licensing#

Because the underlying solution is licensed under the AGPL, a copy left license, these kind of licenses were studied.

Further details on licensing

Legacy Solution#

The original solution was based on gstreamer and a dockerized Janus WebRTC Broadcaster to provide a WebRTC video endpoint. WebRTC proved unusable for our use case, because the Reutlingen University network was incompatible with STUN signaling. Because of this no stream could cross the network border. A possible solution would be a TURN server, but this incurs a monthly cost and was not used. See https://github.com/bartbalaz/janus-container at "Experimentation and observations" for similar problem.

Outside the network this solution performed adequately, with low latency.