public interface AliyunIEditor
限定符和类型 | 方法和说明 |
---|---|
int |
addAnimationFilter(EffectFilter filter)
添加动效滤镜,同一个时间区间内只能有一个动效滤镜,如果添加两个时间冲突了,则冲突的时间段,新添加的会覆盖之前添加的
|
int |
addFrameAnimation(ActionBase action)
对指定的流或者素材资源添加帧动画
|
int |
addImage(EffectPicture picture)
使用添加一张静态图片
|
int |
addRunningDisplayMode(VideoDisplayMode mode,
int streamId,
long startTimeMills,
long durationMills)
选择时间段设置显示模式,该接口将在指定时间段内覆盖
setDisplayMode(VideoDisplayMode) 设置的模式,
时间段外,依然采用setDisplayMode(VideoDisplayMode) 所设置的模式 |
int |
addTailWaterMark(java.lang.String imagePath,
float sizeX,
float sizeY,
float posX,
float posY,
long durationUs)
添加片尾
|
int |
applyBlurBackground(int streamId,
long startTimeMills,
long durationMills,
float blurRadius)
添加模糊背景
|
int |
applyDub(EffectBean effect)
使用配音效果
音乐作用时间可以选择,时间设置
|
int |
applyFilter(EffectBean effect)
使用滤镜效果
|
int |
applyMusic(EffectBean effect)
使用music效果
音乐作用时间可以选择,时间设置
|
int |
applyMusicMixWeight(int id,
int weight)
设置音乐和视频原音的混合权重,id对应的流和主流的权重加起来是100,而其他流保持不变,
举例:同一时刻混音有三个流,分别是主流(weight:40),混音1(weight:30,id:1),混音2(weight:20,id:2),假如通过
该接口设置混音1为70,即applyMusicMixWeight(1, 70),则这个时候三个流的权重分别是主流(weight:30),混音1(weight:70),
混音2(weight:20),混音2的权重保持不变,主流的权重变成100-混音1的权重
|
int |
applyMusicWeight(int id,
int weight)
单独设置某一路音频音量权重(包含素材流和主流)
|
int |
applyMV(EffectBean effect)
使用mv效果
|
int |
applySourceChange()
执行流改变的操作,该操作会导致编辑的视频重新播放
|
int |
applyWaterMark(java.lang.String imgPath,
float sizeX,
float sizeY,
float posX,
float posY)
使用水印特效,如果需要使用文字水印,可以通过Bitmap工具把文字转成水印
|
int |
audioEffect(int id,
com.aliyun.editor.AudioEffectType type,
int weight)
增加音效
如果素材无音轨,该接口返回成功,但是没有效果
|
int |
cancelCompose()
取消合成
|
void |
clearAllAnimationFilter()
移除所有动效滤镜
|
int |
compose(AliyunVideoParam param,
java.lang.String outputPath,
AliyunIComposeCallBack callback)
合成
|
AliyunPasterManager |
createPasterManager()
创建贴图manager,负责贴图的添加渲染
|
int |
deleteBlurBackground(int streamId,
int id)
删除模糊背景
|
int |
deleteTimeEffect(int id)
删除时间特效
|
int |
denoise(int id,
boolean needDenoise)
降低指定音频流的噪声
|
int |
draw(long time)
强制绘制指定时间点的帧,需要在pause状态下调用,如果当前状态不是pause,会强制调用pause
|
com.aliyun.log.struct.AliyunLogInfo |
getAliyunLogInfo()
获取打点数据
|
long |
getClipStartTime(int clipIndex) |
long |
getCurrentPlayPosition()
获取当前播放位置(受时间特效影响的)
|
long |
getCurrentStreamPosition()
获取当前流的位置(不受时间特效影响的)
|
long |
getDuration()
获取播放时长
|
int |
getFilterLastApplyId()
获取上次使用的滤镜特效的id,如果有设置的话。
|
int |
getMusicLastApplyId()
获取上次使用的音乐特效的id,如果有设置的话,仅用于保存和恢复
|
int |
getMVLastApplyId()
获取上次使用的mv特效的id,如果有设置的话,仅用于保存和恢复
|
android.graphics.Paint |
getPaintLastApply()
获取上次使用的涂鸦的画笔,如果有设置的话,仅用于保存和恢复
|
AliyunPasterRender |
getPasterRender()
底层的贴图渲染类,如果没有UI编辑的需求则可以直接使用该接口,
|
com.aliyun.svideo.sdk.internal.project.AliyunIProjectInfo |
getProjectInfo()
获取project中的资源信息
|
int |
getRotation()
获取视频旋转度
|
AliyunIClipConstructor |
getSourcePartManager()
获取编辑的流片段管理,可以实现对流片段的修改,删除,添加,获取操作
|
long |
getStreamDuration()
获取视频流时长
|
com.aliyun.editor.TimeEffectType |
getTimeEffect()
获取时间特效
|
int |
getVideoHeight()
获取视频高度
|
int |
getVideoWidth()
获取视频宽度
|
int |
init(android.view.SurfaceView surfaceView,
android.content.Context context)
初始化
|
int |
invert()
全部倒播(对于某些条件不符合的视频,可能需要调用转码流程来获取比较好的效果)
|
boolean |
isAudioSilence()
获取是否处于静音状态
|
boolean |
isPaused()
状态获取,是否暂停
|
boolean |
isPlaying()
Gets whether playback is in progress.
|
AliyunICanvasController |
obtainCanvasController(android.content.Context context,
int w,
int h)
获取涂鸦控制器
|
void |
onDestroy()
生命周期调用
|
int |
pause()
暂停播放
|
int |
play()
开始播放
|
int |
rate(float rate,
long startTimeMills,
long durationMills,
boolean needOriginDuration)
播放速率
|
void |
removeAnimationFilter(EffectFilter filter)
移除动效滤镜
|
int |
removeAudioEffect(int id,
com.aliyun.editor.AudioEffectType type)
删除某个音效
|
int |
removeDub(EffectBean effect)
移除配音特效
|
int |
removeFrameAnimation(ActionBase action)
删除指定的帧动画
|
void |
removeImage(EffectPicture picture)
移除添加的一张静态图片
|
int |
removeMusic(EffectBean effect)
移除音乐特效
|
int |
removeRunningDisplayMode(int streamId,
int id)
移除某段时间的显示模式设置
|
int |
repeat(int times,
long startTimeMills,
long durationMills,
boolean needOriginDuration)
重复播放(对于某些条件不符合的视频,可能需要调用转码流程来获取比较好的效果)
|
int |
replay()
重新开始播放
|
int |
resetEffect(com.aliyun.editor.EffectType effectType)
重置特效
|
int |
resume()
恢复播放
|
int |
saveEffectToLocal()
将所有特效持久化到本地文件
如果要使用AliyunICompose接口合成,必须通过该接口将特效配置持久化到本地文件中
|
int |
seek(long time)
seek到某个时间点
|
void |
setAnimationRestoredListener(OnAnimationFilterRestored li)
设置动效滤镜恢复的回调,用于开发者恢复对应的UI,如果是草稿箱情况下,要恢复UI,需要在
init(SurfaceView, Context)
之前设置该回调,因为init(SurfaceView, Context) 内部会执行动效滤镜恢复逻辑 |
void |
setAudioSilence(boolean silence)
设置静音状态,该接口只对播放模式下有效,合成视频无法静音
|
int |
setDisplayMode(VideoDisplayMode mode)
设置视频展示模式
|
int |
setDisplayView(android.view.SurfaceView surfaceView)
更新显示的窗口,必须在
init(SurfaceView, Context) 成功之后调用 |
int |
setDisplayView(android.view.TextureView textureView)
更新显示的窗口,必须在
init(SurfaceView, Context) 成功之后调用,没有特殊需求不建议用TextureView |
int |
setFillBackgroundColor(int color)
设置填充颜色,只有在
setDisplayMode(VideoDisplayMode) 为VideoDisplayMode.FILL 时才有效 |
void |
setMonitorSurfaceChange(boolean monitor)
设置是否需要监听surface的变化,必须在
init(SurfaceView, Context) 之前设置,否则设置无效 |
void |
setOutputPath(java.lang.String path)
设置输出路径
|
int |
setTransition(int index,
TransitionBase transition)
设置视频过渡动画时间长度,接口说明:指定视频索引添加过渡时长,当索引为0时为第一段视频添加过渡时长,
此时过渡动画将从第一段的开头起算,只在第一段视频开头起作用,不会影响其他视频段。
|
int |
setTransition(java.util.Map<java.lang.Integer,TransitionBase> transitions)
设置视频过渡动画时间长度,接口说明:指定视频索引添加过渡时长,当索引为0时为第一段视频添加过渡时长,
此时过渡动画将从第一段的开头起算,只在第一段视频开头起作用,不会影响其他视频段。
|
int |
setVolume(int volume)
设置音量
|
int |
stop()
停止播放
|
java.lang.String |
version()
获取版本号
|
void setMonitorSurfaceChange(boolean monitor)
init(SurfaceView, Context)
之前设置,否则设置无效monitor
- int init(android.view.SurfaceView surfaceView, android.content.Context context)
surfaceView
- AliyunErrorCode.ERROR_PROJECT_NULL
AliyunErrorCode.ERROR_LICENSE_FAILED
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_PARAM
AliyunEditorErrorCode.SVIDEO_EDITOR_INIT_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_CREATE_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_RE_CREATE
AliyunEditorErrorCode.SVIDEO_EDITOR_SET_DISPLAY_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID
AliyunEditorErrorCode.ALIVC_FRAMEWORK_MUXER_ERROR_CREAT_OUTPUT
AliyunEditorErrorCode.ALIVC_FRAMEWORK_MUXER_ERROR_STATE
AliyunEditorErrorCode.ALIVC_FRAMEWORK_MUXER_ERROR_INVALIDATE_PARAM
AliyunEditorErrorCode.ALIVC_FRAMEWORK_MUXER_ERROR_FIND_ENCODER
AliyunEditorErrorCode.ALIVC_FRAMEWORK_MUXER_ERROR_NEW_STREAM
AliyunEditorErrorCode.ALIVC_FRAMEWORK_VIDEO_ENCODER_CREATE_ENCODER_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_VIDEO_ENCODER_ERROR_STATE
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_ENCODER_ERROR_INPUT
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_ENCODER_WIDTHOUT_MATCH_ENCODER
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_ENCODER_ERROR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_PREPARE_ERROR
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_EDITORLAYOUT_INVALID_SIZE
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_RENDER_INIT_SPEAKER_FAILED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_PARAM
导入编辑流程下,导入接口未设置输出分辨率,或者设置的分辨率不合法int setDisplayView(android.view.SurfaceView surfaceView)
init(SurfaceView, Context)
成功之后调用surfaceView
- AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
-没有初始化成功
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_PARAM
-surfaceView 为空int setDisplayView(android.view.TextureView textureView)
init(SurfaceView, Context)
成功之后调用,没有特殊需求不建议用TextureViewtextureView
- AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
-没有初始化成功
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_PARAM
-surfaceView 为空int play()
int replay()
int seek(long time)
time
- 时间,单位:微秒AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_SEEK_IN_OFFSET
AliyunEditorErrorCode.SVIDEO_EDITOR_SEEK_ERROR
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_SEEK_FAILED
int draw(long time)
time
- 时间,单位:微秒AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
int pause()
int resume()
int stop()
long getCurrentStreamPosition()
long getCurrentPlayPosition()
long getStreamDuration()
long getDuration()
boolean isPlaying()
boolean isPaused()
int getVideoWidth()
int getVideoHeight()
int getRotation()
boolean isAudioSilence()
void setAudioSilence(boolean silence)
silence
- true 设置为静音状态 false 消除静音状态int setVolume(int volume)
volume
- 音量值为[0,100],为0则静音,100则音量最大,默认音量值是50AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_CTL_INPUT_ERROR
int setDisplayMode(VideoDisplayMode mode)
int addRunningDisplayMode(VideoDisplayMode mode, int streamId, long startTimeMills, long durationMills)
setDisplayMode(VideoDisplayMode)
设置的模式,
时间段外,依然采用setDisplayMode(VideoDisplayMode)
所设置的模式mode
- streamId
- 流ID,指定添加到哪个流上startTimeMills
- 传stream time 单位:毫秒durationMills
- 传stream duration 单位:毫秒int removeRunningDisplayMode(int streamId, int id)
streamId
- 流ID,指定移除某个流上的效果id
- 效果id,由 addRunningDisplayMode(VideoDisplayMode, int, long, long)
返回int setFillBackgroundColor(int color)
setDisplayMode(VideoDisplayMode)
为VideoDisplayMode.FILL
时才有效color
- 背景颜色值,8位int型,格式为ARGBAliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
setDisplayMode(VideoDisplayMode)
,
VideoDisplayMode
int applyFilter(EffectBean effect)
effect
- 特效资源的路径及ID,设置为null表示移除滤镜AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_INVALID_OPTION
int applyMV(EffectBean effect)
effect
- 特效资源的路径及ID,设置为null表示移除MV效果,接口调用完成之后,mv的音频流id可以通过EffectBean.getMvAudioId()
来获取AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunErrorCode.ERROR_LICENSE_FAILED
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_FILE_NOT_EXIST
AliyunEditorErrorCode.SVIDEO_EDITOR_PAUSE_ERROR
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_INVALID_OPTION
int applyWaterMark(java.lang.String imgPath, float sizeX, float sizeY, float posX, float posY)
imgPath
- 水印图片路径sizeX
- sizeY
- posX
- posY
- AliyunErrorCode.ERROR_EFFECT_USE_FAILED
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_FILE_NOT_EXIST
AliyunEditorErrorCode.SVIDEO_EDITOR_VIEW_TYPE_NOT_SUPPORTED
int addImage(EffectPicture picture)
picture
- Bitmap及相关显示参数,x,y,w,h都是相对于显示范围的比例值AliyunErrorCode.ERROR_EFFECT_USE_FAILED
AliyunErrorCode.ERROR_TRES_PLAYER_UNPREPARED
AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunErrorCode.ERROR_PARAM_IMAGE_FILE_PATH_INVALID
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_FILE_NOT_EXIST
AliyunEditorErrorCode.SVIDEO_EDITOR_VIEW_TYPE_NOT_SUPPORTED
void removeImage(EffectPicture picture)
picture
- Bitmap及相关显示参数,x,y,w,h都是相对于显示范围的比例值int addAnimationFilter(EffectFilter filter)
filter
- AliyunErrorCode.ERROR_EFFECT_USE_FAILED
AliyunErrorCode.ERROR_INVALID_ARGUMENTS
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_FILE_NOT_EXIST
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID
int addFrameAnimation(ActionBase action)
action
- ActionBase
int removeFrameAnimation(ActionBase action)
action
- void removeAnimationFilter(EffectFilter filter)
filter
- void clearAllAnimationFilter()
int applyMusic(EffectBean effect)
effect
- 特效资源的路径及IDAliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_PARAM
AliyunEditorErrorCode.SVIDEO_EDITOR_PAUSE_ERROR
AliyunEditorErrorCode.SVIDEO_EDITOR_FILE_NOT_EXIST
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_FILE_STREAM_LIST_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_OPTION_LIST_FAILED
EffectBean
int applyDub(EffectBean effect)
effect
- 特效资源的路径及IDAliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_PARAM
AliyunEditorErrorCode.SVIDEO_EDITOR_PAUSE_ERROR
AliyunEditorErrorCode.SVIDEO_EDITOR_FILE_NOT_EXIST
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_FILE_STREAM_LIST_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_OPTION_LIST_FAILED
EffectBean
int removeMusic(EffectBean effect)
effect
- AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_PAUSE_ERROR
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_FILE_STREAM_LIST_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_OPTION_LIST_FAILED
EffectBean
int removeDub(EffectBean effect)
effect
- AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_PAUSE_ERROR
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_FILE_STREAM_LIST_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_OPTION_LIST_FAILED
EffectBean
int getFilterLastApplyId()
AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
int getMVLastApplyId()
AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
int getMusicLastApplyId()
AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
android.graphics.Paint getPaintLastApply()
int applyMusicMixWeight(int id, int weight)
id
- 流id 可以通过EffectBean.getId()
获取weight
- 取值 【0, 100】,实际上内部的区间是[0,10]所以如果外部传入53或者59,效果是一样的,因为内部对应的都是5AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_OPTION_LIST_FAILED
int applyMusicWeight(int id, int weight)
id
- 流id 可以通过EffectBean.getId()
获取,如果是调整原音则可以通过getSourcePartManager()
,先获取
片段管理器AliyunClipConstructor
,然后通过AliyunClipConstructor.getAllClips()
获取到片段列表,遍历列表,通过AliyunClip.getId()
拿到主流每个片段的流ID,然后用这些流ID,分别设置每个片段的音量比重。weight
- 取值 【0,100】,实际上内部的区间是[0,10]所以如果外部传入53或者59,效果是一样的,因为内部对应的都是5AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_OPTION_LIST_FAILED
int denoise(int id, boolean needDenoise)
id
- 音频流idneedDenoise
- 是否需要去噪,比如开了之后需要关闭,再调用一次,传入falseAliyunPasterManager createPasterManager()
AliyunPasterManager
AliyunPasterRender getPasterRender()
AliyunPasterRender
AliyunICanvasController obtainCanvasController(android.content.Context context, int w, int h)
context
- 建议传入applicationContextw
- 涂鸦画布的宽h
- 涂鸦画布的高AliyunICanvasController
void onDestroy()
int setTransition(java.util.Map<java.lang.Integer,TransitionBase> transitions)
transitions
- 转场特效的map表
AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunErrorCode.ERROR_PARAM_TRANSITION_DURATION_INVALID
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_PARAM
AliyunEditorErrorCode.SVIDEO_EDITOR_PREPARE_ERROR
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_EDITORLAYOUT_INVALID_SIZE
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_RENDER_INIT_SPEAKER_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_VIDEO_ENCODER_ERROR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_START_ERROR
int setTransition(int index, TransitionBase transition)
index
- 视频索引transition
- TransitionBase
AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunErrorCode.ERROR_PARAM_TRANSITION_DURATION_INVALID
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_PARAM
AliyunEditorErrorCode.SVIDEO_EDITOR_PREPARE_ERROR
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_EDITORLAYOUT_INVALID_SIZE
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_RENDER_INIT_SPEAKER_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_VIDEO_ENCODER_ERROR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_START_ERROR
void setAnimationRestoredListener(OnAnimationFilterRestored li)
init(SurfaceView, Context)
之前设置该回调,因为init(SurfaceView, Context)
内部会执行动效滤镜恢复逻辑li
- java.lang.String version()
com.aliyun.log.struct.AliyunLogInfo getAliyunLogInfo()
void setOutputPath(java.lang.String path)
path
- int rate(float rate, long startTimeMills, long durationMills, boolean needOriginDuration)
rate
- 倍速startTimeMills
- 开始时间 单位msdurationMills
- 时长 单位msneedOriginDuration
- 是否需要保持原视频长度
AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_PARAM
AliyunEditorErrorCode.SVIDEO_EDITOR_PREPARE_ERROR
AliyunEditorErrorCode.SVIDEO_EDITOR_TIME_EFFECT_NOT_SUPPORT
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_INVALID_OPTION
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_FILE_STREAM_LIST_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_OPTION_LIST_FAILED
int repeat(int times, long startTimeMills, long durationMills, boolean needOriginDuration)
times
- 重复次数startTimeMills
- 开始时间 单位msdurationMills
- 时长 单位msneedOriginDuration
- 是否需要保持原视频长度AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_PARAM
AliyunEditorErrorCode.SVIDEO_EDITOR_PREPARE_ERROR
AliyunEditorErrorCode.SVIDEO_EDITOR_TIME_EFFECT_NOT_SUPPORT
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_INVALID_OPTION
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_FILE_STREAM_LIST_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_OPTION_LIST_FAILED
int invert()
AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_PREPARE_ERROR
AliyunEditorErrorCode.SVIDEO_EDITOR_TIME_EFFECT_NOT_SUPPORT
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_FILE_STREAM_LIST_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_OPTION_LIST_FAILED
int deleteTimeEffect(int id)
id
- 时间特效idAliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_PARAM
AliyunEditorErrorCode.SVIDEO_EDITOR_PREPARE_ERROR
AliyunEditorErrorCode.SVIDEO_EDITOR_TIME_EFFECT_NOT_SUPPORT
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_INVALID_OPTION
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_FILE_STREAM_LIST_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_OPTION_LIST_FAILED
int addTailWaterMark(java.lang.String imagePath, float sizeX, float sizeY, float posX, float posY, long durationUs)
imagePath
- 水印路径sizeX
- 相对宽sizeY
- 相对高posX
- 相对位置x轴posY
- 相对位置Y轴durationUs
- 时长 单位:usAliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_PREPARE_ERROR
AliyunEditorErrorCode.SVIDEO_EDITOR_FILE_NOT_EXIST
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_INVALID_OPTION
int resetEffect(com.aliyun.editor.EffectType effectType)
effectType
- 重置的特效类型AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED
AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE
AliyunEditorErrorCode.SVIDEO_EDITOR_PREPARE_ERROR
AliyunEditorErrorCode.ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_FILE_STREAM_LIST_FAILED
AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_OPTION_LIST_FAILED
EffectType
long getClipStartTime(int clipIndex)
clipIndex
- 片段的索引AliyunIClipConstructor getSourcePartManager()
com.aliyun.svideo.sdk.internal.project.AliyunIProjectInfo getProjectInfo()
com.aliyun.editor.TimeEffectType getTimeEffect()
int applySourceChange()
int saveEffectToLocal()
int applyBlurBackground(int streamId, long startTimeMills, long durationMills, float blurRadius)
streamId
- 流IDstartTimeMills
- 开始时间 单位:毫秒durationMills
- 持续时间 单位:毫秒blurRadius
- 模糊半径[0,29]int deleteBlurBackground(int streamId, int id)
streamId
- 流IDid
- 资源idint compose(AliyunVideoParam param, java.lang.String outputPath, AliyunIComposeCallBack callback)
param
- 输出视频的相关参数outputPath
- 输出路径callback
- 合成回调int cancelCompose()
int audioEffect(int id, com.aliyun.editor.AudioEffectType type, int weight)
id
- 指定的音频流idtype
- 特效类型 AudioEffectType
weight
- 特效效果参数 [0,100]int removeAudioEffect(int id, com.aliyun.editor.AudioEffectType type)
id
- 通过添加音效获取的资源idtype
- 特效类型 AudioEffectType