Introduction to the Use of MEISHE Material
The outstanding Meishe SDK Asset Library is a highly distinctive SDK feature service. Through the thousands of effect styles in the Asset Center, developers can utilize top-tier video processing effects without incurring additional design costs. The following sections provide a step-by-step introduction to asset usage.
I. Classification of Asset Effects
Meishe SDK assets are categorized into 14 primary types based on functional type and scenario.
You can browse sample effects directly in the Asset Center on the website, or experience the effects of personal assets through the 【Meishe】SDK Demo App.
The Meishe demo can be downloaded from Google app markets, or you can download the experience demo from the official website.
II. Using Asset Effects in Programs
Overview: The Meishe SDK allows developers to try out the SDK and assets free of charge without any cost. The development code used during the trial period can still be used after formal authorization without any changes, greatly optimizing the development cycle.
2.1 Obtaining the Meishe SDK
Before using Meishe asset packages, you need to download the Meishe SDK, as using Meishe asset packages is based on the Meishe SDK.
- First, log in to the Meishe SDK website: en.meishesdk.com
- Register on the website as required
- After successful registration, go to 【Developer Center】-【SDK Download and Documentation】, download the latest SDK, and refer to the development documentation for development.
2.2 Relationship Between Assets and SDK Usage
StreamingSDK | |||||
---|---|---|---|---|---|
Watermark Status | SdkAuthorization | AssetAuthorization | Package name | Process Efficiency | |
Ⅰ | No | Use sdkdemoAuth | Not Required | Use sdkdemoPkgName | Fastest |
Ⅱ | Yes | Not Applied | Not Required | Use u personal PkgNam | faster |
Ⅲ | No | Applied | Required | Use u personal PkgNam | Fast |
Note: Effect SDK integration requires both SDK authorization and asset authorization.
2.3 Process for Obtaining Asset Authorization
If you want to obtain asset authorization, first confirm that you have added an application and obtained SDK authorization.
The process for obtaining asset authorization is as follows:
【Asset Center】-【All Assets】-【Select Category】-【Browse Assets】-【Purchase 0-point Assets】
Then go to 【My Homepage】-【My Assets】-【Purchased Assets】-【Download】
Assets downloaded from "Purchased" and "Self-made" come with asset authorization.
Assets downloaded directly from the Asset Center do not have asset authorization, only the asset package.
Assets downloaded from "Purchased" and "Self-made" include the following two files:
The asset file itself
The corresponding authorization for the asset
At this point, you have obtained the formal authorization file for this asset. Next, you need to use it formally in your development.
2.4 Methods for Using Authorized Assets on Various Platforms
Once you have obtained the asset file and its corresponding authorization, you can use them in an authorized SDK. You need to pass the corresponding authorization file when installing and using a specific asset to ensure normal usage. The specific methods are as follows:
After initializing the StreamingContext, install via the resource package manager. Installation code is as follows:
1 Usage Method on Android
assetPackageFilePath | The file path of the resource package to be installed |
---|---|
licenseFilePath | The path of the authorization file for the resource package to be installed |
type | The type of the resource package to be installed. Note: The input parameters are static int attribute values starting with "ASSET_PACKAGE_TYPE". Please refer to asset packeage type |
synchronous | Whether to perform synchronous installation. If the value is true, the installation process will block the current thread until it is successful or fails; if false, the result of the installation process will be asynchronously notified through the delegate (but also notified in the current thread). Note: If the type is a template type, only asynchronous installation can be used. |
assetPackageId | Output parameter, return the ID of this resource package |
// Example: Installing a caption style.
// captionStyleFilePath represents the caption style package path,
// licenseFilePath represents the license file path for the caption style,
// captionStylePackageId is a variable to store the returned caption style package ID.
// Template installation listener:
NvsAssetPackageManager packageManager = streamingContext.getAssetPackageManager();
packageManager.setCallbackInterface(new NvsAssetPackageManager.AssetPackageManagerCallback() {
@Override
public void onFinishAssetPackageInstallation(String assetPackageId, String error, int type, int errorCode) {
// Callback triggered when installation finishes
}
@Override
public void onFinishAssetPackageUpgrading(String assetPackageId, String error, int type, int errorCode) {
// Callback triggered when upgrade finishes
}
});
// Synchronous installation
int result = packageManager.installAssetPackage(captionStyleFilePath,
licenseFilePath, NvsAssetPackageManager.ASSET_PACKAGE_TYPE_CAPTIONSTYLE,
true, captionStylePackageId);
Asset Update: Assets have version numbers. The version number increments with each effect update. To use a higher version effect when the asset is already installed, you must call the update interface; otherwise, the higher version effect will not be applied.
assetPackageFilePath | The file path of the resource package to be upgraded |
---|---|
licenseFilePath | The path of the authorization file for the resource package to be upgraded |
type | Type of the resource package to be upgraded. Note: The input parameters to be entered are static int attribute values starting with "ASSET_PACKAGE_TYPE". Please refer toasset packeage type |
synchronous | Whether to perform a synchronous upgrade. If the value is true, the upgrade process will block the current thread until it succeeds or fails; if false, the result of the upgrade process will be asynchronously notified through the delegate (but also notified in the current thread). Note: If the type is a template type, only asynchronous upgrade can be used. |
assetPackageId | Output parameter, return the ID of this resource package |
packageManager.upgradeAssetPackage(assetPackageFilePath, licenseFilePath, packageType, true, packageId);
You can also refer to the following links for detailed information:
https://www.meishesdk.com/android/doc_en/html/content/assetsPackageInstall_8md.html
2 Usage Method on iOS
/*
Install a caption style.
captionStyleFilePath represents the caption style package path,
licenseFilePath represents the license file path for the caption style,
captionStylePackageId is a variable to store the returned caption style package ID.
*/
NvsAssetPackageManagerError error = [m_streamingContext.assetPackageManager installAssetPackage:captionStyleFilePath license:licenseFilePath type:NvsAssetPackageType_CaptionStyle sync:YES assetPackageId:captionStylePackageId];
// Example: Installing a video effect (VideoFx).
NSMutableString *fxPackageId = [[NSMutableString alloc] init]; // Variable to store the effect package ID
// The asset package doesn't necessarily have to be bundled with the app; it can also be downloaded online to the sandbox, as long as the path is accessible.
NSString *appPath = [[NSBundle mainBundle] bundlePath];
NSString *packagePath = [appPath stringByAppendingPathComponent:@"7FFCF99A-5336-4464-BACD-9D32D5D2DC5E.videofx"];
NSString *licensePath = [appPath stringByAppendingPathComponent:@"7FFCF99A-5336-4464-BACD-9D32D5D2DC5E.lic"];
NvsAssetPackageManagerError error = [streamingContext.assetPackageManager installAssetPackage:packagePath license:licensePath type:NvsAssetPackageType_VideoFx sync:YES assetPackageId:fxPackageId];
if (error != NvsAssetPackageManagerError_NoError && error != NvsAssetPackageManagerError_AlreadyInstalled) {
NSLog(@"Failed to install asset package. Error: %ld", (long)error);
}
You can also refer to the following links for detailed information:
https://www.meishesdk.com/ios/doc_en/html/content/Tutorial_8md.html# (Note: Link points to Chinese documentation section "Extended Capture Effects")
https://www.meishesdk.com/ios/doc_en/html/content/Tutorial_8md.html# (Note: Link points to Chinese documentation section "Asset Package Management")
III. Asset Download Service
The Meishe asset platform currently only provides asset sales and does not currently provide asset download interfaces. If you require asset backend privatization deployment services, please contact your business representative.