public interface AliyunIThumbnailFetcher
Modifier and Type | Interface and Description |
---|---|
static class |
AliyunIThumbnailFetcher.CropMode |
static interface |
AliyunIThumbnailFetcher.OnThumbnailCompletion |
Modifier and Type | Method and Description |
---|---|
int |
addImageSource(java.lang.String path,
long durationMills,
long overlapDurationMills)
添加图片源(图片转视频时用到)
|
int |
addVideoSource(java.lang.String path)
Deprecated.
|
int |
addVideoSource(java.lang.String path,
long startTimeMills,
long endTimeMills,
long overlapDurationMills)
添加视频源
|
int |
fromConfigJson(java.lang.String jsonPath)
从配置文件加载视频信息(适用于SDK内操作产生的project.json)
|
long |
getTotalDuration()
获取总时长,该接口必须在
addVideoSource(String, long, long, long) 之后调用 |
void |
release()
释放资源
|
int |
requestThumbnailImage(int count,
AliyunIThumbnailFetcher.OnThumbnailCompletion callback)
Number of incoming requests, divided evenly by time, returned thumbnails
|
int |
requestThumbnailImage(long[] time,
AliyunIThumbnailFetcher.OnThumbnailCompletion callback)
传入时间点获取该时间点的视频缩略图,并通过回调返回结果
|
int |
setFastMode(boolean fastMode)
To set up fast mode, this method must be called in
requestThumbnailImage(long[], OnThumbnailCompletion)
In fast mode, the thumbnail will be produced in seconds when the GOP is less than the time interval of thumbnail request. |
int |
setParameters(int width,
int height,
AliyunIThumbnailFetcher.CropMode mode,
VideoDisplayMode scaleMode,
int cacheSize)
设置输出大小,该方法必须在
requestThumbnailImage(long[], OnThumbnailCompletion)
前面调用,否则会抛出IllegalStateException |
int addVideoSource(java.lang.String path, long startTimeMills, long endTimeMills, long overlapDurationMills)
path
- 视频路径startTimeMills
- 开始时间 单位:msendTimeMills
- 结束时间 单位:msoverlapDurationMills
- 转场时间 单位:msAliyunErrorCode.OK
- 成功
AliyunErrorCode.ERROR_INVALID_ARGUMENTS
- 参数不合法,可能的原因:文件路径错误、无效,startTime或者endTime无效int addVideoSource(java.lang.String path)
addVideoSource(String, long, long, long)
path
- 视频文件地址int addImageSource(java.lang.String path, long durationMills, long overlapDurationMills)
path
- 图片文件地址durationMills
- 单位:msoverlapDurationMills
- 单位:msAliyunErrorCode.OK
- 成功int fromConfigJson(java.lang.String jsonPath)
jsonPath
- 配置文件地址AliyunErrorCode.OK
- 成功
AliyunErrorCode.ERROR_INVALID_ARGUMENTS
- 参数不合法,可能的原因:json文件路径为空或者json文件无效/json文件中的视频或者图片路径错误、无效,startTime或者endTime无效int setParameters(int width, int height, AliyunIThumbnailFetcher.CropMode mode, VideoDisplayMode scaleMode, int cacheSize)
requestThumbnailImage(long[], OnThumbnailCompletion)
前面调用,否则会抛出IllegalStateException
width
- 输出图像宽度height
- 输出图像高度mode
- 图像裁剪方式 AliyunIThumbnailFetcher.CropMode
scaleMode
- 图像填充方式 VideoDisplayMode
cacheSize
- 缓存大小int requestThumbnailImage(long[] time, AliyunIThumbnailFetcher.OnThumbnailCompletion callback)
time
- 一组时间点,单位毫秒,如果 setFastMode(boolean)
设置的是true,则返回的缩略图是该时间点之前的关键帧。如果需要该时间点的精确帧,
则 setFastMode(boolean)
设置为 falsecallback
- 获取缩略图结果的回调int requestThumbnailImage(int count, AliyunIThumbnailFetcher.OnThumbnailCompletion callback)
count
- Number of incoming requestscallback
- The callback that outputs the results.int setFastMode(boolean fastMode)
requestThumbnailImage(long[], OnThumbnailCompletion)
In fast mode, the thumbnail will be produced in seconds when the GOP is less than the time interval of thumbnail request.fastMode
- Whether fast mode, true Fast mode, solve the key frame; False Indicates the non-fast mode, which is more accurate,default is false.void release()
long getTotalDuration()
addVideoSource(String, long, long, long)
之后调用