logo
On this page

Filters


The ZegoEffects SDK provides video filters with different styles that can be used in a wide range of use cases, such as live video streaming, short videos, and more.

Prerequisites

Before you begin to use the SDK's video filters in your project, make sure you complete the following steps:

Implementation steps

The SDK provides video filters with the following styles:

  • Natural: Creamy, Brighten, Fresh, Autumn
  • Gray: Cool, Night, Film-like
  • Dreamy: Sunset, Cozily, Sweet

In general, you can take the following steps to use a filter:

  1. Turn on the filter by specifying the resource path of the filter.
  2. Set the filter parameters as needed. If not specified, the SDK uses the default settings.

Filters

  1. Enable Filters.

    Call the setFilter interface to enable/disable the filter feature, passing in the absolute path of the corresponding filter. Call the setFilterParam interface to set the intensity of the filter.

    The "intensity" parameter of the ZegoEffectsFilterParam object, which represents the intensity of the filter, has a value range of [0, 100]. The higher the value, the greater the degree of effect presentation. Developers can customize the value according to their needs.

    Warning

    The effect of filter styles cannot be superimposed. After setting a new filter path, it will override the previous filter effect.

    Untitled
    // Enable filter feature
    // 1. Enable filter feature, and pass in the absolute path of the corresponding filter
    mEffects.setFilter("/xxx/xxx/Night.bundle");
    
    // Set filter intensity, range [0, 100]
    mEffects.setFilterParam({ intensity: 100 });
    
    1
    Copied!
  2. Remove Filter.

    If you need to remove the filter, pass null into the setFilter interface.

    Untitled
    // Remove filter feature
    mEffects.setFilter(null);
    
    1
    Copied!

Previous

Background Segmentation

Next

Error Codes