WebRTC publishing via WHIP¶
Overview¶
Since build 5.2.1816 WebRTC stream may be published via WebRTC-HTTP ingestion protocol (WHIP). The protocol proposes a standardized SDP exchange to establish a WebRTC connection using HTTP POST request
Today, WHIP is supported by OBS Studio 30 and later, but on Windows operating system only. WHIP stream publishing is almost the same as WebRTC publishing from browser except SDP exchange.
Codecs supported¶
Video:
- H264
- VP8 if publisher supports it
- H265 if publisher supports it
Audio:
- Opus
- G711 (PCMA, PCMU) if publisher supports it
Operation flowchart¶
-
Publisher (OBS) sends HTTP POST query
/rest-api/stream/publish/streamName
with SDP offer -
Publisher receives 202 Accepted with SDP answer
-
Publisher establishes WebRTC connection and publishes a stream
-
Player establishes Websocket connection and sends
playStream
command -
Player establishes WebRTC connection and receives the stream published
Testing¶
-
For test we use:
- WCS server - OBS 30 and later for Windows to publish a stream - Player example in Chrome browser to play the stream -
On Stream tab in OBS settings choose WHIP service, enter HTTP POST query URL including a stream name to publish
-
Publish the stream from OBS
-
Open Player example in Chrome browser from testing server, set the stream name to
whipStream
and click Play
Authentication using Authorization: Bearer
header¶
Since WCS build 5.2.1964 authentication using Authorization: Bearer
header is supported
In this case a publishing client (OBS) should send the header with the bearer token set with any query used when the stream is publishing via WHIP protocol. Any alphanumeric string may be used as token value, the stream name for example. The combination of the stream name and token value is checked at server side. If the token value differs from the value received with /rest-api/stream/publish
query, the server returns 409 Permission denied
Known issues¶
1. OBS does not support WebRTC publishing via TCP¶
Symptoms
A stream cannot be published from OBS when ice_tcp_transport=true parameter is used in server settings