Advanced - Publish Video Enhancement
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.
This feature does not support running in WebGL environment.
| Function | Function Description | Function Advantages | Effect Display | |
|---|---|---|---|---|
| Low Light Enhancement | When 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. |
| ![]() | ![]() |
| Color Enhancement | Due 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. |
| ![]() | ![]() |
Prerequisites
Before using the publish video enhancement function, please ensure:
- You have created a project in ZEGOCLOUD Console and applied for valid AppID and AppSign. For details, please refer to Console - Project Information.
- You have integrated ZEGO Express SDK in the project and implemented basic audio and video streaming functions. For details, please refer to Quick Start - Integration and Quick Start - Implementation.
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 enhancement | Dynamically 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 |
|
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 Value | Description |
|---|---|
| ZegoLowlightEnhancementMode.Off | Turn off low light enhancement function, captured screen brightness remains unchanged. |
| ZegoLowlightEnhancementMode.On | Turn 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 Parameter | Description |
|---|---|
| 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 enhancementStart 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.




