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
Enable RTS for your domain names and run through the RTS demo.
Enable WHIP. This feature is in public preview. To use WHIP, submit a ticket.
Download and install OBS Studio 29.1.0 or later. Download link: OBS Studio.
Use OBS to ingest a stream
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.- Log on to the ApsaraVideo Live console.
In the left-side navigation pane, choose
.Configure the parameters and obtain the ingest URL in the RTS format.
Change the RTS ingest URL to a WHIP-based HTTP(S) URL.
Change the
artc
prefix to thehttp(s)
prefix. Example:Original URL:
artc://al.yun.com/live/live?auth_key=******
Modified URL:
https://al.yun.com/live/live?auth_key=******
If you use HTTPS, you need to configure an SSL certificate. For more information, see Configure HTTPS secure acceleration.
Use OBS to ingest the RTS stream.
Launch OBS Studio.
In the menu bar, choose
.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.
On the homepage of OBS Studio, click Start Streaming.
View active streams on the Stream Management page of the ApsaraVideo Live console.
In the left-side navigation pane of the ApsaraVideo Live console, click Streams.
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.
Click Search. The active streams are displayed.
Play the RTS stream on the web.
Access the RTS player for web.
Click the Stream Pulling tab.
Enter the streaming URL of the RTS stream.
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
andrts 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
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
.