processImage on an external texture, then return the output texture.
Full texture rules: Implement Beauty · External texture. Room join, publish, and permissions belong in the vendor’s docs — this page only covers the Facebetter hookup.
Shared contract
Facebetter does not accept
GL_TEXTURE_EXTERNAL_OES for createWithTexture. If the vendor defaults to OES, switch to Texture2D / RGB per their docs, or blit to GL_TEXTURE_2D first.
Shared helper
Reuse this on every vendor GL callback (must run on the GL thread):TRTC (Tencent)
Hook:TRTCCloud.setLocalVideoProcessListener. Use pixel format Texture_2D and buffer type TEXTURE.
Create Facebetter in onGLContextCreated, process in onProcessVideoFrame and set dstFrame.texture.textureId, release() in onGLContextDestory.
FacebetterPlugin.processTexture, not this Java API).
Agora
Hook:RtcEngine.registerVideoFrameObserver (Video SDK 4.x). You need to:
- Return
PROCESS_MODE_READ_WRITEfromgetVideoFrameProcessMode() - Prefer a TextureBuffer with type RGB (
GL_TEXTURE_2D) - Run Facebetter in
onCaptureVideoFrame(or your chosen observe position), then write the processed texture back into theVideoFrame
beautyEngine.release() before destroying RtcEngine.
LiveKit
Hook: pass anorg.webrtc.VideoProcessor (or equivalent track processor) when creating the local video track. Process textures in onFrameCaptured, then deliver via sink.onFrame(...).
VideoCapturer, run processTexture after capture, then call capturerObserver.onFrameCaptured. Official processors (for example virtual background) live in LiveKit’s livekit-android-track-processors module.

