# Publish via RTMP/E-RTMP

`RTMP`는 Live Encoder와 Service 간 송출에서 **가장 널리 사용되는 Protocol** 중 하나로, OBS Studio 같은 범용 Encoder와의 호환성이 뛰어나 빠르게 송출을 시작하기에 적합합니다. 나아가, E-RTMP (Enhanced RTMP)를 사용하면 인증/보안 등 운영 환경에 필요한 확장 옵션을 통해 보다 통제된 방식으로 송출을 구성할 수 있습니다.

본 Guide에서는 `RTMP`/`ERTMP`로 Stream을 Publish하는 절차와, 송출 이후 기본 재생 및 상태 확인 방법을 순서대로 안내합니다.

<table><thead><tr><th width="151">Item</th><th>Supported</th></tr></thead><tbody><tr><td>Container</td><td>FLV</td></tr><tr><td>Transport</td><td>TCP</td></tr><tr><td>Codec</td><td>H.264, AAC / H.265 (E-RTMP only)</td></tr></tbody></table>

## Start Publishing an RTMP/E-RTMP Stream <a href="#start-publishing-an-rtmp-e-rtmp-stream" id="start-publishing-an-rtmp-e-rtmp-stream"></a>

본 예제에서는 가장 보편적으로 사용되는 Live Encoder Software인 OBS Studio를 사용했습니다.

{% stepper %}
{% step %}

### Publish with a Live Encoder (OBS Studio) <a href="#publish-with-a-live-encoder" id="publish-with-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.
   {% endstep %}

{% step %}

### Configure Streaming in OBS <a href="#configure-streaming-in-obs" id="configure-streaming-in-obs"></a>

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

4. On the left side of the Settings window, select the <mark style="color:yellow;">\[Stream]</mark> tab.
5. Under <mark style="color:yellow;">\[Service]</mark>, select <mark style="color:$primary;">**\[Custom]**</mark>, then enter the SRT Ingress URL in the <mark style="color:yellow;">Server</mark> field.
   * Ingress URL Format: <mark style="color:$primary;">**`rtmp://`**</mark>`{Public IPv4 or Domain}:`<mark style="color:$primary;">**`1935`**</mark>`/{app}/{stream}`

{% hint style="info" %}
If you are not sure about the RTMP or E-RTMP Input 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>
{% endstep %}

{% step %}
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.

* When using Enhanced RTMP (E-RTMP), set the video encoder to <mark style="color:$primary;">`H.265 (HEVC)`</mark>.

{% 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. Adjust additional settings as needed in \[Audio], \[Video], and other tabs, then click <mark style="color:yellow;">\[OK]</mark> to return to the main OBS window.
8. When all settings are ready, click <mark style="color:yellow;">\[Start Streaming]</mark> to begin publishing.
   {% 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/FKDk8q4LieQrXog8ELT8/image.png" alt=""><figcaption></figcaption></figure>

9. 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 %}
