Please ensure that the development environment meets the following conditions:
On-Premises Recording SDK download address: On-Premises Recording SDK Linux
After the SDK download and decompression is complete, the following figure:
After decompression, as shown in reference number 2, contains include, libs directory, where,
LiveRoom.h
.libzegoliveroomrecorder.so
.Add the header file (LiveRoom.h) in the include directory of the SDK package to the header file directory of the existing project. The project needs to add the link path of its header file directory.
Add the so file (libzegoliveroomrecorder.so) in the libs directory of the SDK package to the library file directory of the existing project or a custom directory, and the project needs to add the link path of the so file.
Take the integration method of demo recording on the server as an example.
Assume that the project code is placed in the ~/zegoServerRecordingDemo
directory.
Copy the include/
and libs/
folders to the ~/zegoServerRecordingDemo
directory.
Create a new main.cpp file and print the SDK version number.
$ touch main.cpp
$ vim main.cpp
Enter the following:
#include <stdlib.h>
#include <stdio.h>
#include "LiveRoom.h"
using namespace ZEGO;
int main(int argc, const char * argv[])
{
printf("Zego SDK Version: %s\n", LIVEROOM::GetSDKVersion());
return 0;
}
$ touch CMakeLists.txt
$ vim CMakeLists.txt
Enter the following
cmake_minimum_required(VERSION 3.5.2)
project (zegoServerRecordingDemo)
include_directories("./include")
link_directories("./libs")
link_libraries(zegoliveroomrecorder rt)
add_compile_options(
-std=c++11
)
aux_source_directory(. SRC_LIST)
add_executable(zegoServerRecordingDemo ${SRC_LIST})
A successful compilation will generate an executable file.
Successful integration will print out "Zego SDK Version: xxx".
After successfully importing the SDK, you can refer to the following documents to implement the recording function.