- Documentation
- Video Call
- Upgrade using advanced features
- Advanced features
- Configure the video
- Improve your appearance in the video
Improve your appearance in the video
Introduction
ZEGOCLOUD’s SDKs provide 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 basic face beautification features listed in this document (skin tone enhancement, cheek blusher, skin smoothing, and image sharpening) are provided by the embedded AI Effects SDK in the ZEGOCLOUD Video Call SDK. For more advanced beautification features, see Add video filters with the AI Effects.
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 .
Initialize the face beautification environment
To use the basic face beautification features, call the startEffectsEnv
method to initialize the face beautification environment before starting the local video view (startPreview
) and publishing streams (startPublishingStream
).
After initializing the face beautification environment, the SDK implements the transmission with the default video frame data type. If you need to use the custom video pre-processing feature, you will need to configure the corresponding video frame data type:
- Windows: Only supports the raw type data. That is, you must set the
bufferType
of theZegoCustomVideoCaptureConfig
toZEGO_VIDEO_BUFFER_TYPE_RAW_DATA
. - iOS and macOS: Only supports the data of
CVPixelBuffer
type. That is, you must set thebufferType
of theZegoCustomVideoCaptureConfig
toZegoVideoBufferTypeCVPixelBuffer
. - Android: Only supports the data of
Texture 2D
type. That is, you must set thebufferType
of theZegoCustomVideoCaptureConfig
toGL_TEXTURE_2D
.
/** Create a face beautification environment */
[[ZegoExpressEngine sharedInstance] startEffectsEnv];
Enable the basic face beautification features
There is no particular time order for calling the enableEffectsBeauty
method and the setEffectsBeautyParam
method.
After initializing the face beautification environment, you can call the enableEffectsBeauty
method to enable the face beautification feature you want to use after or before the stream publishing.
/** Enable the basic face beautification features */
[[ZegoExpressEngine sharedInstance] enableEffectsBeauty:true];
Set the intensity for the face beautification features
After initializing the face beautification environment, you can call the setEffectsBeautyParam
method to set the intensity as needed after or before the stream publishing.
- 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.
// Create a parameter object for the face beautification environment.
ZegoEffectsBeautyParam *beautyParam = [[ZegoEffectsBeautyParam alloc] init];
// Skin tone enhancement, cheek blusher, skin smoothing, image sharpening
beautyParam.whitenIntensity = 50;
beautyParam.rosyIntensity = 50;
beautyParam.smoothIntensity = 50;
beautyParam.sharpenIntensity = 50;
/** Set the intensity by specifying the parameter */
[[ZegoExpressEngine sharedInstance] setEffectsBeautyParam:beautyParam];
Destroy the face beautification environment
To disable the face beautification features, set the parameter to false
when calling the enableEffectsBeauty
method. While the face beautification module still occupies resources.
To destroy the face beautification environment and release the resources it occupies, call the stopEffectsEnv
method before the local video preview and stream publishing.
The SDK automatically destroys the face beautification environment when you call the destroyEngine
method to destroy the SDK.
/** Destroy the face beautification environment */
[[ZegoExpressEngine sharedInstance] stopEffectsEnv];