All Products
Document Center

Video recording

Last Updated: Aug 01, 2019


The recording module of the Alibaba Cloud short video SDK provides the video recording feature. It varies in the basic, standard, and professional editions of the short video SDK. In addition to the basic recording feature, the basic edition also supports filters and the basic face filter. Based on the basic edition, the standard edition adds the video speed control and music features. The professional edition offers features such as filters, music, speed control, basic and advanced face filters, and facial motion graphics. This topic describes only the integration procedure for the professional edition.

Integrate the recording feature

Step 1: Import files

  • Import modules.

Copy the following required modules into the directory of your project: AlivcCore, AliyunSVideoBase, AliyunFileDownLoader, AliyunSvideoMusic, AliyunRecorder, AliyunVideoSdk, AliyunVideoCommon, and thirdparty-lib. In the following figure, the ApsaraVideoQuVideo project is a sample project and the selected modules are required ones copied from the demo. Copy files for SmartVideo recording

  • Import SO files.

Copy SO files from the app/src/main/jniLibs directory to the specified library folder of your project.

Name Description Required The dependent third-party audio library of the short video SDK. Yes The dependent third-party library of the short video SDK. Yes The core library of the short video SDK. Yes The dependent third-party library of the short video SDK. Yes The library related to facial recognition. No The library related to facial recognition. No

Tips: Currently, the short video SDK provides a library folder for each of the following two CPU architectures: armeabi-v7a and arm64-v8a. Tips: Pay attention to the specified SO file folder of your project, which is app/src/main/jniLibs by default.

Step 2: Configure Gradle

  • Import modules.

Add the copied modules to the dependencies of your project. Copy the following code into the settings.gradle file of your project:

include ':AlivcCore'
include ':AliyunSVideoBase'
include ':AliyunFileDownLoader:downloadermanager'
include ':AliyunSvideoMusic'
include ':AliyunRecorder:record_demo'
include ':AliyunVideoSdk'
include ':AliyunVideoCommon'
  • Add a configuration file.

Because the demo configuration, such as some dependent third-party open source libraries and the SDK version, is managed in the configuration file config.gradle of the thirdparty-lib folder in a uniform manner, you need to import this file into your project. Copy the following code into the build.gradle file of your project and synchronize Gradle again:

apply from: 'thirdparty-lib/config.gradle'


  • Add a Maven repository.

Copy the following code into the build.gradle file of your project:

allprojects {
    repositories {
        maven { url "" }
  • Add dependencies.

Add the following dependency code to dependencies in the build.gradle file of the main module (whose name is generally app) in your project:

implementation project(':AliyunRecorder:record_demo')
implementation externalAliyunOSS

Step 3: Use the feature

Tips: The recording feature needs camera access and storage permissions. To guarantee that you can use this feature properly on devices in Android 6.0 or later versions, you need to apply for a dynamic permission to handle exceptions such as the black screen.

  • Create a MyApplication class to inherit the class or add the following code to the specified Application object of your project:
    public void onCreate() {

  • Accesses the recording UI.
public void startRecord(View view) {
        AliyunSnapVideoParam recordParam = new AliyunSnapVideoParam.Builder()
        AlivcSvideoRecordActivity.startRecord(this, recordParam,"community");
  • Register a redirect activity after recording. If you need to redirect users to a custom page after recording, register a redirect activity in the AliyunSvideoActionConfig class.
// Goes to the editing page by default after recording.

Enable the advanced face filter

The short video solution integrates the advanced face filter of FaceUnity. To use this advanced face filter, you only need to replace the relevant authpack certificate file with a FaceUnity certificate.

Obtain a FaceUnity certificate

You can send an email to apply for trial use and specify the advanced face filter of FaceUnity in the email. Alibaba Cloud will send a certificate to you by email. Email: Email content: Provide your application name, bundle ID, package name, and signature. The signature is an MD5 hash value in lowercase without colons (:).

After the application email is sent, you can receive an file. Use this file to replace the file in your project. Ensure that the package name and signature are consistent in the two files.


  • For more information about the core code for integrating the FaceUnity SDK into the recording module of the short video solution, see the FaceUnityManager class in the demo.
  • The advanced face filter is available only in the professional edition of the short video SDK.
  • For more information about how to completely integrate the FaceUnity SDK, see the procedure for integrating the FaceUnity SDK into the short video SDK.