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 Network Requirements
Server Physical or virtual.
System Ubuntu 14.04+ x64 or CentOS 6.5+ (7.0 recommended) x64.
Network The Linux server needs Internet access.
Internet Bandwidth

Use 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 Recording API.

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:

    Folder Description
    bin The 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.
    libs Required libraries for developing the recording application.
    samples

    Sample 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.
    Tools Transcoding tools.
  2. Prepare the required libraries:

    • Add the include folder to your project.
    • Add the lib folder to your project and make sure the libRecordingEngine.a file is connected to the project.
  3. Ensure that your compiler is GCC 4.4+.

  4. Open the following TCP ports: 1080 and 8000.

  5. Open the following UDP ports:

    • Duplex ports: 1080, 4000 to 4030, 8000, 9700, and 25000.
    • Simplex downlink ports used by the recording processes.
    • 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 simplex downlink 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.
  6. Whitelist the following domains:

    • .agora.io
    • .agoralab.co
  7. For debugging purposes, we recommend that you enable core dump on your Linux system.

The Agora On-premise Recording SDK is integrated.

Next Steps

Learn how to record by using the command line: Record a Call.