Skip to main content

Integrate the SDK

This page shows how to set up the environment to integrate the Agora On-Premise Recording SDK.

The Agora On-Premise Recording SDK for Linux is integrated on your Linux server instead of in your app.

Recording audio and video within a channel is like a special audience joining the channel. The audience gets the audio and video from the channel, transcodes it, and stores it on a Linux server. Therefore, you must integrate the On-Premise Recording SDK on your Linux server. The same App ID is used in the On-Premise Recording SDK and the Agora SDK for audio and video calls.

Prerequisites

Hardware and network requirements

The following table lists the basic requirements for installing the On-Premise Recording SDK:

Hardware and NetworkRequirements
ServerPhysical or virtual.
SystemUbuntu 14.04+ x64 or CentOS 6.5+ (7.0 recommended) x64.
NetworkThe Linux server needs Internet access.
Internet BandwidthUse an Internet bandwidth based on the number of channels being recorded simultaneously. Refer to the following data:
  • When the resolution of the recorded scene is 640 x 360, the bandwidth is 500 Kbps.
  • To record a channel with two users, you need a bandwidth of 1 Mbps.
  • To record 100 channels, you need a bandwidth of 100 Mbps.
For detailed bandwidth data, see Sdks.

Cloud Hosting Configuration

We conduct tests on the recording concurrency based on the following cloud hosting configuration:

  • AWS: Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00 GHz
  • 16 Virtual Core CPU, 32 GB RAM
  • Disk I/O: 412 MB/s

Test conditions:

  • Each channel has two users/hosts. The resolution and frame rate of each channel are set as 320 × 240 and 15 fps respectively.
  • The resolution, frame rate, and bitrate of the recorded files in composite recording mode are set as 640 × 480, 15 fps, and 500 Kbps respectively; and the audio bitrate of the recorded files in composite recording mode is set as 48 Kbps.

Test results:

Channel Profile Recording Mode Performance
Live Broadcast Audio + Video

Individual recording

When recording 215 channels simultaneously, the CPU usage is about 75%.

We recommend recording 200 channels simultaneously.

Audio + Video

Composite recording

When recording 70 channels simultaneously, the CPU usage is about 75%.

We recommend recording 60 channels simultaneously.

Audio only

Composite recording

When recording 300 channels simultaneously, the CPU usage is about 75%.
Communication Audio + Video

Individual recording

When recording 210 channels simultaneously, the CPU usage is about 75%.

We recommend recording 200 channels simultaneously.

Audio + Video

Composite recording

When recording 60 channels simultaneously, the CPU usage is about 75%.

The test results are for reference purposes only. Set up your own cloud hosting according to your recording requirement.

Set up the Environment

Set up the environment on your Linux server:

  1. Download the Agora On-Premise Recording SDK for Linux package. The package structure is listed as follows:
FolderDescription
binThe directory where AgoraCoreService is located.
include
  • base: Required header files for developing the recording application.
  • IAgoraLinuxSdkCommon.h: Public structure and enumeration.
  • IAgoraRecordingEngine.h: Interface of the recording engine and its configuration.
  • libsRequired libraries for developing the recording application.
    samplesSample code:
    • agorasdk: Demo that implements the C++ interface and callbacks.
    • base: Public sample code.
    • cpp: C++ sample code.
      • release/bin/recorder: Parent process that can be run.
    • java: Java sample code.
      • native: Native code.
      • native/jni: JNI delegate.
      • src: Java code.
      • src/io/agora/recording/RecordingEventHandler.java: Callback interface class.
      • src/io/agora/recording/RecordingSDK.java: Recording interface class.
    ToolsTranscoding tools.
    1. Prepare the required libraries:

      • Add the include folder to your project.
      • Add the libs folder to your project and make sure the librecorder.a file is connected to the project.
    2. Ensure that your compiler is GCC 4.4+.

    3. If your firewall restricts access to the Agora services, use cloud proxy service.

    4. Open the UDP ports used by the recording processes. The UDP ports are the ports between the lowUdpPort and highUdpPort parameters specified in RecordingConfig.

      • Use the iptables -L command line to check the UDP port.
      • To record the content in the channels, you need one recording process for each of the channels. One recording process requires four UDP ports. There must be no port conflict among the processes, including the system processes and all recording processes.
      • We recommend that you specify the range of ports used by the recording processes. Configure a large range for all recording processes (Agora recommends 40000 to 41000 or larger). If so, the On-Premise Recording SDK assigns ports to each recording process within the specified range and avoids port conflicts automatically. To set the port range, you need to configure the lowUdpPort and highUdpPort parameters.
      • If the lowUdpPort and highUdpPort parameters are not specified, the ports used by the recording processes are at random, which may cause port conflicts.
    5. For debugging purposes, we recommend that you enable core dump on your Linux system.

    The Agora On-Premise Recording SDK is integrated. You can choose either of the following ways to start recording:

    The command line and API methods implement the same recording functions.

    vundefined