Talk to us
Talk to us
menu

Upgrade Your Live Streaming: Tips for Pre-Publish Video Quality Enhancement

Upgrade Your Live Streaming: Tips for Pre-Publish Video Quality Enhancement

When it comes to live streaming, video quality plays an important role in keeping your audience engaged. With the ZEGOCLOUD SDK, developers gain access to a variety of powerful video pre-processing enhancement capabilities, enabling them to fine-tune the visual effects of their streams before they are published. Whether your goal is to improve clarity, reduce noise, or add custom effects, these tools allow you to customize the video quality to meet your specific business needs.

In this blog, we’ll dive into how you can leverage these features to enhance your Android app’s live streaming experience and provide your viewers with polished, professional-quality streams.

What Video Quality Enhancement Capabilities Can ZEGOCLOUD Offers?

ZEGOCLOUD offers a range of video pre-processing enhancement features, enabling developers to optimize the visual effects of the stream publishing end to suit their business requirements. These features include basic face beautification, low-light enhancement, video noise reduction, and color enhancement.

FunctionFunction DescriptionAdvantagesEffect Display
Basic Face BeautificationAdjust the degree of Skin tone enhancement, Skin smoothing, Image sharpening, and Cheek blusher according to user and business needs, easily achieve the Basic face beautification features, present users with good skin condition, and create unique and natural Face beautification effects.Cover frequently used Face beautification capabilities.Face beautification
Low Light EnhancementWhen the brightness of the captured image by the camera is not sufficient to clearly see the face or perform face recognition in low light conditions, enhance the brightness of the image.Lightweight, covering all device models.Supports automatic mode, which intelligently enables or disables the algorithm based on the lighting conditions of the scene.Supports both traditional algorithms and AI-based algorithms, with intelligent selection of algorithm type based on device performance.Before low light enhancementAfter low light enhancement
Video DenoisingPoor camera capture quality, low ambient light, and other factors may cause noticeable noise in the image. The video denoising function can reduce the noise in the image.Determine whether to enable based on the noise level in the image to avoid unnecessary damage to the image.Adjustable denoising strength.Before video noise reductionAfter video noise reduction
Color EnhancementDue to the characteristics of the camera, the captured video may have insufficient saturation. By using the color enhancement function, the undersaturated colors can be enhanced while protecting the skin tone, making the colors more realistic and visually appealing.Protect the skin tone and avoid excessive enhancement of the skin color.Protect the lip color, making the lip color more natural during Face beautification and makeup.Before Color EnhancementAfter Color Ehancement

Steps to Enhance Video Quality

1 Initialize and log in

Create an instance of the ZEGO Express Engine and log in. For detailed instructions, refer to the “Create & Destroy the ZegoExpressEngine Instance” and “Log In & Log Out” sections in the Quick Start guide of the ZEGOCLOUD Live Streaming documentation.

2 Set up video enhancement for publishing stream

Follow these guides to integrate the features you need.

Basic face beautification

This feature is the basic face beautification of the built-in ZEGO Effects SDK in the ZEGO Express SDK, which includes four face beautification effects: Skin tone enhancement, Cheek blusher, Skin smoothing, and Image sharpening.

1 Initialize the Basic face beautification features environment

If you need to use the basic face beautification, you must call the startEffectsEnv interface to initialize the Face beautification environment before calling startPreview to start previewing and startPublishingStream to start publishing the stream.

// Create the Face beautification environment
ZegoExpressEngine.getEngine().startEffectsEnv();

After initializing the Face beautification environment, the SDK will use a fixed video frame data type for transmission. If you also need to use video custom pre-processing when using the Basic face beautification features, you can only configure the corresponding video frame data type:

Android platform: Only supports Texture 2D type data, which means the value of bufferType in ZegoCustomVideoCaptureConfig should be “GL_TEXTURE_2D”.

2 Enable the face beautification effect

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 beauty effect
ZegoExpressEngine.getEngine().enableEffectsBeauty(true);
3 Set the parameters for the Basic 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 the face beautification parameter object
ZegoEffectsBeautyParam beautyParam = new ZegoEffectsBeautyParam();

// Set the parameters for Skin tone enhancement, Cheek blusher, Skin smoothing, and Image sharpening
beautyParam.whitenIntensity = 50;
beautyParam.rosyIntensity = 50;
beautyParam.smoothIntensity = 50;
beautyParam.sharpenIntensity = 50;

// Set the Face beautification parameters
ZegoExpressEngine.getEngine().setEffectsBeautyParam(beautyParam);
(Optional) Destroy the Basic 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.getEngine().stopEffectsEnv();

Low-light enhancement

ZEGOCLOUND provides two ways to achieve Low-Light Enhancement:

MethodDescription
Enable adaptive frame rate enhancementWithin the specified frame rate range, dynamically reduce the capture frame rate to extend the exposure time of each frame, thereby enhancing the brightness of the captured image.
For example: If the developer enables and sets the adaptive frame rate range to [10, 25], when the ambient light is sufficient, the capture frame rate will still be 25 frames per second. When the ambient light is low, the capture frame rate will dynamically adjust between [10, 25] to extend the exposure time of each frame and enhance the brightness of the captured image.
Algorithm-based enhancement of captured image brightnessManual Control: Developers can independently control the algorithm switch. Smart Control: The algorithm is intelligently enabled or disabled based on the lighting conditions of the scene.

These two processing methods can be used independently or simultaneously, and are compatible with the beauty function.

1 Set the Low-light enhancement mode

The ZEGO Express SDK supports different algorithm-based Low-Light Enhancement modes. Call the setLowlightEnhancement interface to set the Low-Light Enhancement mode ZegoLowlightEnhancementMode:

EnumerationDescription
ZegoLowlightEnhancementMode.OFFTurn off the Low-Light Enhancement function, and the brightness of the captured image remains unchanged.
ZegoLowlightEnhancementMode.ONTurn on the Low-Light Enhancement function to enhance the brightness of the captured image.
ZegoLowlightEnhancementMode.AUTOAutomatic Low-Light Enhancement function, the enhancement value of the brightness of the captured image is dynamically adjusted according to the ambient light intensity.

Low light enhancement types ZegoExpLowlightEnhancementType|_blank include the following types:

Enum ValueDescription
ZegoExpLowlightEnhancementType.NormalConventional low light enhancement.
ZegoExpLowlightEnhancementType.AIAI-based low light enhancement. If you need to use this feature, you need to contact ZEGOCLOUD technical support.

For example, to enable automatic low-light enhancement:

ZegoExpLowlightEnhancementParams params = new ZegoExpLowlightEnhancementParams();
params.mode = ZegoLowlightEnhancementMode.AUTO;
params.type = ZegoExpLowlightEnhancementType.AI;
engine.setLowlightEnhancementParams(params, ZegoPublishChannel.MAIN);
2 (Optional) Enable camera adaptive frame rate

When the ambient light is low and the camera capture frame rate is too high, the exposure time of each frame of the captured image may be insufficient, resulting in a dark video image. In this case, you can enable camera adaptive frame rate by calling enableCameraAdaptiveFPS. The SDK will dynamically adjust the camera capture frame rate based on the supported capture frame rate range of the camera within the set range, and adjust the camera capture frame rate according to the ambient light intensity to improve the brightness of the video image when the set frame rate is too high.

// Set the minimum frame rate
int minCamFPS = getIntent().getIntExtra("camMinFPS", 0);
// Set the maximum frame rate
int maxCamFPS = getIntent().getIntExtra("camMaxFPS", 0);
engine.enableCameraAdaptiveFPS(true, minCamFPS, maxCamFPS, ZegoPublishChannel.MAIN);

Video Denoising

Call the setVideoDenoiseParams interface to set the video denoise parameters ZegoVideoDenoiseParams, including the video denoise mode ZegoVideoDenoiseMode and the video denoise strength ZegoVideoDenoiseStrength.

The video denoise function is not enabled by default, that is, the default value of ZegoVideoDenoiseMode is ZegoVideoDenoiseMode.off.

For example, to enable automatic denoising:

ZegoVideoDenoiseParams p = new ZegoVideoDenoiseParams();
p.mode = ZegoVideoDenoiseMode.AUTO;
p.strength = ZegoVideoDenoiseStrength.LIGHT;
engine.setVideoDenoiseParams(p, ZegoPublishChannel.MAIN);

Color Enhancement

Call the enableColorEnhancement interface to enable the color enhancement function and set the color enhancement parameters ZegoColorEnhancementParams (parameter attributes are shown in the following table) and other parameters. The color enhancement function is not enabled by default.

Color Enhancement ParameterDescription
intensityThe intensity of color enhancement, ranging from 0.0 to 1.0, with a default value of 0.0.
A larger value indicates a stronger color enhancement effect.
skinToneProtectionLevelThe intensity of skin tone protection, ranging from 0.0 to 1.0, with a default value of 1.0.
A larger value indicates a better protection effect.
lipColorProtectionLevelThe intensity of lip color protection, ranging from 0.0 to 1.0, with a default value of 0.0.
A larger value indicates a better protection effect.
ZegoColorEnhancementParams p = new ZegoColorEnhancementParams();
p.intensity = 1; //Range: [0,1], a larger value indicates a stronger color enhancement effect. Default value: 0.
p.skinToneProtectionLevel = 1; //Range: [0,1], a larger value indicates a better skin tone protection effect. Default value: 1.
p.lipColorProtectionLevel = 1; //Range: [0,1], a larger value indicates a better lip color protection effect. Default value: 0.
engine.enableColorEnhancement(true, p, ZegoPublishChannel.MAIN); //Enable color enhancement

3 Start preview

After calling the startPreview interface to start the preview, you can set different video enhancement features and experience the effects in real time.

ZegoCanvas previewCanvas = new ZegoCanvas(preview);
engine.startPreview(previewCanvas);

4 Start publishing stream

When the preview effect meets expectations, you can call the startPublishingStream interface to start publishing the stream. The video effect of the publishing stream will be the same as the preview effect.

engine.startPublishingStream("STREAM_ID");

With the above steps, you can achieve video enhancement for publishing stream.

Conclusion

In conclusion, ZEGOCLOUD’s SDK stands out as a powerful tool for improving live streaming experience. By offering a comprehensive suite of video pre-processing features such as face beautification, low-light enhancement, video denoising, and color enhancement, ZEGOCLOUD empowers developers to fine-tune visual effects and deliver polished, professional-quality streams. In today’s competitive landscape, where video quality is crucial for audience engagement, leveraging these capabilities ensures that your live streams not only meet but exceed expectations, providing viewers with a captivating and high-quality experience. Sign up today and enjoy 10,000 minutes free of charge to make your live-streaming app exceptional and unlock endless possibilities for connection and engagement!

Let’s Build APP Together

Start building with real-time video, voice & chat SDK for apps today!

Talk to us

Take your apps to the next level with our voice, video and chat APIs

Free Trial
  • 10,000 minutes for free
  • 4,000+ corporate clients
  • 3 Billion daily call minutes

Stay updated with us by signing up for our newsletter!

Don't miss out on important news and updates from ZEGOCLOUD!

* You may unsubscribe at any time using the unsubscribe link in the digest email. See our privacy policy for more information.