Skip to main content
SDK 2.0.0. Enums: Parameter enums.

Point resource_path at resource.fbd

Desktop engines open the pack with fopen. Pass the file, not a folder:
Ship resource.fbd next to the app (or under an assets dir) and resolve an absolute path at startup.

One engine, serial ProcessImage

BeautyEffectEngine is created with Create and is not a singleton. Keep one instance for the session. ImageFrame and the engine are not thread-safe — serialize ProcessImage on a single worker (or the GL thread when external_context = true).
Drop the shared_ptr when the camera session ends. Recreating the engine every frame is expensive (license + init).

FrameType on the frame

Set frame->type before ProcessImage.

Large stills (preview vs export)

Do not feed full-resolution pixels into ProcessImage on every slider change, and do not throw the original away after scaling. When the photo opens, keep the full buffer and build one preview frame (long edge about 1280–1440). Slider changes process the preview (FrameType::Image). Export processes a full-resolution frame with the same setters. Output size matches the input. Camera preview stays capture resolution + FrameType::Video.

Intensities

Start low for realtime. Reshape is [-1.0, 1.0]; other intensities are [0.0, 1.0].
Enable SetBeautySkinOnly(true) so smoothing / whitening stay on skin.

Filters and stickers

Pass .fbd paths or bytes. Changes take effect on the next ProcessImage. Avoid swapping filter/sticker every frame.

Monitor with GetStats

Aim for avg_process_time_ms under your frame budget (about 33 ms at 30 fps). Prefer 720p for preview; use FrameType::Image for still export.

OpenGL context

Place facebetter.dll beside the .exe (or on PATH). Link facebetter.lib at build time.

Pause when idle

When the window is minimized or the camera stops, skip ProcessImage and optionally engine.reset() if the session is over. Do not process on the UI thread if it blocks input.

Auth

Prefer license_token for offline / locked-down networks. Otherwise app_id + app_key online v2. Do not hard-code production keys in public repos — load from config. See Auth & License.