This demo demonstrates the integration of Voximplant Android SDK and DeepAR SDK to add face masks to a video call app. The application supports video calls between this Android app and other apps that use any Voximplant SDK. Based on MVVM architectural pattern.
Please follow Installing section to correct setup application.
Compatibility: DeepAR version
3.2.0
The application is able to:
- log in to the Voximplant Cloud
- make/receive video call
- add 3D face mask to the local video using DeepAR SDK
To get started, you'll need to register a free Voximplant developer account.
You'll need the following:
- Voximplant application
- two Voximplant users
- VoxEngine scenario
- routing setup
We've implemented a special template to enable you to quickly use the demo – just install SDK tutorial from our marketplace:
You can set up it manually using our quickstart guide and tutorials
require(Modules.PushService);
VoxEngine.addEventListener(AppEvents.CallAlerting, (e) => {
const newCall = VoxEngine.callUserDirect(
e.call,
e.destination,
e.callerid,
e.displayName,
null
);
VoxEngine.easyProcess(e.call, newCall, ()=>{}, true);
});
- Clone this repo;
- Go to DeepAR, sign up, create the project and the Android app, copy license key and paste it to
apikey.properties
(instead of YOUR_DEEP_AR_TOKEN_HERE string); - Download the DeepAR SDK and copy the deepar.aar into
android-sdk-kotlin-demo/deepar/
folder; - Select videocall-deepar and build the project using Android Studio.
This demo app adds aviators face mask to the local video. You can download additional assets from DeepAR downloads, place them into android-sdk-kotlin-demo/videocall-deepar/src/main/assets/
folder and apply them in the DeepARHelper class.
Compatibility: DeepAR version
3.2.0
Log in using:
- Voximplant user name in the format
[email protected]
- password
See the following files for code details:
Enter a Voximplant user name to the input field and press "Call" button to make a call.
See the following files for code details:
Local video is captured using CameraX API.
The application process each frame using ImageAnalysis.Analyzer API
, then transforms to YUV_420_888
format and passes it to DeepAR SDK.
DeepAR applies a mask/effect and renders the frame (using on-screen rendering mode) to a to a SurfaceTexture. This SurfaceTexture is created using Voximplant SurfaceTextureHelper API that holds common OpenGL ES resources and allows the SDK to take the final frames to encode and send. SurfaceTextureHelper must be created with shared ClientConfig.eglBase
context.
SurfaceTexture, as the source of video frames, is connected to the call using ICustomVideoSource.setSurfaceTextureHelper
API.
See the following files for code details:
- contact us via
[email protected]
- create an issue
- join our developer community