/

Linux Streaming SDK (Beta)


The BETA Release of the Red5 Pro Linux Streaming SDK provides support for broadcasting a live stream with video on the following platforms:

  • x86-64 (e.g., Ubuntu 18.04 x86)
  • ARM (e.g., Raspberry Pi)

This document will introduce you to the Red5 Pro Linux Streaming SDK API and instruct you in using the SDK to begin streaming on x86-64 and ARM devices.

You will need the latest Red5 Pro Linux Streaming SDK before you begin.

Download the Red5 Pro Linux Streaming SDKs Download the Streaming SDK Beta for Linux

Important Note: The BETA release of the Linux SDK supports video broadcast only.


The Red5 Pro Linux SDK is distributed as shared libraries (.so files) and header files. The design is to allow integration with unlimited varieties of hardware configurations regarding image acquisition and compression. The components are linked at runtime through predefined structs.

Function Pointers

The header files (r5pro_api.h, global.h and cJSON.h) contain the typedefs required to load the shared library at runtime and link the session create and destroy methods.

Sessions

Several of the defined structs contain a mem_ptr member which we qualify as a "session", and are used with the API calls. This is to facilitate C compatibility, however in the future you may see additional headers for working with the object pointers directly for syntax convenience within C++.

The critical aspect with hardware sessions is to ensure closing/deallocating anything that was opened. A user process that is interfacing with /dev/videoX but fails to close the file handle can make that device unavailable for subsequent processes. The platform typically requires a reboot, but one can try to identify the process and kill it. The latter may work but is currently not guaranteed.

Keep this in mind while developing your application. If you find your web camera is no longer streaming after an unexpected crash, this could be the reason.

Session Structs

There are three structs with session objects:

  • r5session
  • r5connection
  • r5sharedobject

Each is specific to its own API instance and cannot be mixed up.

The main r5session has a pointer that is used to retrieve the r5connection, which - in turn - has a pointer that can be used to access a r5sharedobject.

The r5sharedobject has its own API and pointer. The pointers are valid for the entire application lifecycle. Once you have a reference to a r5connection or an r5sharedobject struct, it can be stored locally.

Image Acquisition

The SDK has defined a capture driver facade called r5device. You - as a developer - are free to wrap any custom image source. VFL2 should be adequate for most users.

Included in the SDK is the source code used in defining a device control for h.264.

Image Compression

The SDK has defined a codec facade called r5codec.

When using devices that produce hardware encoded H264 output such as the Raspberry Pi hardware camera, developers DO NOT need to implement a compressor. To reduce the complexity of initial development, we encourage you to acquire a USB camera that advertises hardware H264 output.

Included in the SDK is the source code for an example implementation using an OMX hardware client and a planer pixel field image device.

Audio

Currently, the Linux SDK only supports video broadcasts.