美摄SDK For iOS  3.7.2
构造函数 | 类方法 | 属性 | 所有成员列表
NvsEffectSdkContext类 参考

Effect SDK上下文类 更多...

#import <NvsEffectSdkContext.h>

类 NvsEffectSdkContext 继承关系图:

构造函数

(NSArray *) - getAllBuiltinVideoFxNames
 获取全部内嵌视频特效名称列表 更多...
 
(NvsVideoEffect *) - createVideoEffect:aspectRatio:
 创建特效对象 更多...
 
(NvsVideoEffect *) - createVideoEffect:aspectRatio:realTime:
 创建特效对象 更多...
 
(NvsVideoEffectTransition *) - createVideoTransition:aspectRatio:
 创建转场对象 更多...
 
(NvsVideoEffectAnimatedSticker *) - createAnimatedSticker:duration:isPanoramic:packageId:aspectRatio:
 创建贴纸对象 更多...
 
(NvsVideoEffectAnimatedSticker *) - createCustomAnimatedSticker:duration:isPanoramic:packageId:customImageFilePath:aspectRatio:
 创建自定义贴纸对象 更多...
 
(NvsVideoEffectCompoundCaption *) - createCompoundCaption:duration:packageId:aspectRatio:
 创建复合字幕对象 更多...
 
(NvsVideoEffectCaption *) - createCaption:inPoint:duration:captionStylePackageId:aspectRatio:
 创建字幕 更多...
 
(NvsVideoEffectCaption *) - createPanoramicCaption:inPoint:duration:captionStylePackageId:aspectRatio:
 在时间线上添加全景图字幕 更多...
 
(NvsVideoEffectCaption *) - createModularCaption:inPoint:duration:aspectRatio:
 在时间线上添加模块字幕 更多...
 
(NvsEffectRenderCore *) - createEffectRenderCore
 创建特效渲染对象 更多...
 
(NSString *) - registerFontByFilePath:
 根据文件路径注册字体 更多...
 
(void) - UnregisterFontByFilePath:
 根据文件路径注销字体 更多...
 

类方法

(BOOL) + verifySdkLicenseFile:
 验证SDK授权文件。注意:授权文件接口必须在NvsStreamingContext初始化之前调用。 更多...
 
(NvsEffectSdkContext *) + sharedInstance:
 获取effect sdk上下文的唯一实例 更多...
 
(void) + destroyInstance
 销毁effect sdk上下文实例。 更多...
 
(int) + hasARModule
 检测当前SDK是否含有AR模块 更多...
 
(BOOL) + initHumanDetection:licenseFilePath:features:
 初始化人体检测机制 更多...
 
(BOOL) + initHumanDetectionExt:licenseFilePath:features:
 初始化人体检测机制 更多...
 
(BOOL) + setupHumanDetectionData:dataFilePath:
 安装人体检测相关数据包 更多...
 
(void) + closeHumanDetection
 关闭人体检测机制 更多...
 
(void) + getSdkVersion:minorVersion:revisionNumber:
 获取美摄SDK的版本信息 更多...
 

属性

NvsAssetPackageManagerassetPackageManager
 素材包管理器 更多...
 

详细描述

Effect SDK上下文类

函数文档

◆ closeHumanDetection

+ (void) closeHumanDetection

关闭人体检测机制

自从
2.5.0

◆ createAnimatedSticker:duration:isPanoramic:packageId:aspectRatio:

- (NvsVideoEffectAnimatedSticker *) createAnimatedSticker: (int64_t)  inPoint
duration: (int64_t)  duration
isPanoramic: (bool)  isPanoramic
packageId: (NSString *)  packageId
aspectRatio: (NvsEffectRational aspectRatio 

创建贴纸对象

参数
inPoint贴纸的时间起点
duration贴纸的时长
isPanoramic是否是全景贴纸
animatedStickerId贴纸资源包id
aspectRatio贴纸的画幅比。
返回
返回创建的贴纸对象

◆ createCaption:inPoint:duration:captionStylePackageId:aspectRatio:

- (NvsVideoEffectCaption *) createCaption: (NSString *)  captionText
inPoint: (int64_t)  inPoint
duration: (int64_t)  duration
captionStylePackageId: (NSString *)  captionStylePackageId
aspectRatio: (NvsEffectRational aspectRatio 

创建字幕

参数
captionText字幕的文字
inPoint字幕在时间线上的起点(单位微秒)
duration字幕显示时长(单位微秒)
captionStylePackageId字幕样式包Id,不存在的话,可以传空字符串或者null
aspectRatio字幕的画幅比。
返回
返回时间线字幕对象
以下情况会返回null:
1.没有字幕功能授权;
2.如果inPoint小于0,或者duration不大于0。
自从
2.20.0

◆ createCompoundCaption:duration:packageId:aspectRatio:

- (NvsVideoEffectCompoundCaption *) createCompoundCaption: (int64_t)  inPoint
duration: (int64_t)  duration
packageId: (NSString *)  packageId
aspectRatio: (NvsEffectRational aspectRatio 

创建复合字幕对象

参数
inPoint字幕的时间起点
duration字幕的时长
packageId字幕资源包id
aspectRatio字幕的画幅比。
返回
返回创建的复合字幕对象

◆ createCustomAnimatedSticker:duration:isPanoramic:packageId:customImageFilePath:aspectRatio:

- (NvsVideoEffectAnimatedSticker *) createCustomAnimatedSticker: (int64_t)  inPoint
duration: (int64_t)  duration
isPanoramic: (bool)  isPanoramic
packageId: (NSString *)  packageId
customImageFilePath: (NSString *)  customImageFilePath
aspectRatio: (NvsEffectRational aspectRatio 

创建自定义贴纸对象

参数
inPoint贴纸的时间起点
duration贴纸的时长
isPanoramic是否是全景贴纸
animatedStickerId贴纸资源包id
customImageFilePath自定义贴纸图片路径
aspectRatio贴纸的画幅比。
返回
返回创建的贴纸对象

◆ createEffectRenderCore

- (NvsEffectRenderCore *) createEffectRenderCore

创建特效渲染对象

返回
返回创建的特效渲染对象

◆ createModularCaption:inPoint:duration:aspectRatio:

- (NvsVideoEffectCaption *) createModularCaption: (NSString *)  captionText
inPoint: (int64_t)  inPoint
duration: (int64_t)  duration
aspectRatio: (NvsEffectRational aspectRatio 

在时间线上添加模块字幕

参数
captionText字幕的文字
inPoint字幕在时间线上的起点(单位微秒)
duration字幕显示时长(单位微秒)
aspectRatio字幕的画幅比。
返回
返回时间线字幕对象
以下情况会返回null:
1.没有字幕功能授权;
2.如果inPoint小于0,或者duration不大于0。
自从
2.20.0

◆ createPanoramicCaption:inPoint:duration:captionStylePackageId:aspectRatio:

- (NvsVideoEffectCaption *) createPanoramicCaption: (NSString *)  captionText
inPoint: (int64_t)  inPoint
duration: (int64_t)  duration
captionStylePackageId: (NSString *)  captionStylePackageId
aspectRatio: (NvsEffectRational aspectRatio 

在时间线上添加全景图字幕

参数
captionText字幕的文字
inPoint字幕在时间线上的入点(单位微秒)
duration字幕的显示时长(单位微秒)
captionStylePackageId字幕样式包Id,不存在的话,可以传空字符串或者null
aspectRatio字幕的画幅比。
返回
返回时间线字幕对象
以下情况会返回null:
1.没有字幕功能授权;
2.如果inPoint小于0,或者duration不大于0。
自从
2.20.0

◆ createVideoEffect:aspectRatio:

- (NvsVideoEffect *) createVideoEffect: (NSString *)  effectId
aspectRatio: (NvsEffectRational aspectRatio 

创建特效对象

参数
effectId特效id。对于内嵌视频特效,就是特效的名字,如果是资源包特效,就是资源包id
aspectRatio横纵比
返回
返回创建的特效对象

◆ createVideoEffect:aspectRatio:realTime:

- (NvsVideoEffect *) createVideoEffect: (NSString *)  effectId
aspectRatio: (NvsEffectRational aspectRatio
realTime: (BOOL)  realTime 

创建特效对象

参数
effectId特效id。对于内嵌视频特效,就是特效的名字,如果是资源包特效,就是资源包id
aspectRatio横纵比
realTime实时模式
返回
返回创建的特效对象

◆ createVideoTransition:aspectRatio:

- (NvsVideoEffectTransition *) createVideoTransition: (NSString *)  transitionId
aspectRatio: (NvsEffectRational aspectRatio 

创建转场对象

参数
transitionId转场id。对于内嵌视频转场特效,就是特效的名字,如果是资源包特效,就是资源包id
aspectRatio横纵比
返回
返回创建的转场特效对象

◆ destroyInstance

+ (void) destroyInstance

销毁effect sdk上下文实例。

参见
+ sharedInstance:

◆ getAllBuiltinVideoFxNames

- (NSArray *) getAllBuiltinVideoFxNames

获取全部内嵌视频特效名称列表

返回
返回包含所有内嵌的视频特效名称的数组对象

◆ getSdkVersion:minorVersion:revisionNumber:

+ (void) getSdkVersion: (int *)  majorVersion
minorVersion: (int *)  minorVersion
revisionNumber: (int *)  revisionNumber 

获取美摄SDK的版本信息

参数
majorVersion主版本号
minorVersion次版本号
revisionNumber修订版本号
自从
2.23.0

◆ hasARModule

+ (int) hasARModule

检测当前SDK是否含有AR模块

返回
返回值0表示不含有AR模块,大于0表示含有AR模块
自从
2.5.0

◆ initHumanDetection:licenseFilePath:features:

+ (BOOL) initHumanDetection: (NSString *)  modelFilePath
licenseFilePath: (NSString *)  licenseFilePath
features: (int)  features 

初始化人体检测机制

参数
modelFilePath人脸模型文件路径
licenseFilePath授权文件路径
features人体检测特征标志字段。请参见人体检测特征标志
返回
返回值表示是否成功
自从
2.5.0

◆ initHumanDetectionExt:licenseFilePath:features:

+ (BOOL) initHumanDetectionExt: (NSString *)  modelFilePath
licenseFilePath: (NSString *)  licenseFilePath
features: (int)  features 

初始化人体检测机制

参数
modelFilePath人脸模型文件路径
licenseFilePath授权文件路径
features人体检测特征标志字段。请参见人体检测特征标志
自从
2.17.1

◆ registerFontByFilePath:

- (NSString *) registerFontByFilePath: (NSString *)  filePath

根据文件路径注册字体

返回
返回字体的fontFamily,如果文件路径为空,或者注册失败返回空字符串,如果context不存在返回nil.
自从
2.23.0

◆ setupHumanDetectionData:dataFilePath:

+ (BOOL) setupHumanDetectionData: (int)  dataType
dataFilePath: (NSString *)  dataFilePath 

安装人体检测相关数据包

参数
dataType人体检测数据包类型。请参见人体检测数据包类型
dataFilePath数据文件路径
返回
返回值表示是否成功
自从
2.6.0

◆ sharedInstance:

+ (NvsEffectSdkContext *) sharedInstance: (NvsEffectSdkContextFlag flags

获取effect sdk上下文的唯一实例

返回
返回effect sdk上下文的对象实例
参见
+ destroyInstance

◆ UnregisterFontByFilePath:

- (void) UnregisterFontByFilePath: (NSString *)  filePath

根据文件路径注销字体

自从
2.23.0

◆ verifySdkLicenseFile:

+ (BOOL) verifySdkLicenseFile: (NSString *)  sdkLicenseFilePath

验证SDK授权文件。注意:授权文件接口必须在NvsStreamingContext初始化之前调用。

参数
sdkLicenseFilePathSDK授权文件路径
返回
返回BOOL值。YES表示授权验证成功,NO则验证失败。若验证失败,则后续的视频预览和生成视频会出现水印。

属性说明

◆ assetPackageManager

- (NvsAssetPackageManager*) assetPackageManager
readatomicassign

素材包管理器


该类的文档由以下文件生成: