Video Mixing on the Cloud with OpenVPN and OBS

In the search for more flexibility when trying to record talks during conferences we found that there was one constant constraint, CPU (and GPU) power. Where it’s possibly to simply buy more hardware, we would that this is often very expensive and impractical, and often, depending on your use case, hard to justify.

We realised this was not a new problem. Clouds vendors have been selling this potential flexibility for years so we decided to experiment in using the public cloud to do the heavy lifting in terms of live video production.

Video Capture

We care about four types of primary media:

  • (Video) Camera Input
  • Audio Capture
  • Presenter Screen Capture
  • Supporting Media (background images, etc)
Camera Input

For camera and cook with mainly use raspberry pies with camera modules. These raspberry pies have been configured as RTMP servers that can be connected to from OBS.

Audio Capture

For audio capture we generate another video feet with a static background. This allows us to create the same RTMP server that we use for the camera but instead use it primarily to open the audio from a USB sound device.

Presenter Screen Capture

For presenter screens, we use a Lenkeng HDMI extender, again these are connected to a Raspberry Pi over ethernet.

Bitrates

In terms of bitrates, we tend to send about 2MBps for each video feed. Audio feeds can be around 192kbps given that the video element in these feeds is a static image.

We do however store raw media on a storage device connected locally to the Raspberry Pi. This allows us to use higher quality assets for the final edit.

Supporting Media

Interstitials, lower thirds and backgroud media are stored on the machine running OBS.

Cloud Hosted OBS

OBS is Flexible, what it can do and what it allows us to do …

Remote Desktop in Linux isn’t quite as good as you would assume. It took some testing, but eventually we found a good pairing of Xrdp and Remina.

Xrdp is an RDP layer on top of VNC. Allowing us to utilise better compression and display state management over a network.
Remina is a fairly modern Remote Desktop client with support for a few Remote Desktop protocols.

Networking

With all capture devices configured to connect to a central OpenVPN Server. We can configure the AWS VPC routing tables to route all traffic to the private OpenVPN subnet, this allows us to connect our Cloud OBS instance to the camera devices transparantly.

Control Hardware

Where RDP is reasonably for overall control of OBS, it can often provide a frustrating experience with a low bitrate. Instead, we configured some local hardware to provide this level of control.

A lightweight Midi to Websocket bridge allows us to control OBS using a midi controller. We can make use of push-buttons for scene control, while also using dials to manage volume, and pan/tilt/zoom.

For video feed monitoring, we can use relatively inexpensive 10” 1080p monitors connected to an HDMI switch. This provides real-time feedback as to whether our cameras configured appropriately.

Monitoring

For stream monitoring, we are able to take advantage of the netowrk connectivity on AWS. Using the Telegraf/ InfluxDB / Grafana (TIG) Stack, we are able to build a lightwieght dashboard for system health.

As I’ve alluded to in previous talks, we can also use InfluxDB to storage business events. Every time an operator presses a button to change scene, each time a new raw file is created, these events are all stored in a custom database in InfluxDB. Exporting these to CSV super helpful the post-processing phase.