tencent cloud

User Generated Short Video SDK

Android

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-05-11 17:46:57

Feature Overview

Filters can change the style and color of video frames. This document describes how to add and use filters.

Related Interface Classes

Interface Class Name
Description
TAVEditor
SDK operation entry class.

Interface Method Summary

Method
Parameters
Description
addFilter(String lutPath, float strength, long startPts, long endPts)
lutPath: filter resource path.
strength: filter strength (0-1).
startPts: start time (microseconds).
endPts: end time (microseconds).
Add a filter and return a unique ID.
setFilterStrength(int filterId, float strength)
filterId: filter ID.
strength: filter strength (0-1).
Adjust filter strength.
removeFilter(int filterId)
filterId: filter ID.
Remove the filter.

Filter-Related Methods

Add Filter

/**
* Add a filter
*
* @param lutPath Filter resource path
* @param strength Filter strength (0-1)
* @param startPts Start time (microseconds)
* @param endPts End time (microseconds)
* @return Unique filter ID
*/
int filterId = editor.addFilter(lutPath, strength, startPts, endPts);

Adjust Filter Strength

/**
* Adjust filter strength
*
* @param filterId Filter ID
* @param strength Filter strength (0-1)
*/
editor.setFilterStrength(filterId, strength);

Remove Filter

/**
* Remove filter
*
* @param filterId Filter ID
*/
editor.removeFilter(filterId);

Usage Example

// Add filter (strength 0.8, from 1s to 5s)
int filterId = editor.addFilter("/sdcard/filter.lut", 0.8f, 1_000_000, 5_000_000);

// Adjust filter strength to 0.5
editor.setFilterStrength(filterId, 0.5f);

// Remove filter
editor.removeFilter(filterId);


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백