# Video Effects SDK for Android

> Add background blur, virtual backgrounds, auto-framing and beautification to an Android app with the ai.effectssdk:video package.

The Android SDK works with the camera through a ready `CameraPipeline` (CameraX) or with frames from any other source through an `ImagePipeline`. Android 5.0 (API 21) and newer.

## Before you start

Register in the [Developer Portal](https://effectssdk.ai/cp/registration#video), start a trial for Android and copy your **Customer ID**.

## Add the dependency

```kotlin
// build.gradle.kts
implementation("ai.effectssdk:video:+")

// Libraries used by the SDK
implementation("com.google.flogger:flogger:0.9")
implementation("com.google.flogger:flogger-system-backend:0.9")
implementation("com.google.guava:guava:33.4.8-android")

// Only for CameraPipeline
implementation("androidx.camera:camera-core:1.4.2")
implementation("androidx.camera:camera-camera2:1.4.2")
implementation("androidx.camera:camera-lifecycle:1.4.2")
```

Pin a version from the [releases](/releases?sdk=video-android) instead of `+` for production builds. Add the `INTERNET` and `CAMERA` permissions to the manifest.

## Initialize

```kotlin
EffectsSDK.initialize(context, yourCustomerId) { status ->
    when (status) {
        EffectsSDKStatus.ACTIVE -> startEffects()
        EffectsSDKStatus.INACTIVE, EffectsSDKStatus.EXPIRED -> showLicenseError()
        EffectsSDKStatus.UNAVAILABLE -> hideEffects() // device not supported
    }
}
```

## Process the camera

```kotlin
val sdkFactory = EffectsSDK.createSDKFactory()

val pipeline = sdkFactory.createCameraPipeline(
    context = context,
    mode = PipelineMode.BLUR,
    blurPower = 0.7f
)
pipeline.setOutputSurface(surface)   // or setOnFrameAvailableListener { bitmap, timestamp -> }
pipeline.startPipeline()

// later
pipeline.stopPipeline()
pipeline.release()
```

## Process your own frames

```kotlin
val pipeline = sdkFactory.createImagePipeline(
    context = context,
    mode = PipelineMode.REPLACE,
    background = backgroundBitmap,
)
pipeline.process(input)
```

If you only need background removal, replacement or blur, the lite pipelines (`createLiteCameraPipeline`) are lighter.

## Next steps

- [Sample app and full README](https://github.com/EffectsSDK/android-integration-sample)
- [Release notes](/releases?sdk=video-android)
