On-Premises Recording
  • Linux : C++
  • Overview
  • SDK Downloads
  • Sample Codes
  • Quick Starts
  • Performance Data
  • API Documents

Integration

Last updated:2021-04-25 20:24

1 Development Environment Requirements

Please ensure that the development environment meets the following conditions:

  • CentOS 6.5+ 64-bit
  • Ubuntu 14.04+ 64-bit
  • Cmake is installed on Linux

2 Download the SDK

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,

  • include directory: contains SDK header file - LiveRoom.h.
  • libs directory: so file containing SDK--libzegoliveroomrecorder.so.

3 Integrated SDK

3.1 Add Header Files

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.

3.2 Linking Dynamic Libraries

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.

4 Integration Example

Take the integration method of demo recording on the server as an example.

4.1 New Project

Assume that the project code is placed in the ~/zegoServerRecordingDemo directory.

  • $ mkdir ~/zegoServerRecordingDemo

4.2 Copy SDK

Copy the include/ and libs/ folders to the ~/zegoServerRecordingDemo directory.

  • $ cp -r include libs ~/zegoServerRecordingDemo
  • $ cd ~/zegoServerRecordingDemo

4.3 New main.cpp

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;
    }

4.4 Create CMakeLists.txt

  • $ 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})

4.5 Compile

  • $ mkdir build & cd build
  • $ cmake .. & make

A successful compilation will generate an executable file.

4.6 Run

  • $ ./zegoServerRecordingDemo

Successful integration will print out "Zego SDK Version: xxx".

5 Using the SDK

After successfully importing the SDK, you can refer to the following documents to implement the recording function.