PAG官网 | PAG动效

PAG官网 | PAG动效

  • 首页
  • 产品
  • 功能
  • 文档
  • 案例
  • CN
  • GitHub
  • 论坛交流
  • 免费下载
  • Languages iconEN
    • CN

›TAVMedia

了解 PAG

  • Introduction
  • FAQs

快速开始

  • Install PAGViewer
  • Install PAGExporter
  • Export PAG Files
  • SDK Integration

导出插件

  • Use Configuration Panel
  • Use Exporting Panel
  • Export BMP Compositions
  • Config Fill Modes
  • Config Time Stretch Modes
  • Exporting Shortcut Keys
  • Error Code
  • Auto Detection Rules
  • Text Editing Rules
  • Add Text Background
  • Export Audio
  • Manually Install PAGExporter

预览工具

  • Preview Replacements
  • View File Structure
  • Preview Shortcut Keys
  • Export Image Sequence
  • File Encryption
  • Add Watermark
  • Upgrade to Beta Version

性能优化

  • Use Performance Panel
  • PAG File Optimization

移动端进阶

  • Common API Overview
  • Use PAGImageView
  • Video Replacement
  • Play Audio
  • Text Layer Description
  • Use Encripted File
  • Export To Video
  • SDK Authentication

Web 进阶

  • SDK Installation
  • Load PAG File
  • Play PAG File
  • Platform Capabilities
  • Use WebWorker

API 参考

  • API Document

视频教程

  • PAG Workflow
  • File Optimization Best Practices
  • Use PAGExporter Panel
  • PAG Online Q&A

资源下载

  • PAGViewer Installer
  • PAG Test Files
  • PAG Demo Projects
  • China LiveVideoStackCon2022
  • PAG Conversion Tool
  • PAG File Format Spec

TAVMedia

  • Introduction to TAVMedia
  • TAVMedia Quick access
  • Common API Overview

其他

  • From Lottie To PAG
  • PAG Dictionary

TAVMedia Quick access

SDK acquisition

Android SDK

iOS SDK

Android terminal access

Basic requirements

  • support android 4.4 and above systems.

  • It is recommended to compile with gralde 3.0 and above.

Access method

aar Access

  1. Place the tavmedia aar file in the libs directory of the Android project directory.

  2. Add aar library dependency.

  • In the app's gradle file app/build.gradle, add the following tavmedia library dependencies.

    implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
    // aar mode dependencies need to manually add exifinterface and tavmedia_pag_decode dependencies
    implementation("androidx.exifinterface:exifinterface:2.0.15")
    implementation 'com.tencent.tav:tavmedia_pag_decode:1.0.0' // If the project also depends on libpag, there is no need to add this line
    
  • In the obfuscation list, add the following keep rules for tavmedia.

    -keep class com.tencent.tavmedia.**{*;}
    -keep class androidx.exifinterface.** {*;}
    -keep class org.libpag.** {*;}
    
  1. After the configuration is completed, execute sync and then compile.

maven Access

  1. Modify the build.gradle file in the project directory and add mavenCentral().

    repositories {
      ...
      maven { url "https://mirrors.tencent.com/repository/maven/tencent_public" }    
      ...
     }
    
  2. Add dependencies

  • In the app's gradle file app/build.gradle, add the following tavmedia library dependencies.

    implementation "com.tencent.tav:tavmedia:2.0.12"
    
  • If the project also depends on libpag, please use the following dependencies.

    implementation('com.tencent.tav:tavmedia:2.0.12') {
        exclude group: 'com.tencent.tav', module: 'tavmedia_pag_decode'
    }
    
  • In the obfuscation list, add the following keep rules for tavmedia.

    -keep class com.tencent.tavmedia.**{*;}
    -keep class androidx.exifinterface.** {*;}
    -keep class org.libpag.** {*;}
    

iOS terminal access

Basic requirements

  • support iOS 9 and above.

  • You need to use Xcode11.0 and above for compilation.

Use CocoaPods

  1. Execute the following command in the terminal window to install CocoaPods.

Description:

Ruby environment needs to be installed on Mac before executing the command.

sudo gem install cocoapods
  1. Enter the path where the project is located and execute the following command to create the Podfile file.

    pod init
    
  2. Select the appropriate version according to your project needs and edit the Profile file as follows.

    platform :ios, '8.0'
    target 'App' 
    dopod 'TAVMedia'
    end
    
  3. Execute the following commands in the terminal window to update the local library files and install the SDK.

    pod install
    

    After the pod command is executed, a project file with the .xcworkspace suffix integrated with the SDK will be generated, which can be opened by double-clicking it.

  4. Modify the Bundle Identifier to be consistent with the applied test authorization.

Download SDK and import manually

  1. Download and unzip SDKLibrary file.

  2. Open your Xcode project and add the framework in the folder to the actual project.

  3. Select the TARGETS to run, select General, and expand the Frameworks, Libraries, and Embedded Content item, and click the + icon in the expanded item to add dependent libraries. Add the downloaded TAVMedia.xcframework and FFmpeg.xcframework in turn. As shown below:
    img

  1. Since TAVMedia currently does not support Bitcode, you need to configure Build Settings > Build Options > Enable Bitcode to be No.

  2. Modify the Bundle Identifier to be consistent with the applied test authorization.

TAVMedia SDK License guidelines

TAVMedia License provides an authentication function. After purchasing the corresponding package, you can obtain the official version of the license and get one year of usage rights. If there is no license file for authorized operations, the preview and export screens will have watermarks.

This article will explain and guide the creation, authentication and common problems of License files.

Obtain License

Contact the business, choose to purchase the SDK, and obtain the official version of the License (valid for 1 year until 00:00:00 the day after expiration).

After successful purchase, the URL download address and key of the license file will be provided. Download the corresponding License file through the URL link in the application to the local for authentication and verification.

License Authentication

The corresponding API for authentication is provided in TAVMedia SDK. Please select as needed:

Android

String licenseUrl = "replace_your_license_url";
String licenseAppId = "replace_your_app_id";
String licenseKey = "replace_your_key";

licenseAuthListener = (errorCode, msg) -> {
    if (errorCode == TAVLicense.LICENSE_AUTH_SUCCESS) {
        Log.d("export", "auth success " + msg);
    } else {
        Log.e("export", "auth failed and errorCode is " + errorCode + " " + msg);
    }
};

TAVLicense.getInstance().Auth(getBaseContext(), licenseUrl, licenseKey, licenseAppId, licenseAuthListener);

The core interface class TAVLicense provides the authentication method Auth().

public void Auth(Context context, String url, String key, String appId, TAVLicenseAuthListener listener)

The parameter meanings are as follows:

parameter meaning
context context
url License link address
key key
appId provided during authorization AppID
listener The callback corresponding to the authentication result returns the corresponding error code

iOS

NSString *licenseUrl = @"replace_your_license_url";
NSString *licenseAppId = @"replace_your_app_id";
NSString *licenseKey = @"replace_your_key";
id<TAVLicenseAuthListener> listener = replace_your_Listener;
[TAVLicense Auth:licenseUrl key:licenseKey appID:licenseAppId listener:listener];

The core interface class TAVLicense provides the authentication method Auth().

@interface TAVLicense : NSObject
+ (void)Auth:(NSString *)url key:(NSString *)key appID:(NSString *)appID listener:(id<TAVLicenseAuthListener>)listener;
@end

The parameter meanings are as follows:

parameter meaning
url License link address
key key
appId provided during authorization AppID
listener The callback corresponding to the authentication result returns the corresponding error code

The TAVLicenseAuthListener protocol will return the result after authentication. You can refer to [Error Code] for the returned result information.

@protocol TAVLicenseAuthListener <NSObject>
- (void)onLicenseAuthResult:(TAVLicenseAuthResult)result msg:(NSString *)msg;
@end

Error code

error code meaning
0 Authentication successful
-1 Parameter error
-2 APPID error
-3 Package error
-4 time expired
-5 Decryption failed
-6 Licensefile does not exist
-7 License Download error

License renewal

After the license expires, you need to renew and update it on the console, and then perform the authentication operation again.

Related questions

How to get the official version License?

If you need to use the TAVMedia SDK function in your business, please contact the business and select the SDK package according to your needs for purchase.

You can obtain the license after purchase. After binding the license through the console, you can use the corresponding functions.

How long is the license valid for? How to renew the license after it expires?

The validity period of the TAVMedia License is one year (365 days) from the date of issuance of the license after it is successfully created. For example, if you apply for and successfully create a formal license on January 1, 2022, the formal license will expire at 00:00:00 on January 2, 2023.

After the official version license expires, you need to purchase a new license for renewal.

How many package names does the License support? How many authorized units are there?

Currently, a single license only supports one package name, but there is no limit on the number of authorized terminals.

TAVMedia SDK Demo experience

The trial version SDK Demo provides specific scenario applications of TAVMedia to help you quickly develop short video apps for video editing, template applications, and special effects additions. You can get the source code Demo in the card below, and refer to the access guide to access it.

Please refer to the following link to download the source code:

IOS

Android

← Introduction to TAVMediaCommon API Overview →
  • SDK acquisition
  • Android terminal access
    • Basic requirements
    • Access method
  • iOS terminal access
    • Basic requirements
    • Use CocoaPods
    • Download SDK and import manually
  • TAVMedia SDK License guidelines
  • Obtain License
  • License Authentication
    • Android
    • iOS
    • Error code
  • License renewal
  • Related questions
  • TAVMedia SDK Demo experience
Address: Tencent Binhai Building, No. 33 Haitian Second Road, Nanshan District, Shenzhen, Guangdong Province, China.
TEL: 0755-86013388
QQ Group: 893379574
Copyright © 2018 - 2025 Tencent. All Rights Reserved.
Privacy Policy
公司地址:广东省深圳市南山区海天二路33号腾讯滨海大厦
联系电话:0755-86013388
QQ群:893379574
Copyright © 2018 - 2025 Tencent. All Rights Reserved.
隐私政策
Copyright © 2018 - 2025 Tencent. All Rights Reserved.
Address: Tencent Binhai Building, No. 33 Haitian Second Road, Nanshan District, Shenzhen, Guangdong Province, China.
TEL: 0755-86013388
QQ Group: 893379574
Privacy Policy
Copyright © 2018 - 2025 Tencent. All Rights Reserved.
公司地址:广东省深圳市南山区海天二路33号腾讯滨海大厦
联系电话:0755-86013388
QQ群:893379574
隐私政策