The content of this page has been automatically translated by AI. If you encounter any problems while reading, you can view the corresponding content in Chinese.
Help & Documentation>User Generated Short Video SDK

Android

Last updated: 2025-03-17 17:28:47

If you want to add video special effects with a third-party Beauty Library when recording and editing, you can handle it in the pre-processing callback of recording and editing.

Recording Preprocessing Callback

public interface VideoCustomProcessListener {
/**
* Callback in the OpenGL thread, where post-processing of captured images can be done
* @param textureId Texture ID
* @param width Texture width
* @param height Texture height
* @return Return the texture ID to the SDK. If no processing is done, just return the passed-in texture ID.
* Description: The texture type returned by the SDK callback is GLES20.GL_TEXTURE_2D, and the texture type returned by the API to the SDK must also be GLES20.GL_TEXTURE_2D.
*/
int onTextureCustomProcess(int textureId, int width, int height);

/**
* Callback in the OpenGL thread. Created OpenGL resources can be released here.
*/
void onTextureDestroyed();
}


Editing Preprocessing Callback

public interface TXVideoCustomProcessListener {
/**
* Callback in the OpenGL thread, where secondary processing of captured images can be done
*
* @param textureId Texture ID
* @param width Texture width
* @param height Texture height
* @return Return the texture ID to the SDK. If no processing is done, just return the passed-in texture ID.
* <p>
* Description: The texture type returned by the SDK callback is GLES20.GL_TEXTURE_2D, and the texture type returned by the API to the SDK must also be GLES20.GL_TEXTURE_2D.
*/
int onTextureCustomProcess(int textureId, int width, int height, long timestamp);

/**
* Callback in the OpenGL thread. Created OpenGL resources can be released here.
*/
void onTextureDestroyed();
}