Skip to main content

Face AR and AR Cloud products

Banuba Face AR SDK product is used on camera and editor screens for applying various AR effects while making video content.

Overview

Any Face AR effect is a folder that includes a number of files required for Face AR SDK to play this effect.

tip

Make sure preview.png file is included in effect folder. You can use this file as a preview for AR effect.

Manage effects

There are 2 options for managing AR effects:

  1. Store all effects in assets/bnb-resources/effects folder in the app.
  2. Use AR Cloud for storing effects on a server.
tip

You can use both options i.e. store just a few AR effects in assets and 100 or more AR effects on AR Cloud.

Integrate AR Cloud

AR Cloud is a cloud solution for storing Banuba Face AR effects on the server and used by Face AR and Video Editor products.
Any AR effect downloaded from AR Cloud is cached on the user's device.

Follow next steps to integrate AR Cloud into your project.
First, add Gradle com.banuba.sdk:ar-cloud dependency in app gradle file.

    def banubaSdkVersion = '1.36.2'
...
+ implementation "com.banuba.sdk:ar-cloud:${banubaSdkVersion}"
...

Next, add ArCloudKoinModule module to Koin modules.

startKoin {
...

modules(
VeSdkKoinModule().module,
...
+ ArCloudKoinModule().module,
...
)
}

Next, override ArEffectsRepositoryProvider in VideoEditorModule.

   single<ArEffectsRepositoryProvider>(createdAtStart = true) {
ArEffectsRepositoryProvider(
arEffectsRepository = get(named("backendArEffectsRepository")),
ioDispatcher = get(named("ioDispatcher"))
)
}

Change order effects

By default, all AR effects are listed in alphabetical order. AR effects from assets are listed in order.

Create new class CustomMaskOrderProvider and implement OrderProvider to provide custom order.

class CustomMaskOrderProvider : OrderProvider {
override fun provide(): List<String> = listOf("Background", "HeadphoneMusic")
}
info

These are names of specific directories in assets/bnb-resources/effects or on AR Cloud.

Next, use CustomMaskOrderProvider in VideoEditorModule

single<OrderProvider>(named("maskOrderProvider")) {
CustomMaskOrderProvider()
}

Disable Face AR SDK

Video Editor SDK can be used without Face AR SDK.

Remove BanubaEffectPlayerKoinModule().module from VideoEditorModule

startKoin {
androidContext(this@IntegrationApp)
modules(
...
- BanubaEffectPlayerKoinModule().module
)
}

and remove Gradle dependency com.banuba.sdk:effect-player-adapter

    ...
- implementation "com.banuba.sdk:effect-player-adapter:${banubaSdkVersion}"
...

Integrate Beauty effect

Video Editor SDK has built in integration with beautification effect - Beauty. The user interacts with Beauty effect by clicking on specific button on camera screen.

warning

Beauty is not available in the list of all AR effects on the screen. Additionally, it is required to store the effect in assets and keep name Beauty with no changes.
Please move this effect while integrating Video Editor SDK into your project if you use Face AR product.