Talk to us
Talk to us
menu

Blog Post

start building
Business

AI Effects for your Audio and Video Apps

AI Effects for your Audio and Video Apps

Who doesn’t want to look impeccable on video calls and live-streaming? Face and voice filters can be life saviors.

Video calling and live broadcasting has steadily risen in popularity over the past ten years to rank among the most widely used entertainment mediums. Numerous apps are available now for Android devices, including Twitch, Facebook Live, and Youtube Live, which provide entertaining features like face filters and voice changers.

However, have you ever considered integrating them into your audio and video application? If so, this article will help you. We will learn about cutting-edge ZEGOCLOUD AI Effects, a service that provides various AI-powered real-time video effects.

ZEGOCLOUD AI Effects

Before jumping into the tutorial, let’s first describe the product.

More than just Face Filters

Various AI-powered real-time video effects, such as face beautification, AR effects, picture segmentation, and more, are offered via the ZegoEffects SDK. You can use it for various purposes, including live social and entertainment streaming, online learning, and camera tools.

The main features are:

  • Face beautification: skin smoothing, improvement of skin tone, eyes brightening, teeth whitening, elimination of eye bags and dark circles, elimination of freckles, elimination of acne, and more.
  • Virtual face makeup: lipstick, eyeliner, eyeshadow, mascara, eyebrow pencils, foundation, blusher, and more.
  • Face shape retouching: precise facial critical point recognition and 3D face models, including slimming of the cheekbones, chin, and nose, expanding of the eyes, adjusting the distance between the eyes, changing the form of the lips, and more
  • Segmentation of images: several picture segmentation options, including head, hair, green screen, and portrait segmentation
  • Filters: a wide variety of stunning picture and video filters, including ones with the following styles: light, soft, Japanese, woodland, fresh, and more
  • AR results (coming soon): AR special effects, such as face stickers, 2D/3D stickers, and stickers for the environment, are used, all of which have exceptional durability to create good results when used with complicated backdrops, lighting changes, and elongated poses.

Why choose ZEGOCLOUD AI Effects?

The advantages of ZEGOCLOUD SDK for face filters and AI effects are the following:

  • Robust facial recognition that can correctly detect 148 facial key points after extensive human face data analysis and training
  • Leading-edge AI algorithms enable high-precision human body identification and placement algorithms that work well in challenging situations like selfies and video filming.
  • Stable tracking of portrait features keeps track of portrait characteristics even when the subject’s face or body turns or moves swiftly.
  • Precise virtual makeup with realistic-looking virtual face cosmetics thanks to extensive training and iterative facial keypoint recognition fine-tuning
  • Complete compatibility with iOS, Android, Windows, and macOS

When to use ZEGOCLOUD AI Effects

You can integrate the cutting-edge ZEGOCLOUD AI Effects to serve users in several scenarios:

  • Live to broadcast social and entertainment streaming, live game streaming, video conferencing, and more; ZegoEffects can enhance your live streaming apps with powerful features like real-time face detection, face beautification, video filters, and many others.
  • Photography: it enables the creation of a wide range of camera applications with outstanding beauty features and thought-provoking stickers
  • Short videos: create mobile video recording and short video apps that let users record and edit videos uniquely.
  • Video creation: as a powerful tool for professional video creation, it offers video filters, stickers, and many more features to speed up and lower the cost of your video production.

You can try face filters and other excellent tools with the demo of AI Effects SDK, available for iOS and Android.

Integrate the ZEGOCLOUD AI Effects SDK

Before starting, there are some prerequisites to be met. We will consider integrating AI Effects SDK on Android devices.

Ensure that your development environment meets the following criteria:

  • at least Android Studio 2.1
  • Android SDK 25 or later, Android SDK Platform-Tools 25.x.x, Android SDK Build-Tools 25.0.2
  • Android 5.0 or later-running hardware or emulator (we recommend you use an actual device)

Create a new project

  1. Launch Android Studio, and click Create New Project in the Welcome to Android Studio window.
AI Effects

If you have a project already opened, select File > New > New Project.

  1. In the Configure your project window, fill in the project name and the location to save the project.
  1. Use the default settings for other fields, click Next, and click Finish to complete the project creation.

Import the SDK

Currently, the SDK supports these Application Binary Interfaces (ABIs): arm64-v8a, armeabi-v7a, and x86_64.

To import the SDK, do the following:

  1. Contact the ZEGO team to get the latest version of the SDK.
  2. Extract the SDK package to your project directory, for example, app/libs.
AI Effects
  1. Open the app/build.gradle file, and add references to the SDK.
  • In the defaultConfig block, add the ndk block to specify the supported ABIs.
ndk {
    abiFilters'armeabi-v7a','arm64-v8a','x86_64'
}
  • In the android block, add the sourceSets block to specify the directory where the SDK library files are located.

NOTE:

The libs directory in the following sample code is just an example. Use the actual path according to your project setup.

sourceSets {
    main {
        jniLibs.srcDirs = ['libs']
    }
}
  • Add the following line to import all JAR files under the libs directory in the dependencies block.

1 implementation fileTree(dir:’libs’, include: [‘*.jar’])

Add app permissions

Add the following permissions in the app/src/main/AndroidManifest.xml file to access the devices according to your app’s requirements.

CAUTION:

Request runtime permissions: Android 6.0 requires specific necessary permissions to be obtained at runtime. So, besides declaring permissions in your app’s AndroidMainfest.xml file, you also need to add the following code to request the permissions at runtime.

Note: requestPermissions is a method of the Activity.

String[] permissionNeeded = { "android.permission.CAMERA" };

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
    if (ContextCompat.checkSelfPermission(this, "android.permission.CAMERA") != PackageManager.PERMISSION_GRANTED) {
        requestPermissions(permissionNeeded, 101);
    }
}

Prevent code obfuscation

In the proguard-rules.pro file, add the following line to prevent the classes of the ZegoEffects SDK from being obfuscated.

-keep class **.zego.**{*;}

For better insight and precise code transcription, please refer to the documentation page directory on this link.

Import resources and models

Remember that before you can use the AI features of the ZegoEffects SDK, you need to import the resources or models required for these features.

  • Import the related resources first to use features such as skin tone enhancement, teeth whitening, cheek blusher, and stickers.
  • Import the related models first to use features such as eye enlarging, face slimming, and portrait segmentation.

It’s a very straightforward procedure; you will find the implementation steps on this link.

Enjoy your face and audio filters!

ZEGOCLOUD
ZEGOCLOUD With our fully customizable and easy-to-integrate Live SDK, you can quickly build reliable, scalable, and interactive live streaming into your mobile, web, and desktop apps.

Related posts