All Products
Search
Document Center

ApsaraVideo Live:Integrate Queen SDK for iOS

Last Updated:Sep 05, 2024

Queen SDK is a smart retouching SDK developed by the video cloud team of Alibaba. This SDK provides a wide range of features including image retouching, face retouching, chroma key, stickers, makeup, gesture recognition, body shaping, hairdressing, and augmented reality (AR) writing. You can use these features in live streaming, video conferencing, and short video production scenarios. This topic describes how to integrate Queen SDK for iOS to help you implement retouching features.

Prerequisites

A development environment is prepared. The following table describes the requirements for the development environment.

Item

Description

iOS

iOS 9.0 or later.

macOS High Sierra

macOS High Sierra 10.13 or later.

Xcode

Xcode 9.0 or later. To download Xcode, visit Mac App Store.

iOS device

Mobile devices that adopt the ARMv7 or ARM64 architecture, such as iPad and iPhone. Devices that run macOS and adopt the ARM64 architecture are not supported.

Integration methods

You can integrate the SDK in pod or local mode based on your business requirements.

Pod mode

Sample code:

pod 'Queen', '6.1.0-official-pro' 

Local mode

  1. Download and decompress the sample project package to obtain the following frameworks:

    queen.framework
    opencv2.framework
    Important

    opencv2.framework is not required for Basic Edition.

  2. Open Xcode and select your project target. On the General tab, add the preceding frameworks in the Frameworks, Libraries, and Embedded Content section and set the Embed parameter to Embed & Sign for these frameworks.

  3. On the Build Settings tab of the project target, find ENABLE_BITCODE and set this parameter to NO.

  4. Add mnn.metallib from the obtained queen.framework file to the project directory. This step is required only for Ultimate Edition and Full Edition.

Configure the license

Make sure that you have obtained a license of Queen SDK in advance. For more information, see Obtain a license of Queen SDK. After you obtain a license, perform the following steps to configure the LicenseKey and LicenseFile in the project:

Note
  • If you integrate Queen SDK of ApsaraVideo Live and the short video SDK of ApsaraVideo VOD at the same time, the two SDKs have the same LicenseKey and LicenseFile. You need to only configure the LicenseKey and LicenseFile once. Note that the latest license file must be used.

  • If the SDK that you purchase is updated or needs to be renewed, you must also update the license file. Perform the following steps to update the license file:

    1. Send an email to obtain the latest license file. For more information, see Obtain a license of Queen SDK.

    2. After you obtain the latest license file, perform the steps to configure the license.

Import the license file to the app project and add the following keys to the Info.plist file:

  • AlivcLicenseKey: The value of this key is the value of the LicenseKey. Example: MoCTfuQ391Z01****8f8745e23c8a457a8ff8d5faedc1****.

  • AlivcLicenseFile: The value of this key is the path of the license file that is relative to the mainBundle. Example: AliVideoCert_164933454****.crt.

References

Item

References

Sample project

Sample project

Demo project on GitHub

Demo project

Code for integration with SDKs from common vendors