API Class | Description |
TAVEditor | SDK operation entry class. |
ITAVFrameProvider | Frame provider interface. |
TAVGetFrameListener | Frame retrieval callback interface. |
TAVSnapshotCallback | Render snapshot callback interface. |
ITAVThumbProvider | Original video frame extraction interface. |
/*** Gets the render result at a specific time point** @param positionUs time point (microseconds)* @param longSideLength length of the longer side; the SDK calculates the shorter side based on it* @param scene render scene:* - TAVEditorConstants.SCENE_PLAY: playback scene* - TAVEditorConstants.SCENE_GENERATE: export scene* @param listener result callback interface*/void getFrameAtTime(long positionUs,int longSideLength,@TAVEditorConstants.RenderScene int scene,TAVGetFrameListener listener);
editor.getFrameAtTime(5_000_000, 1080, TAVEditorConstants.SCENE_PLAY, new TAVGetFrameListener() {@Overridepublic void onFrameAvailable(Bitmap bitmap) {// Process the retrieved frame image}@Overridepublic void onError(int errorCode) {// Error handling}});
/*** Gets the render result provider** @param longSideLength scaled according to the render ratio with the longer side aligned* @param scene render scene* - TAVEditorConstants.SCENE_PLAY: playback scene* - TAVEditorConstants.SCENE_GENERATE: export scene* @return ITAVFrameProvider frame provider instance*/ITAVFrameProvider getFrameProvider(int longSideLength, @TAVEditorConstants.RenderScene int scene);
ITAVFrameProvider provider = editor.getFrameProvider(720, TAVEditorConstants.SCENE_GENERATE);// Get the frame at the specified time pointprovider.getFrameAtTime(3_000_000, new TAVGetFrameListener() {@Overridepublic void onFrameAvailable(Bitmap bitmap) {// Process the frame image}});
/*** Reads the render snapshot at the current time point** @param callback callback invoked when the snapshot is obtained successfully*/void readSnapshot(TAVSnapshotCallback callback);
editor.readSnapshot(new TAVSnapshotCallback() {@Overridepublic void onSnapshotReady(Bitmap snapshot) {// Process the snapshot image}});
/*** Gets the original video frame extraction interface** @param forceUseSoftwareDecoding whether to force software decoding:* - true: force software decoding* - false: prefer hardware decoding* @return ITAVThumbProvider thumbnail provider instance*/ITAVThumbProvider getThumbnailProvider(boolean forceUseSoftwareDecoding);
ITAVThumbProvider provider = editor.getThumbnailProvider(false);// Get the thumbnail of the specified asset at a specific timeprovider.getThumbnailAtTime(0, // clipIndex2_000_000, // Time point (microseconds)320, // Width240, // Heightnew TAVThumbnailListener() {@Overridepublic void onThumbnail(Bitmap bitmap) {// Process the thumbnail}});
フィードバック