logo
On this page

Advanced - Publish Video Enhancement

2025-01-20

Function Overview

ZEGO Express SDK provides various video pre-processing enhancement capabilities. Developers can adjust the screen effects at the publishing end according to business needs.

Warning

This feature does not support running in WebGL environment.

FunctionFunction DescriptionFunction AdvantagesEffect Display
Low Light EnhancementWhen ambient light is dark and the brightness of the screen captured by the camera does not meet business requirements such as seeing faces clearly or performing face recognition, enhance the screen brightness.
  • Minimal performance overhead, covers all device models.
  • Supports automatic enhancement mode, automatically identifies low light environments.
Color EnhancementDue to camera characteristics, the captured video may have insufficient saturation. Use the color enhancement function to enhance under-saturated colors while protecting skin tones, making screen colors more realistic and more in line with human visual perception.
  • Protect skin tones to avoid enhancing people's skin colors.
  • Protect lip colors to make lip colors more natural when using AI Effects and wearing makeup.

Prerequisites

Before using the publish video enhancement function, please ensure:

Usage Steps

Initialize and Login to Room

For the specific process of initialization and logging in to the room, please refer to "Create Engine" and "Login Room" in the Implement Video Call documentation.

Set Publish Video Enhancement Effects

Please select the corresponding function to configure as needed.

ZEGO provides two methods of low light enhancement:

Description

ZEGO provides two methods of low light enhancement:

Description
Enable adaptive frame rate for enhancementDynamically reduce the capture frame rate within the set frame rate range to extend the exposure time of each frame and achieve the effect of enhancing the brightness of the captured screen.
For example: The developer enables and sets the adaptive frame rate range to [10, 25]. When ambient light is sufficient, the capture frame rate is still 25 frames. When ambient light is low, the capture frame rate will be dynamically adjusted between [10, 25] to extend the exposure time of each frame and enhance the brightness of the captured screen.
Enhance the brightness of the captured screen through algorithms
  • Manual enhancement mode: Determine whether to enable algorithm enhancement based on received parameters.
  • Automatic enhancement mode: The SDK automatically decides whether to enable algorithm enhancement and the degree of enhancement based on the ambient light brightness of the user's environment.

Both processing methods can be used independently or simultaneously, and both are compatible with AI Effects functions.

Set Low Light Enhancement Mode

RTC SDK supports different algorithm low light enhancement modes. Call the SetLowlightEnhancement interface to set the low light enhancement mode ZegoLowlightEnhancementMode:

Enumeration ValueDescription
ZegoLowlightEnhancementMode.OffTurn off low light enhancement function, captured screen brightness remains unchanged.
ZegoLowlightEnhancementMode.OnTurn on low light enhancement function, captured screen brightness is enhanced.
ZegoLowlightEnhance

Taking enabling automatic low light enhancement function as an example:

engine.SetLowlightEnhancement(ZegoLowlightEnhancementMode.Auto,ZegoPublishChannel.Main);

(Optional) Enable Camera Adaptive Frame Rate

When ambient light is low and the camera capture frame rate is too high, the exposure time of each frame may be insufficient, resulting in darker captured video screens. At this time, you can enable camera adaptive frame rate through EnableCameraAdaptiveFPS. The SDK will match the camera-supported capture frame rate range according to the set frame rate range, and dynamically adjust the camera capture frame rate according to ambient brightness within this range to improve screen brightness when the set frame rate is too high.

int minCamFPS = 15;//Set minimum frame rate
int maxCamFPS = 25;//Set maximum frame rate
engine.EnableCameraAdaptiveFPS(true, minCamFPS, maxCamFPS, ZegoPublishChannel.Main);

(Optional) Enable Camera Adaptive Frame Rate

When ambient light is low and the camera capture frame rate is too high, the exposure time of each frame may be insufficient, resulting in darker captured video screens. At this time, you can enable camera adaptive frame rate through EnableCameraAdaptiveFPS. The SDK will match the camera-supported capture frame rate range according to the set frame rate range, and dynamically adjust the camera capture frame rate according to ambient brightness within this range to improve screen brightness when the set frame rate is too high.

int minCamFPS = 15;//Set minimum frame rate
int maxCamFPS = 25;//Set maximum frame rate
engine.EnableCameraAdaptiveFPS(true, minCamFPS, maxCamFPS, ZegoPublishChannel.Main);
int minCamFPS = 15;//Set minimum frame rate
int maxCamFPS = 25;//Set maximum frame rate
engine.EnableCameraAdaptiveFPS(true, minCamFPS, maxCamFPS, ZegoPublishChannel.Main);

Call the EnableColorEnhancement interface, set the color enhancement parameters ZegoColorEnhancementParams (parameter attributes are in the following table), and other parameters to enable the color enhancement function. Color enhancement function is disabled by default.

Color Enhancement ParameterDescription
intensity

The intensity of color enhancement, value range [0.0, 1.0], default is 0.0.

The larger the value, the greater the color enhancement effect.

skinToneProtectionLevel

The intensity of skin tone protection, value range [0.0, 1.0], default is 1.0.

The larger the value, the better the protection effect.

lipColorProtectionLevel

The intensity of lip color protection, value range [0.0, 1.0], default is 0.0.

The larger the value, the better the protection effect.

ZegoColorEnhancementParams param = new ZegoColorEnhancementParams();
param.intensity = 1;//Value range: [0,1], the larger the value, the greater the color enhancement intensity. Default: 0.
param.lipColorProtectionLevel = 1;//Value range: [0,1], the larger the value, the greater the skin tone protection degree. Default: 1.
param.skinToneProtectionLevel = 1;//Value range: [0,1], the larger the value, the greater the lip color protection degree. Default: 0.
engine.EnableColorEnhancement(true, param);//Enable color enhancement

Start Preview

After calling the StartPreview interface to enable preview, you can set different video enhancement functions and experience the effects in real time.

engine.StartPreview();

Start Publishing Stream

When the preview effect meets expectations, you can call the StartPublishingStream interface to start publishing stream. The publishing stream screen effect will be consistent with the preview effect.

engine.StartPublishingStream("STREAM_ID");

The above implements the video enhancement function before publishing stream.

Previous

Video Small-Large Stream and Layered Encoding

Next

Use CDN Live Streaming