please select
Beauty AR
  • Overview
  • Web
    • Quick Start
    • Integration
      • Overview
      • Built-in Camera
      • Custom Stream
      • Loading Optimization
      • Configuring Effects
      • Configuring Segmentation
      • Configuring Animojis and Virtual Avatars
    • API Document
    • Release Notes
    • Best Practices
      • Publishing over WebRTC
      • Publishing over WebRTC (Preinitialization)
      • Publishing Using TRTC
    • FAQs
  • Android
    • Integration
      • Integrating SDK
      • Integrating TEBeautyKit
    • API Document
    • Release Notes
    • Best Practices
      • Reducing SDK Size
      • Effect Parameters
    • Advanced Capabilities
      • Gesture Recognition
      • Face Recognition
      • Virtual Background
    • Material Production
      • Beauty AR Studio Introduction
    • FAQs
  • IOS
    • Integration
      • Integrating SDK
      • Integrating TEBeautyKit
    • API Document
    • Release Notes
    • Best Practices
      • Reducing SDK Size
      • Effect Parameters
    • Advanced Capabilities
      • Gesture Recognition
      • Face Recognition
      • Virtual Background
    • Material Production
      • Beauty AR Studio Introduction
    • FAQs
  • Flutter
    • Integration
    • API Document
    • Material Production
      • Beauty AR Studio Introduction
  • Overview
    • Overview
  • Activate the Service
  • Pricing
  • Free Trial
    • Web
    • Mobile
Beauty AR

Virtual Background

Accurately removes the background in real time and applies a virtual background (customizable):




Integration guide for Android

For directions on how to integrate the Beauty AR SDK for Android, see the integration guide for Integrating SDK (Android).

Attribute setting API

void updateProperty(XmagicProperty<?> p)
Keying parameters:
Attribute Field
Description
category
Category.SEGMENTATION
ID
The resource folder name, which is required, such as video_segmentation_blur_45.
XmagicProperty.ID_NONE indicates there is no ID.
A custom keying ID must be XmagicConstant.SegmentationId.CUSTOM_SEG_ID.
resPath
Required. The full path of the customized segment material.
effkey
null (except for custom backgrounds). The value of a custom background is the selected resource path.
effValue
null

Setting a virtual background

// Initialize `XmagicProperty`
XmagicProperty xmagicProperty = new XmagicProperty(Category.SEGMENTATION,"video_segmentation_blur_45",resPath,null,null);
// Set the attributes
xmagicApi.updateProperty(xmagicProperty)

Setting a custom background

XmagicProperty xmagicProperty = new XmagicProperty(Category.SEGMENTATION,XmagicConstant.SegmentationId.CUSTOM_SEG_ID,resPath,null,null);

xmagicApi.updateProperty(xmagicProperty)