Skip to main content
SDK 2.0.0. Same C++ API as Windows (facebetter namespace). Enums: Parameter enums. Auth: Auth & License.
On Linux, Facebetter is libfacebetter.so plus facebetter/*.h. This guide follows the C++ desktop demo (demo/cpp). To compile the SDK itself, use ./scripts/build_linux.sh or CMake in build/linux.

Include headers

CMake linkage

At runtime, set LD_LIBRARY_PATH, copy libfacebetter.so next to the binary, or install with ldconfig.

Integration flow

There is no type-enable step. Intensity 0 turns an effect off.

1. Configure logging (optional)

Call before Create.

2. Create the engine

Desktop must set resource_path to the resource.fbd file. Auth priority: non-empty license_token (token / {token} JSON / .lic) wins; otherwise app_id + app_key online v2.
resource_path must be the resource.fbd file, not a folder. Prefer an absolute path in production.

3. Set beauty parameters

Skin / makeup / body reshape [0.0, 1.0]. Face reshape [-1.0, 1.0]. Body reshape needs resource_body.fbd. Full enums: Parameter enums. Packs: Optional resource packs.
Same pattern for eyeshadow, eyeliner, eyebrow, eyelash, and pupil.

4. Filters, stickers, and virtual background

Pass a path or bytes.

5. Callbacks and stats


6. Process frames

Set ImageFrame::type.
Photo:
Output format tracks input when possible. Convert with output->Convert(Format::BGRA).

OpenGL preview

If your app already has a current GL context, set cfg.external_context = true and call ProcessImage on that thread.

7. Minimal loop

Release with engine.reset(). The engine is not a singleton. For TRTC / Agora / LiveKit: Third-party Integration.

Third-party Integration

TRTC / Agora / LiveKit

API reference

C++ methods and Linux notes

Error handling

Return codes and .so / DISPLAY issues

Best practices

Performance and rpath