Skip to content

Latest commit

 

History

History

videocall-deepar

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Voximplant DeepAR Video Call Demo (Android)

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

Features

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

Getting started

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

Automatic

We've implemented a special template to enable you to quickly use the demo – just install SDK tutorial from our marketplace:

Manual

You can set up it manually using our quickstart guide and tutorials

VoxEngine scenario example:

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);
});

Installing

  1. Clone this repo;
  2. 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);
  3. Download the DeepAR SDK and copy the deepar.aar into android-sdk-kotlin-demo/deepar/ folder;
  4. 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

Usage

User login

Log in using:

See the following files for code details:

Make or receive calls

Enter a Voximplant user name to the input field and press "Call" button to make a call.

See the following files for code details:

Call screen and DeepAR

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:

Useful links

  1. Quickstart
  2. Voximplant Android SDK reference
  3. DeepAR SDK
  4. HowTo's
  5. Push Notifications Tutorial

Have a question