Video Effects - Android
Hosts can apply effects to their camera video before it is sent. Everyone watching the livestream sees the effects, and so does the host's own preview.
| Effect | Setting | What it does |
|---|---|---|
| Auto-framing | Framing | Crops and zooms the picture to keep a subject in the center. You provide the subject's position. |
| Low-light correction | Lighting | Brightens dark parts of the picture and leaves bright parts alone. |
| Stylized look | Style | Applies a look to the whole picture: POSTERIZE or VIVID. |
| Color grade | Filter | Grades the colors of the finished picture: WARM, COOL or MONO. |
The Android SDK has no virtual background, so none of these effects replaces or blurs the background. To process camera frames with your own code or a third-party library, use a video processor instead.
Effects run only with pipeline = VideoEffectsConfig.Pipeline.GRAPH. Each effect is off until you turn it on. If the GPU effects can't start on the device, onError reports 3080 (ERROR_VIDEO_EFFECTS_GRAPH_UNAVAILABLE) and the camera video is sent without effects.
Turn effects on before going live
Call VideoSDK.setVideoEffects() on the host's device, after VideoSDK.initialize() and before joining the livestream. The effects apply when the camera starts.
val applied: JSONObject = VideoSDK.setVideoEffects(
VideoEffectsConfig(
pipeline = VideoEffectsConfig.Pipeline.GRAPH,
lighting = VideoEffectsConfig.Lighting(enabled = true),
filter = VideoEffectsConfig.Filter(lut = VideoEffectsConfig.Lut.COOL, strength = 0.5f),
)
)
val reason = applied.optString("reason")
// before the camera starts, a GRAPH request is held with a "pending:" reason
if (!applied.optBoolean("applied") && !reason.startsWith("pending:")) {
Log.w("VideoEffects", "GPU effects not applied: $reason")
}
Change effects during the livestream
Call liveStream.setVideoEffects() with the new configuration. Each call replaces the whole configuration. A change to the effect settings applies straight away. A change of pipeline applies the next time the camera starts.
liveStream.setVideoEffects(
VideoEffectsConfig(
pipeline = VideoEffectsConfig.Pipeline.GRAPH,
style = VideoEffectsConfig.Style(preset = VideoEffectsConfig.StylePreset.VIVID, strength = 0.7f),
)
)
liveStream.getAppliedVideoEffectsConfig() returns the configuration in force. When applied is false, reason explains why.
For every setting, auto-framing and the host's preview, see the Video Effects guide.
API Reference
The API references for all the methods utilized in this guide are provided below.
Got a Question? Ask us on discord

