Agora Recording SDK Quickstart

Nishant Rodrigues
Agora.io
Published in
2 min readMar 11, 2019

The Agora Recording SDK allows developers to create and store a local copy of the video stream. This provides an amazing dataset for analytics and processing for Machine Learning and Artificial Intelligent algorithms that can make use of the live stream.

I’ll be walking you through the basic setup of the Recording SDK and get a headstart on your project.

Step 1

The Recording SDK is currently available on a Linux server running Ubuntu Linux 12.04 LTS 64-bit or later and CentOS 6.5 x64 or later.

Download the latest Agora Recording SDK here. Unzip the compressed download. The directory structure is as shown below:

.
├── bin
│ └── AgoraCoreService
├── include
│ ├── base
│ │ ├── atomic.h
│ │ ├── log.h
│ │ └── mutexer.h
│ ├── IAgoraLinuxSdkCommon.h
│ └── IAgoraRecordingEngine.h
├── libs
│ └── librecorder.a
├── samples
│ ├── agorasdk
│ │ ├── AgoraSdk.cpp
│ │ ├── AgoraSdk.h
│ │ └── AgoraSdk.o
│ ├── base
│ │ ├── opt_parser.cpp
│ │ ├── opt_parser.h
│ │ └── opt_parser.o
│ ├── cpp
│ │ ├── main.cpp
│ │ ├── main.o
│ │ ├── Makefile
│ │ ├── recorder_local
│ │ └── release
│ └── java
│ ├── build.sh
│ ├── native
│ ├── Readme
│ └── src
└── tools
├── ffmpeg.tar.gz
└── video_convert.py

13 directories, 21 files

Step 2

Compile the code. Run the make command under the samples/cpp directory. This will create a new file recorder_local.

Step 3

At this point, we need to log into our Agora.io developer account and create a new AppID or select an existing on an app_idfor the project.

As the Recording SDK works by joining the call as a silent client, it requires a uid. Setting it as 0 will assign a random uid. It also requires the channel name to connect to the right stream and a directory path appliteDir to save the recordings.

Start the recording by running the below command in the samples/cpp directory.

./recorder_local --appId <YOUR APP ID> --uid 0 --channel <YOUR CHANNEL> --appliteDir Agora_Recording_SDK_for_Linux_FULL/bin/

Step 4

The recorded files are stored in a new directory yyyy_mm_dd (Date) created for each day the recording server is run. The individual files are stored under the directory ChannelName_HHMMSS.

Recording files containing audio data of a particular user are stored as UID_HHMMSSMS.aac

Recording files containing the video data for users are stored as UID_HHMMSSMS.mp4 when recorded from the native client and as UID_HHMMSSMS.webm when recorded from a web client.

To play the recorded files, you can make use of the transcoding tool provided under the tools directory with the below command.

python video_convert.py PATH_TO_RECORDING_FOLDER

That’s it! It’s that simple to set up your Recording Server.

For advanced options and more information on the setup, have a look at the documentation for the Agora Recording SDK for Linux here.

--

--