Get Started

Last update:2025-09-05 17:24:30

This guide provides a comprehensive walkthrough for setting up low-latency WebRTC streaming. We will cover two primary workflows: RTMP-to-WebRTC and a pure WebRTC end-to-end setup.

1. Encoding Requirements

For optimal performance and browser compatibility, your source stream must adhere to the following encoding standards.

  • Video Codec: H.264 (without B-frames). WebRTC does not support B-frames (Bi-directional predicted frames). Enabling them might cause playback errors.
  • Audio Codec: Opus. Modern browsers require the Opus audio codec for WebRTC playback.

Note on Transcoding: Low Latency Streaming can transcode streams that do not meet these requirements (e.g., video with B-frames or different audio codecs). However, transcoding adds latency and may incur additional costs. This feature is not enabled by default. To enable it, please contact our support team.

2. Workflow 1: RTMP Ingest, WebRTC Playback

This workflow is ideal for users who want to integrate WebRTC playback with their existing RTMP publishing setup. It offers a balance of easy setup and low latency, with the only trade-off being the minor delay from the required AAC-to-Opus audio transcoding.

Audio Requirement for RTMP: If you use an RTMP encoder, you must use AAC audio, as RTMP does not support Opus. To ensure browser compatibility, please contact our support team to enable the transcoding service that converts AAC to Opus.

Step 1: Configure Your RTMP Encoder (OBS Example)

You must configure your encoder to send a WebRTC-compatible stream. The most critical setting is disabling B-frames. The following steps use OBS Studio, a popular and free encoder.

  1. Open Settings and navigate to the Output tab.
  2. Set Output Mode to Advanced.
  3. In the Streaming tab, locate the x264 Options field and enter bframes=0. This explicitly disables B-frames. For other suggested configurations to help improve streaming performance, please refer to the image below.

Step 2: Set Your Stream Destination in OBS

  1. Navigate to the Stream tab in OBS Settings.
  2. Select Custom… from the Service dropdown menu.
  3. In the Server field, enter your RTMP push URL, formatted as follows:
    rtmp://your-push-domain.com/appname/streamname
    • your-push-domain.com: Your assigned push domain.
    • appname: The application name used to group your streams (e.g., live). This name must be configured in the Low Latency Streaming product console, as it allows you to apply specific settings or view analytics for different stream categories.
    • streamname: A unique identifier for your stream.
  4. Click Apply and then Start Streaming in the main OBS window.

3. Workflow 2: End-to-End WebRTC (Lower Latency)

For the absolute lowest latency, this workflow uses WebRTC for both publishing (ingest) and playback. We support two protocols for WebRTC ingest:

  • WHIP (WebRTC-HTTP Ingestion Protocol): The modern industry standard. It is recommended for its broad compatibility. See our WHIP/WHEP Setup Guide for configuration details.
  • Custom WebRTC Ingest: A custom protocol that requires a specific OBS plugin. Instructions are provided below.

Configuring OBS for Custom WebRTC Ingest

Prerequisites:

Installation:

  1. Unzip the downloaded plugin file.
  2. Copy services.json from the plugin’s \data\obs-plugins\rtmp-services folder to your OBS installation directory at C:\Program Files\obs-studio\data\obs-plugins\rtmp-services, replacing the existing file.
  3. Copy obs-webrtc.dll from the plugin’s \obs-plugins\64bit folder to your OBS installation directory at C:\Program Files\obs-studio\obs-plugins\64bit.

Troubleshooting: If the new service option doesn’t appear in OBS, you may also need to replace services.json in the user-specific directory: C:\Users[Your Username]\AppData\Roaming\obs-studio\plugin_config\rtmp-services.

Configuration:

  1. Restart OBS and navigate to the Stream tab in Settings.
  2. Select Wangsu webRTC from the Service dropdown.
  3. In the Stream Key field, enter your WebRTC push URL using the following format. The .sdp extension is required.http://your-push-domain.com/appname/streamname.sdp
  4. Click Apply and Start Streaming.

4. Playback and Testing

Once your stream is active, you can use the following resources to test playback.

Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!