All Products
Search
Document Center

ApsaraVideo Live:Use OBS to ingest an RTS stream

Last Updated:Jan 10, 2025

This topic describes how to use Open Broadcaster Software (OBS) to ingest a Real-Time Streaming (RTS) stream based on WebRTC-HTTP Ingestion Protocol (WHIP). ApsaraVideo Live provides RTS 1.0 and RTS 2.0. For differences between the two versions, see Feature comparison.

Background information

WHIP is a simplified network protocol that uses HTTP POST requests to ingest real-time video streams to the cloud or other streaming media servers. WHIP is lightweight and can help transmit real-time video content that is captured by using Web Real-Time Communication (WebRTC) technologies to streaming media services that support the protocol. WHIP is an open-source, standardized protocol used to access WebRTC and has the advantages of low latency and good compatibility.

Preparations

  1. Enable RTS for your domain names and run through the RTS demo.

  2. Enable WHIP. This feature is in public preview. To use WHIP, submit a ticket.

  3. Download and install OBS Studio 29.1.0 or later. Download link: OBS Studio.

Use OBS to ingest a stream

  1. Use the URL generator in the ApsaraVideo Live console to generate an ingest URL in the RTS format. Example: artc://al.yun.com/live/live?auth_key=******. You can also construct an ingest URL by using the concatenation rules. For more information, see Method 2: Use the concatenation rules.

    1. Log on to the ApsaraVideo Live console.
    2. In the left-side navigation pane, choose URL Generators > Live URL Generator.

    3. Configure the parameters and obtain the ingest URL in the RTS format.

      image

  2. Change the RTS ingest URL to a WHIP-based HTTP(S) URL.

    1. Change the artc prefix to the http(s) prefix. Example:

      1. Original URL: artc://al.yun.com/live/live?auth_key=******

      2. Modified URL: https://al.yun.com/live/live?auth_key=******

    2. If you use HTTPS, you need to configure an SSL certificate. For more information, see Configure HTTPS secure acceleration.

  3. Use OBS to ingest the RTS stream.

    1. Launch OBS Studio.

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

    3. On the Settings page, click Stream. Configure the parameters and click OK. The following table describes the parameters.

      Parameter

      Description

      Service

      Select WHIP.

      Server

      Enter the WHIP-based HTTP(S) URL generated in Step 2.

      Bearer Token

      Leave this parameter empty.

      image.png

  4. On the homepage of OBS Studio, click Start Streaming.

  5. View active streams on the Stream Management page of the ApsaraVideo Live console.

    1. In the left-side navigation pane of the ApsaraVideo Live console, click Streams.

    2. On the Stream Management page, select the domain name that you want to query. On the Active Streams tab, enter an application name and a stream name.

      image.png

    3. Click Search. The active streams are displayed.

  6. Play the RTS stream on the web.

    1. Access the RTS player for web.

    2. Click the Stream Pulling tab.

    3. Enter the streaming URL of the RTS stream.

      image

    4. Click Start to play the RTS stream.

Note on RTS 2.0 stream ingest using WHIP

  • If the RTS stream is ingested using RTS 2.0, you must add the following MSID parameters to the converted WHIP-based HTTP(S) URL: amsid and vmsid parameters. Set the values of the parameters to rts audio and rts video respectively. This step helps ensure the RTS stream is playable through the ApsaraVideo Player. For more information about MSID parameters, see The MSID Mechanism.

  • For audio-only scenarios, specify only the amsid parameter. For video-only scenarios, specify only the vmsid parameter. Otherwise, the playback exceptions may occur.

Example

Original WHIP-based URLs:

http://push-test.alicdn.com/app/name

https://push-test.alicdn.com/app/name

WHIP-based URL with MSID parameters specified:

https://push-test.alicdn.com/app/name?amsid=rts%20audio&vmsid=rts%20video

Note

To ensure the ingest URL works correctly, you must escape the space character " " in the values of rts video and rts audio. Replace the space with %20.