This guide explains how to integrate FaceBetter beauty SDK with TRTC Flutter.
Architecture
Prerequisites
- TRTC Flutter SDK (
tencent_trtc_cloud) integrated
facebetter_flutter dependency added
- Valid FaceBetter license (appId / appKey)
Step 1: Flutter Layer Initialization
Initialize the engine before entering a TRTC room:
Step 2: iOS Native Integration
2.1 Add Dependency
In your iOS Podfile:
2.2 Implement Beauty Processer
Create FBBeautyProcesser.swift:
2.3 Register with TRTC
In AppDelegate.swift:
Must be called after GeneratedPluginRegistrant.register(with:).
Add to your Bridging Header:
Step 3: Android Native Integration
3.1 Add Dependency
In app/build.gradle:
3.2 Implement Beauty Processer
Create FBBeautyProcesser.kt:
3.3 Register with TRTC
In MainActivity.kt:
Step 4: Enable Custom Video Process
Dynamic Parameter Adjustment
Adjust beauty parameters during a call:
Changes take effect on the next video frame.
Release
Notes
onProcessVideoFrame runs on the GL thread; processImage is thread-safe.
- Call
FBBeautyEffectEngine.init() before enableCustomVideoProcess(true).
- The engine is a singleton — only one instance per app lifecycle.
- FaceBetter uses OpenGL ES 2D textures, matching TRTC’s texture format.