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 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:
|
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:
- 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 | |
libs | Required libraries for developing the recording application. |
samples | Sample code:
|
Tools | Transcoding tools. |
-
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.
-
Ensure that your compiler is GCC 4.4+.
-
If your firewall restricts access to the Agora services, use cloud proxy service.
-
Open the UDP ports used by the recording processes. The UDP ports are the ports between the
lowUdpPort
andhighUdpPort
parameters specified inRecordingConfig
.- 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
andhighUdpPort
parameters. - If the
lowUdpPort
andhighUdpPort
parameters are not specified, the ports used by the recording processes are at random, which may cause port conflicts.
- Use the
-
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:
- Record by command line: Record a call by using the command line with Agora's demo.
- Record by API: Record a call by calling the APIs.
The command line and API methods implement the same recording functions.