All Products
Search
Document Center

ApsaraVideo Live:Demo compilation

Last Updated:Mar 28, 2024

This topic describes how to compile the demo of Push SDK for Android.

Download the demo

For information about how to download the demo source code and installation package of the latest version of Push SDK, see SDK download and release notes.

Demo compilation

Environment requirements

  • The following table describes the mandatory requirements for the runtime environment.

    Item

    Requirement

    OS version

    Android 5.0 or later

    Android API version

    API level 21 or later

    CPU architecture

    ARM64 or ARMv7

  • The following table describes the optional requirements for the runtime environment. The demo is based on the environment information described in the table. The environment information is provided for your reference.

    Item

    Requirement

    Android Studio version

    4.1.3

    Java Runtime Environment (JRE)

    1.8.0_152-release-1136-b06 amd64

    Java Virtual Machine (JVM)

    OpenJDK 64-Bit

    compileSdkVersion

    31

    buildToolsVersion

    30.0.3

    minSdkVersion

    21

    targetSdkVersion

    31

    Gradle version

    gradle-7.0.2-bin

    Gradle plugin version

    com.android.tools.build:gradle:4.1.2

    NDK plugin version

    No requirement (default: android-ndk-r18b)

Run the demo source code

  1. Download the demo package of the required version by using the download link provided in the SDK download and release notes topic.

  2. Open Android Studio. Click Open an Existing Project and import the demo project to Android Studio.

  3. After the demo is compiled, click Run to install the demo on your Android device.

  4. Experience the features provided in the demo.

    Item

    Details

    Homepage of the mobile app for stream ingest

    Homepage of the mobile app for stream ingest

    Stream ingest settings

    Tap Camera Pushing to configure the stream ingest settings, as shown in the following figures.

    • Stream Ingest Parameters: Turn on Bitrate Control and Advanced Settings, and set DisplayMode to Quality First. Configure other parameters based on your business requirements.

    • Stream Ingest Features: Set Ingest to to Portrait and Orientation to aspectFill.

    Stream ingest settings Stream ingest settings - Feature settings

    Stream ingest and retouching

    Enter the ingest URL, and you can start stream ingest.Screenshot_20230905-100004.png

    Tap the Retouching button to display the retouching panel and configure retouching settings.

    Screenshot_20230905-100014.png

    Tap Start pushing to start ingesting audio and video streams.

    Screenshot_20230905-100033.png

    Note

    You must enter a valid Real-Time Messaging Protocol (RTMP) URL to start stream ingest. After the stream is ingested, you can use ApsaraVideo Player SDK, FFplay, or VLC to play the stream.

    Stream ingest for screen recording

    Screen recording 1 Screenshot_20230905-095704.pngScreen recording 2Screenshot_20230905-095759.png

    Co-streaming and battle

    Screenshot_20230905-111553.png

    Screenshot_20230905-111707.pngScreenshot_20230905-111711.png

Directory structure of the demo of Push SDK for Android

The following figure shows the directory structure of the demo: Directory structure of the demo V4.2.0

  • LiveAPP is the application module and is the entrance to the demo.

    image.png

  • Different features are placed in different sub-modules, inlcuding LiveBasic (basic streaming), LiveBeauty (retouching), and LiveInteractive (interactive streaming).