# Publish via WebRTC/WHIP

You can publish a media source to OvenMediaEngine Enterprise on AWS via `WebRTC/WHIP` Protocol from a **WebRTC-capable live encoder** or a **web browser,** with no additional plug-ins required.

In addition, by leveraging WebRTC Simulcast, you can send multiple quality layers within a single publishing session. This helps deliver more stable sub-second live streaming by adapting to each viewer’s network conditions, and it can also reduce transcoding load depending on your workflow.

This guide walks you through how to publish a stream via WebRTC/WHIP and how to perform basic playback and status checks after publishing.

<table><thead><tr><th width="151">Item</th><th>Supported</th></tr></thead><tbody><tr><td>Container</td><td>RTP / RTCP</td></tr><tr><td>Security</td><td>DTLS, SRTP</td></tr><tr><td>Transport</td><td>ICE</td></tr><tr><td>Error Correction</td><td>ULPFEC (<code>VP8</code>, <code>H.264</code>), In-band FEC (<code>Opus</code>)</td></tr><tr><td>Codec</td><td>VP8, H.264, H.265, Opus</td></tr><tr><td>Signaling</td><td>Self-Defined Signaling Protocol, Embedded WebSocket-based Server / WHIP</td></tr></tbody></table>

## Start Publishing a WebRTC/WHIP Stream <a href="#start-publishing-a-webrtc-whip-stream" id="start-publishing-a-webrtc-whip-stream"></a>

In this example, we use OBS Studio (Option A), one of the most commonly used live encoder softwares, and the OvenPlayer Demo provided by AirenSoft (Option B).

{% stepper %}
{% step %}

### \[Option A] Publish from a Live Encoder (OBS Studio) <a href="#publish-from-a-live-encoder" id="publish-from-a-live-encoder"></a>

<figure><img src="https://content.gitbook.com/content/xo7moYXTh3yBG01Dy49w/blobs/bNiAvgzgbPB96n9FrSRV/image.png" alt=""><figcaption></figcaption></figure>

1. Launch Open Broadcaster Software (OBS) Studio.
   * If OBS Studio is not installed, download it from the official page (<https://obsproject.com/download>).
2. Add a media source you want to publish (e.g., Media Source, Camera. or Screen Capture).
3. Click <mark style="color:yellow;">\[Settings]</mark> in the bottom-right corner of OBS.

<figure><img src="https://content.gitbook.com/content/xo7moYXTh3yBG01Dy49w/blobs/wOZJcHYnuf9sG6kR6E7p/image.png" alt=""><figcaption></figcaption></figure>

4. In the left menu of Settings, select the <mark style="color:yellow;">\[Stream]</mark> tab.
5. Under <mark style="color:yellow;">\[Service]</mark>, select <mark style="color:$primary;">**\[WHIP]**</mark>, then enter one of the WebRTC/WHIP Ingress URL patterns below in the <mark style="color:yellow;">Server</mark> field.
   1. Non-TLS:
      * WebRTC Input URL Format: <mark style="color:$primary;">**`ws://`**</mark>`{Public IPv4 or Domain}:`<mark style="color:$primary;">**`80`**</mark>`/{app}/{stream}`<mark style="color:$primary;">**`?direction=send`**</mark>
      * WHIP URL Format: <mark style="color:$primary;">**`http://`**</mark>`{Public IPv4 or Domain}:`<mark style="color:$primary;">**`80`**</mark>`/{app}/{stream}`<mark style="color:$primary;">**`?direction=whip`**</mark>
   2. TLS:
      * WebRTC (TLS) Input URL Format: <mark style="color:$primary;">**`wss://`**</mark>`{Public IPv4 or Domain}:`<mark style="color:$primary;">**`443`**</mark>`/{app}/{stream}`<mark style="color:$primary;">**`?direction=send`**</mark>
      * WHIP (TLS) URL Format: <mark style="color:$primary;">**`https://`**</mark>`{Public IPv4 or Domain}:`<mark style="color:$primary;">**`443`**</mark>`/{app}/{stream}`<mark style="color:$primary;">**`?direction=whip`**</mark>

{% hint style="info" %}
If you are not sure about the WebRTC Input or WHIP URL pattern, create a \[Managed Stream] in the Web Console and check it under the <mark style="color:yellow;">\[URLs]</mark> tab.
{% endhint %}

<figure><img src="https://content.gitbook.com/content/xo7moYXTh3yBG01Dy49w/blobs/3b7AZS5g10RG6BdObhSX/image.png" alt=""><figcaption></figcaption></figure>

6. Next, in the <mark style="color:yellow;">\[Output]</mark> tab, we recommend setting the <mark style="color:$primary;">**`Keyframe Interval`**</mark> to <mark style="color:$primary;">**1-second**</mark> and <mark style="color:$primary;">**`B-frames`**</mark> to <mark style="color:$primary;">**0**</mark> for smooth sub-second latency and low-latency streaming.

{% hint style="success" %}
Setting <mark style="color:yellow;">B-frames</mark> to <mark style="color:yellow;">0</mark> (`bframes=0`) helps reduce playback stuttering in `WebRTC` output. The example above shows the configuration when using the `x264` encoder. Depending on the selected encoder, available options and layout may vary. When using `WebRTC` as the output, <mark style="color:yellow;">setting B-frames to 0 is recommended</mark>.
{% endhint %}

7. If needed, adjust additional settings in tabs such as \[Audio] and \[Video], then click <mark style="color:yellow;">\[OK]</mark> to return to the OBS main screen.
8. Finally, click <mark style="color:yellow;">\[Start Streaming]</mark> to begin publishing.
   {% endstep %}

{% step %}

### \[Option B] Publish using the OvenPlayer Demo <a href="#publish-using-the-ovenplayer-demo" id="publish-using-the-ovenplayer-demo"></a>

<figure><img src="https://content.gitbook.com/content/xo7moYXTh3yBG01Dy49w/blobs/BHBLEaheXD3PusMjz1oW/image.png" alt=""><figcaption></figcaption></figure>

1. For <mark style="color:yellow;">Non-TLS</mark>, open: [<mark style="color:yellow;">http://</mark>demo.ovenplayer.com/demo\_input.html](http://demo.ovenplayer.com/demo_input.html) or For <mark style="color:yellow;">TLS</mark>, open: [<mark style="color:yellow;">https://</mark>demo.ovenplayer.com/demo\_input.html](https://demo.ovenplayer.com/demo_input.html).
2. In the <mark style="color:yellow;">\[WebRTC Ingress URL]</mark> field, enter one of the WebRTC/WHIP Ingress URL patterns below, depending on whether you use Non-TLS or TLS.
   1. Non-TLS:
      * WebRTC Input URL Format: <mark style="color:$primary;">**`ws://`**</mark>`{Public IPv4 or Domain}:`<mark style="color:$primary;">**`80`**</mark>`/{app}/{stream}`<mark style="color:$primary;">**`?direction=send`**</mark>
      * WHIP URL Format: <mark style="color:$primary;">**`http://`**</mark>`{Public IPv4 or Domain}:`<mark style="color:$primary;">**`80`**</mark>`/{app}/{stream}`<mark style="color:$primary;">**`?direction=whip`**</mark>
   2. TLS:
      * WebRTC (TLS) Input URL Format: <mark style="color:$primary;">**`wss://`**</mark>`{Public IPv4 or Domain}:`<mark style="color:$primary;">**`443`**</mark>`/{app}/{stream}`<mark style="color:$primary;">**`?direction=send`**</mark>
      * WHIP (TLS) URL Format: <mark style="color:$primary;">**`https://`**</mark>`{Public IPv4 or Domain}:`<mark style="color:$primary;">**`443`**</mark>`/{app}/{stream}`<mark style="color:$primary;">**`?direction=whip`**</mark>
3. Click <mark style="color:yellow;">\[START]</mark> on the right to verify that publishing is working properly.

{% hint style="info" %}
If you are not sure about the WebRTC Input or WHIP URL pattern, create a \[Managed Stream] in the Web Console and check it under the <mark style="color:yellow;">\[URLs]</mark> tab.
{% endhint %}
{% endstep %}

{% step %}

### Check Stream Status and Playback in the Web Console <a href="#check-stream-status-and-playback-in-the-web-console" id="check-stream-status-and-playback-in-the-web-console"></a>

<figure><img src="https://content.gitbook.com/content/xo7moYXTh3yBG01Dy49w/blobs/i2LRrKVOCC9GYqv8oMrN/image.png" alt=""><figcaption></figcaption></figure>

* In the <mark style="color:yellow;">Web Console</mark>, check whether the stream published from OBS or the OvenPlayer Demo appears in the list.
  {% endstep %}
  {% endstepper %}
