How to intergrate Banuba SDK with Android Video SDK?
Use Banuba SDK with Android SDK to enhance video calls with real-time face filters and virtual backgrounds.
Step 1: Banuba Token
- To start working with the Banuba SDK into your project, you need to have the client token. To receive the client token please fill form on banuba.com
Step 2: Add Banuba SDK dependencies
-
With the client token, you will also receive the Banuba SDK archive for Android which contains Banuba Effect Player (compiled Android library project with .aar extension), Banuba SDK (compiled Android library project with .aar extension) and example filters located under effects folder.
-
Create
libs
directory in your project and addbanuba_effect_player.aar
,banuba_sdk.aar
files.
- Open build.gradle (Module: app) and add Banuba SDK dependencies.
dependencies {
// Banuba SDK dependencies
implementation fileTree(dir: 'libs', include: ['*.aar'])
// other app dependencies
}
Step 3: Add effects into your project
- Create
effects
folder underassets
directory in your project and add filters that you want to use in theeffects
folder.You can download test effects here: Effects
Step 4: Integrate Banuba
-
Create one interface named
IVideoFrameProcessor
and a class namedBanubaProcessor
in your project and copy paste code from the example. -
Update your Banuba client token into
BanubaProcessor.java
file.
public class BanubaProcessor implements IVideoFrameProcessor {
//...
public static final String KEY = "place_your_token_here";
//...
}
-
Create instance of
CapturerObserver
class and pass into VideoSDK.createCameraVideoTrack() method. To know more about createCameraVideoTrack() method please visit CustomVideoTrack. -
Copy paste method named
initVideoFrameProcessor(VideoSource videosource,CustomStreamTrack videoCustomTrack)
from the example. into your Activity and call it after creatingCustomStreamTrack
for video.
Step 5: Use filters in Meeting
-
If you want to use video filters from start of the meeting, you can pass
CustomStreamTrack
in theinitMeeting
. -
Also you can use video filters during the meeting by passing the
CustomStreamTrack
in theenableWebcam()
method of Meeting.
Stuck anywhere? Check out this Code Sample of Banuba Intergation with Android-SDK on GitHub
Got a Question? Ask us on discord