Video Effects Config - Flutter
VideoSDK.setVideoEffects() and room.setVideoEffects() take a VideoEffectsConfig, which describes the effects for the camera video you send. This page lists the classes and enums of that configuration, and the map that both methods return. To learn how to use the effects, see the Video Effects guide.
VideoEffectsConfig
The whole effects configuration. Every effect is off until you turn it on.
Each call to setVideoEffects() replaces the whole configuration: an effect you leave out goes back to its default. Build the full configuration from your app's state every time.
- pipeline:
VideoEffectsPipeline- The engine that runs the effects. Defaults toVideoEffectsPipeline.LEGACY. - framing:
VideoEffectsFraming- Auto-framing. - lighting:
VideoEffectsLighting- Low-light correction. - style:
VideoEffectsStyle- A stylized look. - filter:
VideoEffectsFilter- A color grade. - background:
VideoEffectsBackground- Background blur. - extra:
Map<String, Object>- Additional named settings. OnlyString,numandboolvalues are used, and maps and lists are dropped. The effects on this page do not need it.
Outside a const expression, you can also write the enum values under VideoEffectsConfig: VideoEffectsConfig.Pipeline.GRAPH, VideoEffectsConfig.StylePreset.VIVID, VideoEffectsConfig.Lut.WARM.
Example
const VideoEffectsConfig config = VideoEffectsConfig(
lighting: VideoEffectsLighting(enabled: true, strength: 0.8),
filter: VideoEffectsFilter(lut: VideoEffectsLut.WARM, strength: 0.6),
background: VideoEffectsBackground(mode: VideoEffectsBackgroundMode.BLUR),
);
VideoEffectsFraming
Auto-framing crops and zooms the picture to keep the subject in the center. The size of the video does not change.
- enabled:
bool- Defaults tofalse. - maxZoom:
double- The closest the crop can zoom in, from1.0to4.0. Defaults to2.0.
On VideoEffectsPipeline.LEGACY, framing follows the largest face the SDK detects. On Android, this needs com.google.mlkit:face-detection:16.1.7 in your app's build.gradle. Without it, the other effects still run, and the returned map says why framing is off.
On VideoEffectsPipeline.GRAPH, framing follows the subject that you publish with publishFramingSubject().
VideoEffectsLighting
Low-light correction brightens the dark parts of the picture and leaves the bright parts alone.
- enabled:
bool- Defaults tofalse. - strength:
double- From0.0to1.0. Defaults to1.0.
VideoEffectsStyle
A look applied to the whole picture.
- preset:
VideoEffectsStylePreset- Defaults toVideoEffectsStylePreset.OFF. - strength:
double- From0.0to1.0. Defaults to1.0. - levels:
int- The number of color steps thatVideoEffectsStylePreset.POSTERIZEuses, from3to17. Defaults to5.VideoEffectsPipeline.GRAPHrounds it to an odd number.
VideoEffectsFilter
A color grade, applied after the other effects.
- lut:
VideoEffectsLut- Defaults toVideoEffectsLut.OFF. - strength:
double- From0.0to1.0. Defaults to1.0.
VideoEffectsBackground
Background blur keeps the person sharp and blurs everything behind them. It runs on VideoEffectsPipeline.LEGACY only.
- mode:
VideoEffectsBackgroundMode- Defaults toVideoEffectsBackgroundMode.OFF. - blurStrength:
double- How strong the blur is, from0.0to1.0. Defaults to0.5.
On Android, background blur needs com.google.mlkit:segmentation-selfie:16.0.0-beta6 in your app's build.gradle. Without it, the other effects still run, and the returned map says why blur is off.
VideoEffectsPipeline
The engine that runs the effects.
LEGACY- The default. Runs the effects on the CPU. Framing follows the face the SDK detects. It runs every effect, including background blur.GRAPH- Runs the effects on the GPU. Framing follows the subject that you publish withpublishFramingSubject(). Background blur does not run on it. On a device whose GPU cannot run the effects, the returned map hasappliedset tofalse, and the camera video is sent without effects.
VideoEffectsStylePreset
OFF- The default.POSTERIZE- Flat color bands.VIVID- Boosted contrast and color.
VideoEffectsLut
OFF- The default.WARM- Warmer tones.COOL- Cooler tones.MONO- Black and white.
VideoEffectsBackgroundMode
OFF- The default.BLUR- Blurs the background.
Applied effects
setVideoEffects() and getAppliedVideoEffectsConfig() return a Map<String, dynamic>? that describes the effects that are running. It can differ from what you asked for.
- engine:
String-cpuwhen the effects run onVideoEffectsPipeline.LEGACY,gpuwhen they run onVideoEffectsPipeline.GRAPH, andnonewhen no effect runs. - applied:
bool-falsewhen the effects are not running. - reason:
String- Why the effects, or one of them, do not run. For example, the camera is off, or an ML Kit library is missing on Android. - pipeline:
String-LEGACYorGRAPH. - framing, lighting, style, filter and background:
Map- The settings in force for each effect. OnVideoEffectsPipeline.LEGACY,framingalso hasface, which istruewhile a face is followed, andzoom, the current zoom factor. When an effect cannot run, its map has areason.
The map can contain other keys.
While your camera is off, engine is none and applied is false. The SDK keeps the configuration and applies it when the camera starts.
Example
final Map<String, dynamic>? effects = await VideoSDK.getAppliedVideoEffectsConfig();
if (effects?['applied'] != true) {
print("Effects are not running: ${effects?['reason']}");
}
Got a Question? Ask us on discord

