Skip to main content
SDK 2.0.0. Hook Facebetter into a third-party SDK’s custom video preprocess callback: process frames on that SDK’s OpenGL thread (or pixel-buffer callback), then return the result. Shares the same Objective-C API as iOS · Third-party Integration; differences are mostly runtime (OpenGL, App Sandbox, process-name binding). Full texture rules: Implement Beauty · External texture.

Shared contract

TRTC custom preprocess commonly uses OpenGL textures; Agora / LiveKit more often deliver CVPixelBuffer. Do not mix both modes on one engine.

Shared: process texture

Shared: process CVPixelBuffer (NV12 sketch)

Use externalContext = NO for the pixel-buffer path. Credentials: Subscription, Auth & License. Bind process name in the Dashboard for CLI tools without a Bundle ID.

TRTC (Tencent)

Hook: setLocalVideoProcessDelegete:pixelFormat:bufferType: (official spelling Delegete). TRTCVideoPixelFormat_Texture_2D + TRTCVideoBufferType_Texture.
Nil the engine after clearing the delegate or leaving the room. See Tencent’s TRTC third-party beauty docs for the latest details.

Agora

Hook: AgoraRtcEngineKit.setVideoFrameDelegate: (Video SDK 4.x). Captured frames on macOS are also typically CVPixelBuffer.
How you write a processed CVPixelBuffer back into Agora’s frame differs across major versions. Facebetter keeps output in the same format as the input; follow Agora’s docs for injecting into AgoraOutputVideoFrame.
Call setVideoFrameDelegate:nil and nil beautyEngine before teardown.

LiveKit

Implement Swift VideoProcessor, process CVPixelBuffer in process(frame:), and pass processor: when creating the camera track (supported on macOS as well).
See BackgroundBlurVideoProcessor (macOS 12+) for an official sample. Screen-share tracks can use the same processor pattern (API per your LiveKit Swift version).

Troubleshooting