简体中文 | 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:
- Download the project: https://github.com/Faceunity/FUTRTCDemoDroid.
- Add the
faceunity
module to your project.
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'
}
}
}
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();
Set the custom preprocessing callback for TRTC: TRTCCloud.setLocalVideoProcessListener
. Refer to the API Documentation for details.
Use third-party beauty processing for video data in the TRTCCloudListener.TRTCVideoFrameListener#onProcessVideoFrame
method. Refer to the API Documentation for details.