Live stream ingest

Updated at:

ApsaraVideo Live supports multiple stream ingest methods. You can implement stream ingest for standard streaming and Real-Time Streaming (RTS) by using different devices based on your business requirements.

Prerequisites

  • For standard streaming: All operations from Activate ApsaraVideo Live to Generate ingest and streaming URLs in the basic procedure to get started with ApsaraVideo Live are complete. For more information, see Get started with ApsaraVideo Live.

  • For RTS: All operations from Activate ApsaraVideo Live to Generate ingest and streaming URLs in the basic procedure to implement RTS are complete. For more information, see Basic RTS workflow.

  • The relevant ingest URLs are generated. For more information, see Generate live stream URLs.

Stream ingest for standard streaming

Scenario 1: Ingest streams on a PC

When you use a PC that runs Windows or macOS, you can install Open Broadcaster Software (OBS) to ingest streams based on your business requirements. OBS supports Windows, macOS, and Linux and is free and open source software for video recording and live streaming.

In the following example, OBS Studio V27.2.3 for Windows is used. The operations that you perform to ingest streams are similar for OBS of other versions or on other platforms.

  1. Download OBS Studio from the Official website and install it.

  2. Start OBS Studio.

  3. In the menu bar, choose File > Settings.

  4. On the Settings page, click Stream and configure the following parameters:

    Parameter

    Description

    Service

    Select Custom.

    Server

    Enter the generated authenticated ingest URL. Example: rtmp://demo.aliyundoc.com/app/stream?auth_key=1543302081-0-0-9c6e7c8190c10bdfb3c0************.

    Stream Key

    Leave the Stream Key empty.

  5. In the OBS Studio main window, add a source in the Sources section, and then click Start Streaming.

  6. Go to the Stream Management page. On the Active Streams tab, you can view and manage your active streams.

Scenario 2: Ingest streams on a mobile device

  1. Scan the QR code with your mobile device to install the Push SDK demo.

    image

    Note

    On iOS, if an "Untrusted Enterprise Developer" message appears, go to Settings > General > Device Management, then find and trust the Taobao profile.

  2. Start the Push SDK demo.

  3. Select Camera Pushing or Screen Sharing.

    Note

    For local video ingest, the demo supports only the original YUV format.

  4. Enter your authenticated ingest URL (for example, rtmp://demo.aliyundoc.com/app/stream?auth_key=1543302081-0-0-9c6e7c8190c10bdfb3c0************) and configure other parameters as needed.

  5. Click Start Pushing to begin ingesting the stream from your mobile device.

  6. Go to the Stream Management page. On the Active Streams tab, you can view and manage your active streams.

Scenario 3: Use Push SDK to ingest streams

Push SDK for iOS

  1. Integrate the Push SDK for iOS. For more information, see SDK integration.

  2. Configure stream ingest parameters and ingest the stream. For more information, see Feature usage.

    For information about handling exceptions during configuration and ingest, see Handle errors, exceptions, and special cases.

Push SDK for Android

  1. Integrate the Push SDK for Android. For more information, see SDK integration.

  2. Configure stream ingest parameters and ingest the stream. For more information, see Feature usage.

    For information about handling exceptions during configuration and ingest, see Handle errors, exceptions, and special cases.

Stream ingest for RTS

When you ingest streams over RTS, the formats vary based on different scenarios. Strictly conform to the following rules based on the format of the ingested stream and the client used for stream ingest.

Scenario 1: Ingest using OBS

For instructions, refer to Push a live stream to RTS using OBS.

Scenario 2: Ingest on the web client

  1. Go to the RTS player for web.

  2. Click the Stream Ingest tab.

  3. Expand the none drop-down list and select camera or screen (screen sharing) based on your requirements.

    If you select camera, click Get devices and grant access to the microphone and camera in the pop-up dialog box. After you grant access, expand the Select Microphone and Select Camera drop-down lists and select your microphone and camera.

  4. Click Create Local Stream.

  5. Enter the generated RTS ingest URL. For example: artc://example.aliyundoc.com/liveApp****/liveStream****?auth_key=1543302081-0-0-9c6e7c8190c10bdfb3c0****.

  6. Click Start.

Scenario 3: Use Push SDK to ingest RTS streams

The procedure for using Push SDK to ingest an RTS stream is similar to the procedure for using Push SDK to ingest an RTMP stream. To ingest an RTS stream, you must specify an ingest URL in the RTS format when you call the startPush operation. Other settings are the same.

Push SDK for iOS

  1. Integrate the Push SDK for iOS. For more information, see SDK integration.

  2. Configure stream ingest parameters and ingest the stream. For more information, see Feature usage.

    For information about handling exceptions during configuration and ingest, see Handle errors, exceptions, and special cases.

Push SDK for Android

  1. Integrate the Push SDK for Android. For more information, see SDK integration.

  2. Configure stream ingest parameters and ingest the stream. For more information, see Feature usage.

    For information about handling exceptions during configuration and ingest, see Handle errors, exceptions, and special cases.