Video Call
  • iOS
  • Android
  • Web : JavaScript
  • Flutter
  • React Native
  • Electron
  • Unity3D
  • Cocos Creator
  • Windows
  • macOS
  • Linux
  • Overview
  • Develop your app
    • Integrate the SDK
    • Implement a basic video call
    • Enhance basic feature
      • Use Tokens for authentication
      • Check the room connection status
      • Set up common video config
      • Set up common audio config
  • Best practices
    • Implement a video call for multiple users
  • Upgrade using advanced features
    • Advanced features
      • Configure the video
        • Improve your appearance in the video
        • Configure video codec
      • Improve video quality
        • Visualize the sound level
        • Monitor streaming quality
      • Message signaling
        • Broadcast real-time messages to a room
        • Quotas and limits
      • Share the screen
      • Mix the video streams
      • Publish multiple video streams
      • Replace the audio/video track
    • Distincitve features
      • Join multiple rooms
      • Customize the video and audio
      • Set the voice hearing range
      • Render the audio and video
      • Autoplay policy
      • Restrictions on playing multiple videos simultaneously in Safari
      • Play streams via URL
      • Browser compatibility
      • Audio mixing
      • Vitrual Background and Blur
    • Implement a video call using frameworks
      • Implement a video call using Vue
      • Implement a video call using Angular
      • Implement a video call using React
  • Resources & Reference
    • SDK
    • Sample codes
    • API reference
      • Client APIs
      • Server APIs
    • Debugging
      • Error codes
      • Logging/Version number
    • FAQs
    • Key concepts
  • Documentation
  • Video Call
  • Upgrade using advanced features
  • Advanced features
  • Configure the video
  • Improve your appearance in the video

Basic face beautification features

Last updated:2023-11-28 17:02

Introduction

ZEGO provides basic face beautification features such as skin tone enhancement, skin smoothing, cheek blusher, and image sharpening, which are commonly used in video calls and live streaming scenarios, making you look the way you want.

You can enable the basic face beautification features based on your needs and set the intensity as wanted.

The following table lists the browsers that support the face beautification feature:

Browser Supported version
Chrome 65 or later
Firefox 70 or later
Safari 12 ~ 14 and 15.2 or later
Edge 80 or later
Mobile browser Not supported

Prerequisites

Before you begin, make sure:

  • ZEGO Express SDK has been integrated into the project to implement basic real-time audio and video functions. For details, please refer to Quick start .
  • A project has been created in ZEGOCLOUD Console and applied for a valid AppID and AppSign. For details, please refer to Console - Project Information .

Implementation steps

  1. Call the createZegoStream method to create and obtain the media streams.
  2. Call the setEffectsBeauty method to enable the face beautification.
  3. Specify the parameters of the ZegoEffectsBeautyParam class to set the intensity as needed.
  • smoothIntensity: Skin smoothing. Smooth the skin while preserving details of the face, such as moles.
  • whitenIntensity: Skin tone enhancement. Turn up the overall brightness to whiten your face.
  • rosyIntensity: Cheek blusher. Carry on the warm color processing to the whole picture.
  • sharpenIntensity: Image sharpening. You can sharpen it slightly to make it clearer when the picture is a little blurry.

The value range for the four features is [0, 100], and the default value is 50. As this value gets larger, the intensity gets stronger.

  • To enable face beautification before the stream publishing, call the startPublishingStream method after the face beautification feature is enabled.
  • The face beautification effects are bound with the MediaStream, and the effects won't be affected when you call the useVideoDevice and replaceTrack methods.
  • The face beautification feature occupies and consumes resources, you will need to call the zg.setEffectsBeauty(localStream,false) method to disable it when you are done using it.
  • The SDK destroys the streams and disable the face beautification only when you call the destroyStream method. To just disable the face beautification, call the zg.setEffectsBeauty(localStream,false) method.
// After calling the createZegoStream method, you need to wait for the ZEGO server to return the local stream object before any further operation.
const localStream = await this.zg.createZegoStream();
const enable = true;
// Enable the face beautification.
await zg.setEffectsBeauty(
    localStream,
    enable,
    {
        sharpenIntensity: 50, 
        whitenIntensity: 50, 
        rosyIntensity: 50,
        smoothIntensity: 50
    }
)

// Start the stream publishing.
zg.startPublishingStream("stream1", localStream);

// Disable the face beautification. 
await zg.setEffectsBeauty(localStream, false);
Page Directory