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)
Adds an image source.
|
int |
addVideoSource(java.lang.String path)
Deprecated.
Replaced by
addVideoSource(String, long, long, long) . |
int |
addVideoSource(java.lang.String path,
long startTimeMills,
long endTimeMills,
long overlapDurationMills)
Adds a video source.
|
int |
fromConfigJson(java.lang.String jsonPath)
Gets video information from a configuration file.
|
long |
getTotalDuration()
Gets the total video duration.
|
void |
release()
Releases resources.
|
int |
requestThumbnailImage(int count,
AliyunIThumbnailFetcher.OnThumbnailCompletion callback) |
int |
requestThumbnailImage(long[] time,
AliyunIThumbnailFetcher.OnThumbnailCompletion callback)
Gets thumbnail images at specific time points.
|
int |
setFastMode(boolean fastMode) |
int |
setParameters(int width,
int height,
AliyunIThumbnailFetcher.CropMode mode,
VideoDisplayMode scaleMode,
int cacheSize)
Sets output resolution.
|
int addVideoSource(java.lang.String path, long startTimeMills, long endTimeMills, long overlapDurationMills)
path
- The path of the video file.startTimeMills
- The start time of the video in milliseconds.endTimeMills
- The end time of the video in milliseconds.overlapDurationMills
- The transition duration in milliseconds.AliyunErrorCode.OK
if the invocation is successful.
AliyunErrorCode.ERROR_INVALID_ARGUMENTS
if invalid parameters are found, such as incorrect or invalid file path, and invalid startTime or endTime.int addVideoSource(java.lang.String path)
addVideoSource(String, long, long, long)
.path
- The path of the video file.int addImageSource(java.lang.String path, long durationMills, long overlapDurationMills)
path
- The path of the image file.durationMills
- The display duration of the image in milliseconds.overlapDurationMills
- The transition duration in milliseconds.AliyunErrorCode.OK
if the invocation is successful.int fromConfigJson(java.lang.String jsonPath)
jsonPath
- The path of the configuration file.AliyunErrorCode.OK
if the invocation is successful.
AliyunErrorCode.ERROR_INVALID_ARGUMENTS
if invalid parameters are found, such as empty JSON file path, invalid JSON file, incorrect paths of video or image files in the JSON file, and invalid startTime or endTime.int setParameters(int width, int height, AliyunIThumbnailFetcher.CropMode mode, VideoDisplayMode scaleMode, int cacheSize)
requestThumbnailImage(long[], OnThumbnailCompletion)
.
Otherwise, an IllegalStateException
will be thrown.width
- The output image width.height
- The output image height.mode
- The image crop mode. AliyunIThumbnailFetcher.CropMode
scaleMode
- The image display mode. VideoDisplayMode
cacheSize
- The cache size.int requestThumbnailImage(long[] time, AliyunIThumbnailFetcher.OnThumbnailCompletion callback)
time
- The time points. Unit: milliseconds. If setFastMode(boolean)
is set to true, the thumbnail image returned is the keyframe prior to that point in time.
Set setFastMode(boolean)
to false if an exact frame of this point in time is requiredcallback
- The callback that outputs the results.int requestThumbnailImage(int count, AliyunIThumbnailFetcher.OnThumbnailCompletion callback)
int setFastMode(boolean fastMode)
void release()
long getTotalDuration()
addVideoSource(String, long, long, long)
.