Skip to content

Latest commit

 

History

History

ThirdBeauty

Third-Party Beauty SDK

简体中文 | English

In this tutorial, we'll show you how to quickly integrate a third-party beauty SDK (taking Faceunity Beauty SDK as an example) into TRTC SDK. Follow the steps below:

Step 1: Download the project and add the faceunity module

Step 2: Modify build.gradle

If you need to specify the so architecture for your application, modify the build.gradle file of the current module:

android {
    // ...
    defaultConfig {
        // ...
        ndk {
            abiFilters 'armeabi-v7a', 'arm64-v8a'
        }
    }
}

Step 3: Initialize the beauty module

Initialize the beauty module based on your needs:

FURenderer.setup(getApplicationContext());
mFURenderer = new FURenderer.Builder(getApplicationContext())
    .setCreateEglContext(false)
    .setInputTextureType(0)    // TRTC uses 0 TEXTURE_2D here
    .setCreateFaceBeauty(true)
    .build();

Step 4: Set custom preprocessing callback

Set the custom preprocessing callback for TRTC: TRTCCloud.setLocalVideoProcessListener. Refer to the API Documentation for details.

Step 5: Use third-party beauty processing for video data

Use third-party beauty processing for video data in the TRTCCloudListener.TRTCVideoFrameListener#onProcessVideoFrame method. Refer to the API Documentation for details.