This topic describes how to use OBS for Real-Time Streaming (RTS) stream ingest.
Background information
RTMP: This protocol offers excellent compatibility and is ideal for workflows using an existing RTMP toolchain. In OBS, you can select the "Custom" service to enter your ingest domain and stream information.
WHIP (WebRTC-HTTP ingestion protocol): A lightweight protocol that uses HTTP POST requests to ingest real-time audio and video into a server. It simplifies integration with WebRTC capture pipelines. As a common ingest method in the WebRTC ecosystem, WHIP offers low latency and easy integration.
Prerequisites
-
You have configured a domain for Real-Time Streaming (RTS) and verified that the demo works correctly.
-
You have downloaded and installed OBS Studio 29.1.0 or later. For the download link, see OBS Studio.
-
Decide whether to use RTMP or WHIP for stream ingest. You only need to configure one.
Use OBS for stream ingest
Step 1: Video encoding best practices
In OBS, go to File > Settings > Output. Apply the recommended settings below to remove B-frames, control the GOP, and reduce end-to-end latency. These settings apply to both RTMP and WHIP stream ingest.
-
Output mode: Advanced
-
Keyframe interval (seconds, 0=auto): 1
NoteThe keyframe interval must not exceed 3 seconds. We recommend a value of 1 second.
-
CPU Usage Preset (higher = less CPU): veryfast
-
Profile: baseline
-
Tune: zerolatency
On the Streaming tab in the Output settings, set encoder to x264, rate control to CBR, and bitrate to 2500 Kbps.
Step 2: Generate an ingest URL
In the ApsaraVideo Live console, use the URL generator to obtain your stream ingest information. For RTMP ingest, copy the RTMP URL. For WHIP ingest, copy the RTS artc:// URL, which you will convert to an HTTP(S) endpoint in Step 4. You can also construct a URL manually. For details, see Method 2: Manually construct a URL.
-
RTMP example (The actual URL depends on the console output):
rtmp://push.example.com/live/live?auth_key=****** -
ARTC (for WHIP conversion) example:
artc://al.yun.com/live/live?auth_key=******
- Log on to the ApsaraVideo Live console.
-
In the left-side navigation pane, choose .
-
In the generator, configure the domain, AppName, StreamName, authentication, and other settings. Then, copy the required RTMP or ARTC ingest URL.
Click Generate URLs. This action generates both an ingest URL and a source-quality streaming URL (in ARTC format, starting with
artc://).
Step 3 (Optional): Ingest over RTMP
-
Launch OBS and go to File > Settings > Stream:
-
Service: Select Custom.
-
Server and Stream Key: Enter the RTMP information from Step 2. If you have a full URL, split it into the Server and Stream Key fields as required by OBS. Click OK to save.
-
Step 4 (Optional): Ingest over WHIP
-
Convert the ARTC ingest URL from Step 2 to a WHIP-compatible HTTP(S) URL.
-
Change the URL scheme from ARTC to HTTP(S). For example:
-
Original URL:
artc://al.yun.com/live/live?auth_key=******. -
Modified URL:
https://al.yun.com/live/live?auth_key=******.
-
-
If you ingest streams over HTTPS, you must configure a certificate for your environment. For more information, see HTTPS secure acceleration.
-
-
Configure WHIP in OBS.
-
Launch OBS.
-
Go to File > Settings > Stream.
-
Configure the following parameters and click OK.
Parameter
Description
Service
Select WHIP.
Server
Enter the modified WHIP URL from the previous step.
Bearer Token
Leave this field empty.
-
Step 5: Start and verify the stream
-
In the main OBS window, add audio and video sources in the Sources pane, then click Start Streaming.
-
In the ApsaraVideo Live console, verify the active stream on the stream management page.
-
In the left-side navigation pane of the ApsaraVideo Live console, choose stream management.
-
Select the domain to query and enter the AppName and StreamName.
On the Active streams tab, click Query to check the ingest status.
-
Click Query to view the current real-time active streams.
-
-
Quickly verify the stream by playing it with the RTS web player.
-
Go to the RTS web player.
-
Click the Stream pulling tab.
-
Enter the streaming URL for which RTS has been enabled.
On the RTS web player demo page, go to the Stream pulling tab. Ensure that Subscribe to Audio and Subscribe to Video are selected, enter the streaming URL, and then click Start playing.
-
Click Start playing.
-