涂图

  • 首页
  • 解决方案
    • 拍照和图片编辑
    • 视频录制和后期编辑
    • 模板视频
    • 人像美颜
    • 人脸特效
    • 滤镜特效
    • 贴纸特效
  • API服务
    • 人像服务
    • 视频融合
    • 人脸云
    • 在线滤镜
  • 客户案例
  • 下载
  • 文档
  • 关于我们
  • 控制台
  • 一、新手上路
  • 控制台操作说明
    • 控制台使用说明
    • 自定义资源上传说明
  • 二、SDK 文档
  • 图像 SDK
    • 产品说明
      • 产品指南
      • 性能测试报告
    • iOS 文档
      • 快速开始
      • 安装与更新
      • 集成向导
      • 相机组件的使用
      • 相册组件的使用
      • 照片美化组件的使用
      • 主题包基础使用
      • 自定义滤镜
      • 自定义贴纸
      • 自定义界面
      • 自定义 ProgressHUD 提示框(2.0.0~3.2.7)
      • 自定义 ProgressHUD 提示框
      • API 文档
      • 致谢
    • Android 文档
      • 快速开始
      • 安装与更新
      • 集成向导
      • 相机组件的使用
      • 照片美化组件的使用
      • 头像设置组件的使用
      • 多选相册组件的使用
      • 主题包基础使用
      • 自定义贴纸
      • 自定义滤镜
      • 自定义界面
      • 自定义进度信息提示框
      • 自定义 Activity 打开相机
      • API 文档
      • 致谢
    • iOS 技术问题
      • 「Incorrenct app key」
      • 更换滤镜效果图
      • 导航栏与状态栏
      • 组件中使用部分滤镜
      • Cocoapods 相关问题
      • 图片尺寸变化
      • Photos.framework 相关错误
      • 多包名发布
      • GPUImage 的相关错误
      • TuSDKTSALAsset 转换系统对象
      • 滤镜无法显示名称
      • 获取相机的点击事件
    • Android 技术问题
      • Incorrenct app key
      • 重复引用包
      • Recyclerview 库缺失
      • 方法数超出 65536 限制
      • 传入图片路径
      • 指定裁剪比例
      • 指定相册每行列数
      • 禁用相册自动跳转
      • 如何使用部分滤镜?
      • 代码混淆
      • TuSDK 使用的依赖库
      • 多渠道打包
      • 设置相机输出尺寸
      • 相机横屏设置
      • 自定义照片美化组件各功能模块效果默认参数值
    • 拼图设计
      • 拼图模板导出
    • 版本更新日志
      • iOS 版本更新日志
      • Android 更新日志
  • 视频剪辑 SDK
    • 产品说明
      • 产品指南
    • iOS文档
      • TuSDK Video Editor iOS 接入文档
    • Android文档
      • TuSDK Video Editor Android 接入文档
    • 版本更新日志
      • iOS 版本更新日志
      • Android 版本更新日志
  • 流处理(特效相机) SDK
    • 产品说明
      • 产品指南
    • iOS 文档
      • TuSDK特效相机接入文档-iOS
      • TuSDK直播特效接入说明-iOS
    • Android 文档
      • TuSDK特效相机接入文档-Android
      • TuSDK直播特效接入说明-Android
    • 版本更新日志
      • iOS 版本更新日志
      • Android 版本更新日志
  • 视频融合 SDK
    • 产品说明
      • 产品指南
      • 模板管理
    • iOS 文档
      • 快速开始
      • 安装与更新
      • TuSDK EVA 接入说明 2.0
      • API文档
    • Android 文档
      • 快速开始
      • 安装与更新
      • TuSDK EVA 接入说明 (2.0.0+)
      • API 文档
    • 模板设计
      • (新)标准模板设计规范
      • (旧)标准模板设计规范
      • 支持的 AE 功能和属性
      • 动态模板设计规范
    • 模板导出
      • (新)模板导出插件安装
      • (新)模板导出插件使用
      • (旧)模板导出插件安装
      • (旧)模板导出插件使用
      • (旧)模板效果查看器
      • (旧)模板打包规范
    • 版本更新日志
      • iOS 版本更新日志
      • Android 版本更新日志
      • 导出插件版本更新日志
      • 效果查看器更新日志
  • 短视频 SDK
    • 产品说明
      • 产品指南
      • 性能测试报告
    • iOS 文档
      • 快速开始
      • 集成向导
      • 录制相机的使用
      • 视频编辑器的使用
      • 功能 API 的使用
      • API 文档
    • Android 文档
      • 快速开始
      • 集成向导
      • 录制相机的使用
      • 视频编辑器的使用
      • 功能 API 的使用
      • API 文档
    • iOS 技术问题
      • 常见问题
    • Android 技术问题
      • 常见问题
    • 版本更新日志
      • iOS 版本更新日志
      • Android 版本更新日志
  • 三、云服务文档
  • 人像服务
    • 使用文档
      • 快速入门
      • 核心功能
    • API概述
      • API 概述
      • API 文档
    • 常见问题
      • 常见问题
  • 视频融合(云渲染)
    • 使用文档
      • 快速入门
      • 模板管理
    • API概述
      • API概述
      • API 文档
    • 模板设计
      • (新)标准模板设计规范
      • (旧)标准模板设计规范
      • 支持的 AE 功能和属性
      • 动态模板设计规范
    • 模板导出
      • (新)模板导出插件安装
      • (新)模板导出插件使用
      • (旧)模板导出插件安装
      • (旧)模板导出插件使用
      • (旧)模板效果查看器
      • (旧)模板打包规范
    • 常见问题
    • 版本更新日志
      • 导出插件版本更新日志
      • 效果查看器更新日志
  • 人脸云
    • 使用文档
      • 快速入门
      • 核心功能
    • API 概述
      • API 概述
    • 常见问题
      • 常见问题
  • 在线滤镜
    • 使用文档
      • 快速入门
      • 核心功能
      • FILTER API
      • API 错误码表
    • API概述
      • API 概述
    • 常见问题
      • 常见问题
  • 四、综合
  • 涂图隐私协议
  • 用户退出机制
  • 动态贴纸设计规范
  • 美妆贴纸设计规范
  • 云服务账单说明
  • 应用包名与密钥
  • 基础服务开发者升级流程
  • 五、常见问题
  • 常见问题
  • 遇到问题,怎么办?
  • 如何使用贴纸管理、滤镜管理?

TuSDK Video Editor 接入说明文档

SDK基础说明

接入示例

// 1.初始化处理环境
[TUPEngine Init:nil];

// 2.创建Video Editor
let editor = TUPVEditor()
let config = TUPVEditor_Config()
config.width = 800
config.height = 800
editor.create(with: config)

// 3.创建Video Clip
let videoConfig = TUPConfig()
videoConfig.setString(videoPath, forKey: TUPVEFileClip_CONFIG_PATH)
let videoClip = TUPVEditorClip(editor.getContext(), withType: TUPVEFileClip_VIDEO_TYPE_NAME)
videoClip.setConfig(videoConfig)

// 4.创建Audio Clip
let audioConfig = TUPConfig()
audioConfig.setString(audioPath, forKey: TUPVEFileClip_CONFIG_PATH)
let audioClip = TUPVEditorClip(editor.getContext(), withType: TUPVEFileClip_AUDIO_TYPE_NAME)
audioClip.setConfig(audioConfig)

// 5.创建视频层
let videoLayer = TUPVEditorClipLayer(forVideo: editor.getContext())
val videoLayerConfig = Config()
videoLayer.setConfig(videoLayerConfig)

// 6.创建音频层
let audioLayer = TUPVEditorClipLayer(forAudio: editor.getContext())
val audioLayerConfig = Config()
audioLayer.setConfig(audioLayerConfig)


// 7.将Clip 添加到对应层内
videoLayer.add(videoClip, at: 100)
audioLayer.add(audioClip, at: 100)

// 8.将对应Layer加入到对应的Composition中
let videoComp = editor.videoComposition()
videoComp.add(videoLayer, at: 100)

let audioComp = editor.audioComposition()
audioComp.add(audioLayer, at: 100)

// 9.初始化播放器
let player = EditorAdapter().player

// 10.设置播放状态与进度回调
player.delegate = self

// 11.启动播放器
player.open()

// 12.初始化渲染View
let displayView = TUPDisplayView()
displayView.frame = CGRect(x: 0, y: 0, width: UIScreen.width(), height: UIScreen.width())
[displayView setup:nil];
// 13.绑定播放器
displayView.attach(player)

// 14.创建Effect
var filterEffectBuilder = TUPVETusdkFilterEffect_PropertyBuilder()
var filterVideoEffect = TUPVEditorEffect(editor.getContext(), withType: TUPVETusdkFilterEffect_TYPE_NAME)

let config = TUPConfig()
config.setString(code, forKey: TUPVETusdkFilterEffect_CONFIG_NAME)
filterVideoEffect.setConfig(config)

filterVideoEffect.setProperty(filterEffectBuilder.makeProperty(), forKey: TUPVETusdkFilterEffect_PROP_PARAM)

// 15.添加Effect
videoClip.effects().add(filterVideoEffect, at: 100)

基础类说明

Config

Config 相关的属性为不可动态调节的属性,Config属性变动时,需要重新对VideoEditor进行重新构建

Config 接口说明
- (instancetype) init;
- (instancetype) initWithImpl:(void*)config;//pulse::Config

// Config*
- (BOOL) unwrap:(void*)config;

- (BOOL) setNumber:(NSNumber*)number forKey:(NSString*)key;
- (NSNumber*) getNumber:(NSString*)key;


- (BOOL) setIntNumber:(NSInteger)number forKey:(NSString*)key;
- (NSInteger) getIntNumber:(NSString*)key;
- (NSInteger) getIntNumber:(NSString*)key or:(NSInteger)val;


- (BOOL) setDoubleNumber:(double)number forKey:(NSString*)key;
- (double) getDoubleNumber:(NSString*)key;
- (double) getDoubleNumber:(NSString*)key or:(double)val;


- (BOOL) setString:(NSString*)str forKey:(NSString*)key;
- (NSString*) getString:(NSString*)key;


- (BOOL) setData:(NSData*)str forKey:(NSString*)key;
- (NSData*) getData:(NSString*)key;

Property

Property 相关属性为可动态调节属性,Property属性变动时,会实时生效,不需要重新构建VideoEditor

SDK内各层级只可读属性同样通过Property输出,Property构造由各模块自行实现.用户无需手动构造Property。

Clip

Clip作为SDK内的最小单元,负责图片,视频等实例的创建,Clip 类型分别包含 :

  • VideoClip 视频轨道
  • AudioClip 音频轨道
  • ImageClip 图片
  • Text2DClip 文字
  • SilenceClip 静音音频数据

各类型Clip可以通过Config来设置相应的属性,加载对应资源.

VideoClip 属性说明
  • TUPVEFileClip_VIDEO_TYPE_NAME 视频路径
  • TUPVEFileClip_CONFIG_TRIM_START 素材开始位置
  • TUPVEFileClip_CONFIG_TRIM_DURATION 素材持续时长
AudioClip 属性说明
  • TUPVEFileClip_AUDIO_TYPE_NAME 音频路径
  • TUPVEFileClip_CONFIG_TRIM_START 素材开始位置
  • TUPVEFileClip_CONFIG_TRIM_DURATION 素材持续时长
ImageClip 属性说明
  • TUPVEImageClip_CONFIG_PATH 图片路径
  • TUPVEImageClip_CONFIG_BLOB 图片数据
  • TUPVEImageClip_CONFIG_DURATION 图片持续时长
  • TUPVEImageClip_CONFIG_MAX_SIDE 图片最大边长
Text2DClip 属性说明
  • TUPVEText2DClip_CONFIG_DURATION 素材持续时长
Text2DClip Property

@interface TUPVEText2DClip_InteractionInfo : NSObject {

}

/**位置*/
@property(nonatomic) double posX;
@property(nonatomic) double posY;
/**宽高*/
@property(nonatomic) int width;
@property(nonatomic) int height;
/**角度*/
@property(nonatomic) int rotation;

- (instancetype) init;

- (instancetype) init:(TUPProperty*) prop;

@end

/**文字位置*/
typedef NS_ENUM(NSInteger, TUPVEText2DClip_AlignmentType) {
    TUPVEText2DClipAlignmentType_LEFT,
    TUPVEText2DClipAlignmentType_CENTER,
    TUPVEText2DClipAlignmentType_RIGHT
};

@interface TUPVEText2DClip_PropertyHolder : NSObject


/**字体路径*/
@property(nonatomic, copy) NSString* font;
/**文字*/
@property(nonatomic, copy) NSString* text;

@property(nonatomic) int underline;

@property(nonatomic) double posX;
@property(nonatomic) double posY;
/**缩放大小*/
@property(nonatomic) double fontScale;
/**旋转角度*/
@property(nonatomic) int rotation;
/**字间距*/
@property(nonatomic) double textScaleX;
/**行间距*/
@property(nonatomic) double textScaleY;
/**文字描边宽度*/
@property(nonatomic) double strokeWidth;
/**文字描边颜色*/
@property(nonatomic) UIColor* strokeColor;
/**文字颜色*/
@property(nonatomic) UIColor* fillColor;
/**背景颜色*/
@property(nonatomic) UIColor* bgColor;

/**对齐方式*/
@property(nonatomic) TUPVEText2DClip_AlignmentType alignment;

- (instancetype) init;
- (instancetype) initWithProperty:(TUPProperty*) prop;


@end
TUPVESilenceClip 属性说明
  • TUPVESilenceClip_AUDIO_TYPE_NAME 视频路径
  • TUPVESilenceClip_CONFIG_DURATION 素材持续时长
TUPVEditorClip 接口说明

@property(nonatomic, readonly) TUPVEditorCtx* context;
@property(nonatomic, readonly) NSString* mediaType;

// 构造默认Clip
- (instancetype) init NS_UNAVAILABLE;
// 根据传入的类型构造Clip
- (instancetype) init:(TUPVEditorCtx*) ctx withType:(NSString*) type;
// 根据传入的Model构造Clip
- (instancetype) init:(TUPVEditorCtx*) ctx withModel:(TUPVEditorModel*) model;

// 返回当前Effects列表
- (TUPVEditorEffects*) effects;
// 设置Config
- (BOOL) setConfig:(TUPConfig*) config;
// 获取Config
- (TUPConfig*) getConfig;
// 设置Property
- (BOOL) setProperty:(TUPProperty*) prop forKey:(NSString*) key;
// 获取Property
- (TUPProperty*  _Nullable) getProperty:(NSString*) key;

// 获取Model
- (TUPVEditorModel*) getModel;
// 设置Model
- (BOOL) setModel:(TUPVEditorModel*) model;

// Clip预加载
- (BOOL) activate;
// Clip状态复原
- (void) deactivate;
// 获取轨道信息
- (TUPStreamInfo* _Nullable) getStreamInfo;
// 获取类型
- (NSString*) getType;
TUPVEditorLayer

TUPVEditorLayer 用于包含Clip,Layer内部的播放顺序为线性的,Layer的长度取决于内部所有Clip的长度和转场信息.

TUPVEditorLayer 接口说明
@interface TUPVEditorLayer : TUPBase {

// 设置Config
- (BOOL) setConfig:(TUPConfig*) config;
// 获取Config
- (TUPConfig*) getConfig;
// 设置Property
- (BOOL) setProperty:(TUPProperty*) prop forKey:(NSString*) key;
// 获取Property
- (TUPProperty*  _Nullable) getProperty:(NSString*) key;
// 获取Model
- (TUPVEditorModel*) getModel;
// 设置Model
- (BOOL) setModel:(TUPVEditorModel*) model;

// 获取当前轨道信息
- (TUPStreamInfo*  _Nullable) getStreamInfo;

@end
TUPVEditorClipLayer

用于添加Clip的Layer实现

TUPVEditorClipLayer 接口说明
@interface TUPVEditorClipLayer : TUPVEditorLayer {
//
}

/**音视频初始化*/
- (instancetype) initForAudio:(TUPVEditorCtx*) ctx;
- (instancetype) initForVideo:(TUPVEditorCtx*) ctx;
- (instancetype) init:(TUPVEditorCtx*) ctx forVideo:(BOOL) v;

/**从Model中创建ClipLayer*/
- (instancetype) init:(TUPVEditorCtx*) ctx withModel:(TUPVEditorModel*) model;

// 设置转场效果
// 1 --> 2 当前转场需添加在2上面
- (BOOL) setTransition:(TUPVEditorClipLayer_Transition*) transition at:(NSInteger) idx;
// 设置当前索引位置设置的转场效果
- (TUPVEditorClipLayer_Transition*) getTransition:(NSInteger) idx;
// 解除转场
- (BOOL) unsetTransition:(NSInteger) idx;
// 添加Clip
- (BOOL) addClip:(TUPVEditorClip*) clip at:(NSInteger) idx;
// 删除Clip
- (BOOL) deleteClip:(NSInteger) idx;
// 删除全部Clip
- (void) deleteAllClips;
// 交换Clip
- (BOOL) swapClips:(NSInteger) idx1 and:(NSInteger) idx2;

// 获取Clip
- (TUPVEditorClip* _Nullable) getClip:(NSInteger) idx;
// 获取全部Clip
- (NSDictionary<NSNumber*, TUPVEditorClip*>*) getAllClips;

- (TUPVEditorEffects*) effects;


@end
TUPVEditorLayer 属性说明
  • TUPVEditorLayer_CONFIG_START_POS 当前Layer开始位置

  • TUPVEditorLayer_CONFIG_BLEND_MODE 当前Layer混合模式

  • TUPVEditorLayer_PROP_OVERLAY 混合属性调节

  • TUPVEditorLayer_PROP_MIX 混音属性调节

TUPVEditorLayer_OverlayPropertyBuilder 混合属性调节

用于调整多个Layer混合情况下,当前Layer的各混合属性

@interface TUPVEditorLayer_OverlayPropertyHolder : NSObject

// 不透明度
@property(nonatomic) float opacity;
// 混合强度
@property(nonatomic) float blendStrength;
// X 坐标 (0~1)
@property(nonatomic) float pzrPanX;
// Y 坐标 (0~1)
@property(nonatomic) float pzrPanY;
// 缩放比例
@property(nonatomic) float pzrZoom;
// 角度
@property(nonatomic) double pzrRotate;

- (instancetype) init;
- (instancetype) initWithProperty:(TUPProperty*) prop;

@end


@interface TUPVEditorLayer_OverlayPropertyBuilder : NSObject

@property(nonatomic) TUPVEditorLayer_OverlayPropertyHolder* holder;


- (instancetype) init;
- (instancetype) initWithHolder:(TUPVEditorLayer_OverlayPropertyHolder*) holder;


- (TUPProperty*) makeProperty;

@end
TUPVEditorLayer_MixPropertyBuilder 混音强度调节

作用于AudioLayer中,控制混音情况下,各层级混音强度

@interface TUPVEditorLayer_MixPropertyHolder : NSObject

/// Audio mix weight, range [0, +oo]
// 混音强度
@property(nonatomic) float weight;

- (instancetype) init;
- (instancetype) initWithProperty:(TUPProperty*) prop;

@end

@interface TUPVEditorLayer_MixPropertyBuilder : NSObject

@property(nonatomic) TUPVEditorLayer_MixPropertyHolder* holder;

- (instancetype) init;
- (instancetype) initWithHolder:(TUPVEditorLayer_MixPropertyHolder*) holder;

- (TUPProperty*) makeProperty;

@end

Effect

Effect为特效单元,Effect可作用于Clip,Layer,Composition.

特效清单:

  • TUPVERepeatEffect 音视频重复
  • TUPVERepeatEffectV2 时长内音频重复
  • TUPVEStretchEffect 音频变速
  • TUPVETrimEffect 音视频裁剪
  • TUPVECanvasResizeEffect 背景调节
  • TUPVEColorAdjustEffect 颜色调整
  • TUPVECropEffect 画面裁剪
  • TUPVETusdkFilterEffect 颜色滤镜
  • TUPVETusdkMVEffect MV特效
  • TUPVETusdkParticleEffect 魔法特效
  • TUPVETusdkSceneEffect 场景特效
  • TUPVEStretchEffect 视频变速
  • TUPVETransformEffect 视频画面变换
TUPVERepeatEffect
  • TUPVERepeatEffect_CONFIG_BEGIN 重复开始位置
  • TUPVERepeatEffect_CONFIG_END 重复结束位置
  • TUPVERepeatEffect_CONFIG_REPEAT_COUNT 重复次数
TUPVERepeatEffectV2
  • TUPVERepeatEffectV2_CONFIG_DURATION 重复时长
TUPVEStretchEffect
  • TUPVEStretchEffect_CONFIG_STRETCH 速度系数
  • TUPVEStretchEffect_CONFIG_BEGIN 速度调节开始位置
  • TUPVEStretchEffect_CONFIG_END 速度调节结束位置
TUPVETrimEffect
  • TUPVETrimEffect_CONFIG_BEGIN 裁剪开始位置
  • TUPVETrimEffect_CONFIG_END 裁剪结束位置
TUPVECanvasResizeEffect
TUPVECanvasResizeEffect Property

// 背景颜色类型
typedef NS_ENUM(NSInteger, TUPVECanvasResizeEffect_BackgroundType) {
    TUPVECanvasResizeEffect_BackgroundType_Color,  //颜色
    TUPVECanvasResizeEffect_BackgroundType_Blur    //模糊
};

@interface TUPVECanvasResizeEffect_PropertyHolder : NSObject


@property(nonatomic) TUPVECanvasResizeEffect_BackgroundType type;
@property(nonatomic) UIColor* color;
// 模糊强度
@property(nonatomic) double blurStrength;
@property(nonatomic) double panX;
@property(nonatomic) double panY;
// 缩放比例
@property(nonatomic) double zoom;
//角度
@property(nonatomic) double rotate;

- (instancetype) init;
- (instancetype) initWithProperty:(TUPProperty*) prop;

@end

@interface TUPVECanvasResizeEffect_PropertyBuilder : NSObject {

}


@property(nonatomic) TUPVECanvasResizeEffect_PropertyHolder* holder;

- (instancetype) init;
- (instancetype) initWithHolder:(TUPVECanvasResizeEffect_PropertyHolder*) holder;


- (TUPProperty*) makeProperty;

@end
TUPVEColorAdjustEffect
// 白平衡
/// 0:temp:[-1, 1], 1:tint:[0, 1]   
FOUNDATION_EXPORT NSString *const TUPVEColorAdjustEffect_PROP_TYPE_WhiteBalance;
// 圣光阴影
/// 0:highlight:[0, 1], 1:shadow:[0, 1]
FOUNDATION_EXPORT NSString *const TUPVEColorAdjustEffect_PROP_TYPE_HighlightShadow;
// 锐化
/// 0:[-1, 1]
FOUNDATION_EXPORT NSString *const TUPVEColorAdjustEffect_PROP_TYPE_Sharpen;
// 亮度
/// 0:[-1, 1]
FOUNDATION_EXPORT NSString *const TUPVEColorAdjustEffect_PROP_TYPE_Brightness;
// 对比度
/// 0:[0, 1]
FOUNDATION_EXPORT NSString *const TUPVEColorAdjustEffect_PROP_TYPE_Contrast;
// 饱和度
/// 0:[-1, 1]
FOUNDATION_EXPORT NSString *const TUPVEColorAdjustEffect_PROP_TYPE_Saturation;
// 曝光度
/// 0:[-1, 1]
FOUNDATION_EXPORT NSString *const TUPVEColorAdjustEffect_PROP_TYPE_Exposure;

@interface TUPVEColorAdjustEffect_PropertyItem : NSObject

@property(nonatomic, copy) NSString* name;
@property(nonatomic) NSArray<NSNumber*>* values;

- (instancetype) init:(NSString*) name with:(double) v;
- (instancetype) init:(NSString*) name with:(double) v0 and:(double) v1;
- (instancetype) init:(NSString*) name withArray:(NSArray<NSNumber*>*) arr;

@end

@interface TUPVEColorAdjustEffect_PropertyHolder : NSObject

@property(nonatomic) NSMutableArray<TUPVEColorAdjustEffect_PropertyItem*>* items;

- (instancetype) init;
- (instancetype) initWithProperty:(TUPProperty*) prop;

@end

@interface TUPVEColorAdjustEffect_PropertyBuilder : NSObject

@property(nonatomic) TUPVEColorAdjustEffect_PropertyHolder* holder;

- (instancetype) init;
- (instancetype) initWithHolder:(TUPVEColorAdjustEffect_PropertyHolder*) holder;

- (TUPProperty*) makeProperty;

@end
TUPVECropEffect

FOUNDATION_EXPORT NSString *const TUPVECropEffect_CONFIG_LEFT     //左;
FOUNDATION_EXPORT NSString *const TUPVECropEffect_CONFIG_TOP;     //上
FOUNDATION_EXPORT NSString *const TUPVECropEffect_CONFIG_RIGHT;   //右
FOUNDATION_EXPORT NSString *const TUPVECropEffect_CONFIG_BOTTOM;  //下
TUPVETusdkFilterEffect
  • TUPVETusdkFilterEffect_CONFIG_NAME 滤镜代号
@interface TUPVETusdkFilterEffect_PropertyHolder : NSObject

/**滤镜作用域起点*/
@property(nonatomic) int64_t  begin;
/**滤镜作用域终点*/
@property(nonatomic) int64_t  end;
/**滤镜强度(0~1)*/
@property(nonatomic) double  strength;

- (instancetype) init;
- (instancetype) initWithProperty:(TUPProperty*) prop;

@end

@interface TUPVETusdkFilterEffect_PropertyBuilder : NSObject {

}

@property(nonatomic) TUPVETusdkFilterEffect_PropertyHolder* holder;

- (instancetype) init;
- (instancetype) initWithHolder:(TUPVETusdkFilterEffect_PropertyHolder*) holder;


- (TUPProperty*) makeProperty;

@end
TUPVETusdkMVEffect
  • TUPVETusdkMVEffect_CONFIG_CODE MV贴纸ID


@interface TUPVETusdkMVEffect_PropertyHolder : NSObject

/**MV作用域起点*/
@property(nonatomic) int64_t  begin;
/**MV作用域终点*/
@property(nonatomic) int64_t  end;

- (instancetype) init;
- (instancetype) initWithProperty:(TUPProperty*) prop;


@end

@interface TUPVETusdkMVEffect_PropertyBuilder : NSObject {

}

@property(nonatomic) TUPVETusdkMVEffect_PropertyHolder* holder;

- (instancetype) init;
- (instancetype) initWithHolder:(TUPVETusdkMVEffect_PropertyHolder*) holder;

- (TUPProperty*) makeProperty;

@end
TUPVETusdkParticleEffect
  • TUPVETusdkParticleEffect_CONFIG_NAME 魔法效果代号

@interface TUPVETusdkParticleEffect_PropertyHolder : NSObject

/**粒子特效开始时间,相对于视频时间轴*/
@property(nonatomic) int64_t  begin;
/**粒子特效结束时间,相对于视频时间轴*/
@property(nonatomic) int64_t  end;
/**粒子大小比例*/
@property(nonatomic) double scale;
/**粒子颜色*/
@property(nonatomic) UIColor* tint;

@property(nonatomic) NSArray<TUPVETusdkParticleEffect_PosInfo*>* trajectory;

- (instancetype) init;
- (instancetype) initWithProperty:(TUPProperty*) prop;


@end

@interface TUPVETusdkParticleEffect_PosInfo : NSObject {

}

@property(nonatomic) int64_t timestamp;
@property(nonatomic) double posX;
@property(nonatomic) double posY;

- (instancetype) init:(int64_t) ts withPosX:(double) x andY:(double) y;

@end

@interface TUPVETusdkParticleEffect_PropertyBuilder : NSObject {

}
@property(nonatomic) TUPVETusdkParticleEffect_PropertyHolder* holder;


- (instancetype) init;
- (instancetype) initWithHolder:(TUPVETusdkParticleEffect_PropertyHolder*) holder;


- (TUPProperty*) makeProperty;

@end
TUPVETusdkSceneEffect
  • TUPVETusdkSceneEffect_CONFIG_NAME 场景特效代号

@interface TUPVETusdkSceneEffect_PropertyHolder : NSObject

@property(nonatomic) int64_t  begin;
@property(nonatomic) int64_t  end;

- (instancetype) init;
- (instancetype) initWithProperty:(TUPProperty*) prop;

@end

@interface TUPVETusdkSceneEffect_PropertyBuilder : NSObject {

}

@property(nonatomic) TUPVETusdkSceneEffect_PropertyHolder* holder;

- (instancetype) init;
- (instancetype) initWithHolder:(TUPVETusdkSceneEffect_PropertyHolder*) holder;


- (TUPProperty*) makeProperty;

TUPVEStretchEffect
  • TUPVEStretchEffect_CONFIG_STRETCH 视频速度系数

  • TUPVEStretchEffect_CONFIG_BEGIN 速度调节开始位置

  • TUPVEStretchEffect_CONFIG_END 速度调节结束位置

TUPVETransformEffect
  • TUPVETransformEffect_CONFIG_MODE 视频变换模式
  • TUPVETransformEffect_CONFIG_MODE 无变换
  • TUPVETransformEffect_MODE_K90 顺时针旋转90度
  • TUPVETransformEffect_MODE_K180 旋转180度
  • TUPVETransformEffect_MODE_K270 顺时针旋转270度
  • TUPVETransformEffect_MODE_VFlip 垂直翻转
  • TUPVETransformEffect_MODE_HFlip 水平翻转
TUPVEditorEffect 接口说明

- (instancetype) init NS_UNAVAILABLE;

// 通过类型创建Effect
- (instancetype) init:(TUPVEditorCtx*) ctx withType:(NSString*) type;
// 通过Model创建Effect
- (instancetype) init:(TUPVEditorCtx*) ctx withModel:(TUPVEditorModel*) model;
// 设置Config
- (BOOL) setConfig:(TUPConfig*) config;
// 获取Config
- (TUPConfig*) getConfig;
// 设置Property
- (BOOL) setProperty:(TUPProperty*) prop forKey:(NSString*) key;
// 获取Property
- (TUPProperty*  _Nullable) getProperty:(NSString*) key;
// 设置Model
- (TUPVEditorModel*) getModel;
// 获取Model
- (BOOL) setModel:(TUPVEditorModel*) model;
// 获取当前类型
- (NSString*) getType;

TUPVEditor 视频编辑器

TUPVEditor 接口说明

//获取config
- (TUPVEditor_Config*) getConfig;

// 创建config
- (BOOL) createWithConfig:(TUPVEditor_Config*) config;
// 通过Model恢复
- (BOOL) createWithModel:(TUPVEditorEditorModel*) model;

// 编辑器销毁
- (void) destroy;

// 更新编辑器设置
- (BOOL) updateWithConfig:(TUPVEditor_Config*) config;

// 创建Player
- (TUPPlayer*) newPlayer;

// 重置Producer
- (void) resetPlayer;

// 获取当前Producer
- (TUPProducer*) newProducer;

// 重置Producer
- (void) resetProducer;

- (TUPVEditorComposition*) videoComposition;

- (TUPVEditorComposition*) audioComposition;

// 构建Editor
- (BOOL) build;

//获取视频时长
- (NSInteger) getDuration;

// 返回草稿对象
- (TUPVEditorEditorModel*) getModel;
TUPPlayer 接口说明

@property(nonatomic, weak) id<TUPPlayerDelegate> delegate;

// 关闭 Player
- (void) close;
// 设置Player参数
- (BOOL) setOutputConfig:(TUPPlayer_OutputConfig*)config;
// 开始播放
- (BOOL) play;
// 暂停播放
- (BOOL) pause;
// seek到指定位置(不更新画面)
- (BOOL) seekTo:(NSInteger)pts;
// seek到指定位置(同时更新画面)
- (BOOL) previewFrame:(NSInteger)pts;
// 获取当前总时长
- (NSInteger) getDuration;


//- (void) _signalEvent:(TUPPlayerState)state withTimestamp:(NSInteger)pts;
Player与Editor交互流程
  1. Lock 播放器player.lock
  2. 更新 Clip/Effect/Layer[* setConfig:cfg]
  3. 重建 Editoreditor.build
  4. Unlock 播放器player.unlock
  5. 播放器 Seek[player seek:ts]

  • SDK基础说明
  • 基础类说明
  • 在线技术支持
  • 专业售前售后团队
  • 版本定期更新
  • 全方位解决方案

商务合作

  • 177-6716-7529
  • 2969573855
  • sales@tusdk.com
  • 浙江省 杭州市 西湖区 西斗门9号 福地创业园1号楼3楼301室

关注我们

qrcode

©2019-2025 TUTUCLOUD. All Rights Reserved. 杭州元凡视觉智能科技有限公司 | 浙ICP备14040447号-1 | 浙公网安备33010602001649号

  • 177-6716-7529
  • sales@tusdk.com
  • 2969573855