How to change the strength of the Background Blur? How to change the strength of the Background Blur?

How to change the strength of the Background Blur?

Yukari Dumburs

Symptom

This article outlines how to change the strength of the Background Blur feature in the JavaScript SDK.

Applies To

  • Video API
  • JavaScript SDK
  • Video Filters
  • Background Blur

Resolution

  1. When you initiate a publisher or at any point afterward using applyVideoFilter method, you have the option to apply blur strength to a video using blurStrength property. There are two choices for blur strength: "low" or "high", with "high" being the default option.
  2. If you require a blur strength lower or higher than that, you can use ML Transformers and specify radius in pixels. "low" corresponds to 5px, and "high" corresponds to 10px. Here is an example code for implementing background blur using ML Transformers. Instead of using a preset option, you can modify line 14 as follows:
const config = {
transformerType: 'BackgroundBlur',
radius: 15
};

Additional Information

Please note that the video filter feature requires significant resources and is best suited for devices with high processing power. We recommend using this feature on supported devices.