Live stream ingest

更新时间:
复制 MD 格式

This topic describes how to ingest a live stream by using Open Broadcaster Software (OBS) and the Push SDK.

Prerequisite

Generate an ingest URL. For more information, see Generate live stream URLs.

Usage notes

ApsaraVideo Live accepts only one stream per ingest URL at a time and rejects any subsequent streams to that URL.

Note
  • If you encounter an exception during live stream ingest, use the troubleshooting tool to diagnose common ingest issues and get solutions. For more information, see Troubleshooting.

  • To prevent rare stream ingest failures caused by system issues from affecting your live streaming service, we recommend that you implement high availability policies, such as stream ingest retries and error alarms, when you use a third-party stream ingest tool. You can also configure stream ingest callbacks to monitor the stream ingest status. Distribute the streaming URL only after the stream ingest is successful. For more information, see Event Callback.

Ingest by using OBS

OBS is available for Windows, macOS, and Linux. This topic uses OBS Studio V27.2.3 for Windows as an example. The steps are similar for other versions and operating systems.

  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.

Ingest by using the Push SDK demo

  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.

Ingest by using the Push SDK

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.

Push SDK for Flutter

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

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

Push SDK for Web

FAQ

What if OBS stream ingest is correctly configured but the playback has no video?

  1. Verify that the ingest domain name, application name (appName), and stream name (streamName) are correctly configured in OBS.

  2. Go to the Stream management page in the console to view if the stream is available under the Active Stream tab.

  3. If the stream is not available, troubleshoot the local OBS ingest status and network connectivity. Make sure that the ingest is successful before you test the playback.

The live stream plays with stuttering video but normal audio on iOS devices. What do I do?

This issue is typically caused by a mismatch between the video encoding parameters and the decoding capabilities of iOS devices. Adjust the stream ingest configuration, such as video codec, bitrate, and GOP, to ensure compatibility with iOS.

Can I stream directly from Douyin to ApsaraVideo Live?

Douyin does not support direct stream ingest to ApsaraVideo Live. To send live stream content to ApsaraVideo Live, use an independent ingest client such as OBS or a custom ingest tool. Push the live stream to the ingest URL generated by ApsaraVideo Live by using a supported protocol such as RTMP, ARTC, or SRT.

How do I stream from an RTSP camera to ApsaraVideo Live?

RTSP cameras typically output RTSP streams. ApsaraVideo Live supports only the RTMP, ARTC, and SRT ingest protocols and does not accept RTSP streams directly. To ingest from an RTSP camera to ApsaraVideo Live, use one of the following methods:

  • Contact the device manufacturer to check whether the management software or gateway device supports converting RTSP streams to the RTMP or SRT protocol.

  • Use a third-party ingest tool that supports protocol conversion to relay the RTSP stream to ApsaraVideo Live over RTMP or SRT.

Next steps

  • After you start the live stream ingest, you can begin live stream playback. For more information, see Live stream playback.

  • To manage your ingested streams, refer to Manage streams.