← 모든 글

연동

Process frames inside TRTC

Run Facebetter in TRTC’s custom video preprocess, then hand the frame back before encode.

In live video and calls, beauty has to run before encode. Viewers see the frame you send. Local preview should be that same frame after processing.

Hang Facebetter on TRTC’s custom video preprocess. TRTC gives you a texture or a pixel buffer. You process it and hand it back. TRTC encodes and sends it.

Camera
  → TRTC custom preprocess
  → Facebetter processes the frame
  → Hand it back to TRTC
  → Encode and send

Two paths — don’t mix them

On the texture path, create the engine on the other SDK’s OpenGL callback thread and turn on the external context. Input is usually a GL_TEXTURE_2D. The pixel-buffer path takes NV12 or BGRA and usually does not use that GL context.

One engine instance takes one path. Don’t alternate textures and pixel buffers on the same instance.

Mark the frame as video. The engine owns the output texture — don’t delete it yourself. Release the engine when the session ends.

TRTC’s custom preprocess is usually an OpenGL texture. Agora and LiveKit more often hand you a pixel buffer. The shape is the same; the input is not.

Parameters

Set smoothing, reshape, and filters before joining the room. Local preview and the outgoing stream share that set, so the host and the viewers see the same strength. A slider only changes parameters. Don’t build a second engine for preview.

Callback threads and texture rules differ by platform. Use the docs’ third-party integration page. iOS, Android, and Windows each have the same chapter.