Configure OBS Studio for WebRTC P2P Streaming
This guide provides a straightforward walk-through on how to configure OBS Studio to stream natively to peer-to-peer (P2P) WebRTC platforms. By utilizing the WebRTC HTTP Ingestion Protocol (WHIP), which is natively integrated into modern versions of OBS Studio, you can achieve sub-second latency streaming without relying on third-party plugins or external RTMP-to-WebRTC converters.
Step 1: Retrieve WHIP Credentials
To establish a WebRTC connection, OBS Studio needs to target a WHIP endpoint provided by your destination platform.
- Log in to your target WebRTC streaming platform.
- Navigate to the streaming setup, developer console, or channel settings.
- Locate and copy the WHIP Endpoint URL (typically
begins with
https://). - Copy the Bearer Token or Stream Key if your platform requires authentication.
Step 2: Configure OBS Stream Settings
Once you have your credentials, you must configure OBS Studio to use the WHIP protocol.
- Launch OBS Studio (ensure you are using version 30.0 or later).
- Click Settings in the bottom-right control panel.
- Select the Stream tab from the left-hand menu.
- Click the Service dropdown menu and select WHIP.
- In the Server field, paste the WHIP Endpoint URL you retrieved in Step 1.
- In the Bearer Token field, paste your platform’s stream key or token.
- Click Apply.
Step 3: Optimize Encoder Settings for WebRTC
WebRTC is designed for real-time communication, which requires specific encoder settings to prevent buffering and packet loss.
- In the Settings window, navigate to the Output tab.
- Change the Output Mode dropdown at the top to Advanced.
- Under the Streaming tab, select your preferred video encoder (NVIDIA NVENC, AMD AMF, or x264).
- Set the Rate Control to CBR (Constant Bitrate).
- Set the Keyframe Interval to 1s or 2s (do not leave it on 0/Auto).
- Set the Preset to Low-Latency or Max Performance.
- Change Max B-frames to 0. WebRTC does not support B-frames, and disabling them is critical for achieving sub-second latency.
Step 4: Configure Audio Settings
WebRTC platforms require highly compatible audio configurations.
- Navigate to the Audio tab in Settings.
- Ensure the Sample Rate is set to 48 kHz.
- If your platform supports Opus audio encoding, ensure your audio bitrate in the Output > Audio tab is set between 96 Kbps and 160 Kbps for optimal performance.
Step 5: Start Streaming
Click Apply and then OK to close the Settings menu. Click Start Streaming on the main OBS interface. Your video and audio feeds will now stream natively via WebRTC directly to the peer-to-peer network interface of your destination platform.