Effect SDK上下文类  
 更多...
#import <NvsEffectSdkContext.h>
◆ closeHumanDetection
      
        
          | + (void) closeHumanDetection  | 
           | 
           | 
           | 
        
      
 
 
◆ createAnimatedSticker:duration:isPanoramic:packageId: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:
创建复合字幕对象 
- 参数
 - 
  
    | 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
◆ createModularCaption:inPoint:duration: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:
创建特效对象 
- 参数
 - 
  
    | effectId | 特效id。对于内嵌视频特效,就是特效的名字,如果是资源包特效,就是资源包id  | 
    | aspectRatio | 横纵比  | 
  
   
- 返回
 - 返回创建的特效对象 
 
 
 
◆ createVideoEffect:aspectRatio:realTime:
创建特效对象 
- 参数
 - 
  
    | effectId | 特效id。对于内嵌视频特效,就是特效的名字,如果是资源包特效,就是资源包id  | 
    | aspectRatio | 横纵比  | 
    | realTime | 实时模式  | 
  
   
- 返回
 - 返回创建的特效对象 
 
 
 
◆ createVideoTransition:aspectRatio:
创建转场对象 
- 参数
 - 
  
    | transitionId | 转场id。对于内嵌视频转场特效,就是特效的名字,如果是资源包特效,就是资源包id  | 
    | aspectRatio | 横纵比  | 
  
   
- 返回
 - 返回创建的转场特效对象 
 
 
 
◆ destroyInstance
◆ getAllBuiltinVideoFxNames
      
        
          | - (NSArray *) getAllBuiltinVideoFxNames  | 
           | 
           | 
           | 
        
      
 
获取全部内嵌视频特效名称列表 
- 返回
 - 返回包含所有内嵌的视频特效名称的数组对象 
 
 
 
◆ getSdkVersion:minorVersion:revisionNumber:
      
        
          | + (void) getSdkVersion:  | 
           | 
          (int *)  | 
          majorVersion | 
        
        
          | minorVersion: | 
           | 
          (int *)  | 
          minorVersion | 
        
        
          | revisionNumber: | 
           | 
          (int *)  | 
          revisionNumber  | 
        
        
           | 
           | 
           |  | 
        
      
 
获取美摄SDK的版本信息 
- 参数
 - 
  
    | majorVersion | 主版本号  | 
    | minorVersion | 次版本号  | 
    | revisionNumber | 修订版本号  | 
  
   
- 自从
 - 2.23.0 
 
 
 
◆ 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:
◆ UnregisterFontByFilePath:
      
        
          | - (void) UnregisterFontByFilePath:  | 
           | 
          (NSString *)  | 
          filePath | 
           | 
        
      
 
 
◆ verifySdkLicenseFile:
      
        
          | + (BOOL) verifySdkLicenseFile:  | 
           | 
          (NSString *)  | 
          sdkLicenseFilePath | 
           | 
        
      
 
验证SDK授权文件。注意:授权文件接口必须在NvsStreamingContext初始化之前调用。 
- 参数
 - 
  
    | sdkLicenseFilePath | SDK授权文件路径  | 
  
   
- 返回
 - 返回BOOL值。YES表示授权验证成功,NO则验证失败。若验证失败,则后续的视频预览和生成视频会出现水印。 
 
 
 
◆ assetPackageManager
该类的文档由以下文件生成: