tencent cloud

Tencent Effect SDK

Release Notes and Announcements
Release Notes
Tencent Effect SDK V3.5 Version Released
Tencent Effects SDK V3.0 Version Related API and Material Changes
Product Introduction
Overview
Features
Basic Concepts
Strengths
Use Cases
Purchase Guide
Pricing Overview
Purchase Guide
Payment Overdue and Refund
Tutorial
Demos
Free Trial License
Licenses
Adding and Renewing a License (Mobile)
Adding and Renewing a License (Desktop)
Adding and Renewing a License (Web)
FAQs
SDK Download
Features
SDK Download
Version History
SDK Integration Guide(No UI)
General Integration of Tencent Effect
Integrating Capabilities
SDK Integration Guide(Including UI)
General Integration of Tencent Effect
Integrating Tencent Effect into MLVB SDK
Integrating Tencent Effect into TRTC SDK
Integrating Tencent Effect into UGSV SDK
Virtual Avatars
API Documentation
iOS
Android
Flutter
Web
Feature Guide
Reducing SDK Size
SDK Integration Issue Troubleshooting
Performance Fine-Tuning
Effect Fine-Tuning
Material Usage
Effect Parameters
Recommended Parameters in Beautification Scenarios
UGSV Enterprise Edition Migration Guide
Integrating Tencent Effect for Third-Party Publishers (Flutter)
Integrating Beauty AR Web into Mini Programs
Tencent Effect Studio Usage
Beauty AR Web
Overview
Quick Start
SDK Integration
Parameters and APIs
Console Guide
Demos
Preset Effect List
Practical Tutorial
FAQs
FAQs
General
Technical
License
Legacy Documentation
Recommended Parameters in Beautification Scenarios
Beauty Parameters Table
One-Minute Integration of TRTC
One-Minute Integration of Live Streaming
TE SDK Policy
Privacy Policy
Data Processing And Security Agreement
Contact Us

Flutter

PDF
Focus Mode
Font Size
Last updated: 2025-03-03 17:55:23
To minimize the package size, you may opt to download the SDK-required .so libraries (present in Android, absent in iOS), model resources, and material resources (such as filters and stickers) via the internet.
Android
iOS

SDK Integration

Download SDK, decompress it, and then find the .zip compressed package in the "SDK" directory and decompress it again. You will see the following files. Compress the model files in assets and the so file compressed package in jniLibs on your server, and then download and use them online. Copy xmagic-xxxx.aar under libs to the android/app/libs folder, and add api fileTree(dir: "libs", include: ['*.aar']) in dependencies of app/build.gradle

20240516-205143@2x



Dynamic Loading of Shared Objects

Download the compressed shared object (SO) package to the application installation directory and extract it. Subsequently, invoke the setLibPathAndLoad method of the TencentEffectApiAndroid object to load the SO.
/**
* @param libPath is the folder path used to store the .so files, for example: xxx/xxx/arm64-v8a or xxx/xxx/armeabi-v7a.
**/
Future<bool> setLibPathAndLoad(String libPath);

Dynamic Model Loading

Download the model files to the application installation directory and extract them. Invoke the TencentEffectApiAndroid object's addAiMode to copy the model files to a specified directory.
/**
* @param inputDir The path of the folder to be copied, referring to the "Light3DPlugin", "LightCore", "LightHandPlugin", "LightBodyPlugin", "LightSegmentPlugin" folders.
* @param resDir This path should be consistent with the path set by the setResourcePath method.
* @param callBack Callback for the result of the copy, 0 indicates a successful copy.
**/
void addAiMode(String inputDir, String resDir, AddAiModeCallBack callBack) ;

Dynamic Material Loading

Materials must be downloaded by the user, saved to the SD card or the installation directory, and unzipped. When utilizing the materials, invoke the setEffect method, specifying the material path in the resPath parameter.
Note:
1. If you are utilizing the panel from the demo, the panel by default employs the path configured via setResourcePath combined with the path specified in the json configuration. Therefore, when using the panel and dynamically downloading materials, it is necessary to download the materials to the path designated by setResourcePath + json configuration file.
2. The term "materials" here refers to filter resources and sticker resources.

SDK Integration

Download the SDK, and extract it. As illustrated below, frameworks contains the SDK, while under resources, model refers to the model files, and motionRes encompasses materials for testing purposes.

Launch your Xcode project and incorporate the xcframework from the frameworks folder into the actual project. Select the target you wish to run, navigate to the General section, and expand the Frameworks, Libraries, and Embedded Content section by clicking on it. Then, click the "+" icon below to add the necessary libraries.
To integrate the SDK, include:
XMagic.xcframework, YTCommonXMagic.xcframework, libpag.xcframework, Audio2Exp.xcframework, TECodec.xcframework
To add the required libraries, include:
MetalPerformanceShaders.framework, CoreTelephony.framework, JavaScriptCore.framework, VideoToolbox.framework, libc++.tbd
Depending on your needs, you may also add other utility libraries such as Masonry.framework (a layout library) and SSZipArchive (a file decompression library).


Dynamic Model Loading

Download the model files to the sandbox, and extract them (for example, to the sandbox path Document/Xmagic). By setting this path when using setResourcePath, the beautification features can utilize the downloaded model files upon initialization.

Dynamic Material Loading

Download the material files independently, download and extract them to the sandbox, and use the setEffect method when employing the materials, filling in the resPath parameter with the material path.
Note:
1. If you are using the panel from the demo, the panel in the demo by default uses the path set by setResourcePath combined with the path configured in the json. Therefore, when using the panel and dynamically downloading materials, you need to download the materials to the path specified by setResourcePath + json configuration file.
2. The materials referred to here include filter resources and sticker resources.
Node:
Model files must be processed prior to the activation of the beautification features, while .so files require handling before authentication, thus they should be addressed at the earliest opportunity.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback