Push Publishing

OvenMediaEngine Enterprise는 Live Stream을 다른 System으로 Re-streaming할 수 있는 Push Publishing 기능을 제공합니다. 지원 Protocol은 널리 사용되는 SRT, RTMP, MPEG-2 TS입니다.

OvenMediaEngine의 StreamMap 기능을 활용하여 사전 정의된 조건에 따라 Re-streaming을 자동으로 수행할 수 있습니다. 또한, REST API을 통한 Controling 및 Monitoring을 지원합니다.

Push Publishing 설정하기

Push Publisher

Push Publishing을 사용하려면 Server.xml<Applications><Publishers>에서 <Push>를 설정해야합니다.

<Applications>
  <Application>
     ...
    <Publishers>
      ... 
      <Push>
         <!-- [Optional] -->
         <StreamMap>
           <Enable>false</Enable>
           <Path>path/to/map.xml</Path>
         </StreamMap>
      </Push>
      ...
    </Publishers>
  </Application>
</Applications>

RTMP Protocol은 H264 (Video Codec)와 AAC (Audio Codec)만 지원합니다.

StreamMap

<StreamMap>은 사용자 정의 조건에 따라 콘텐츠를 자동으로 Push Publishing하기 위해 사용합니다. XML File Path는 <ApplicationPath>/conf를 기준으로 한 상대 경로를 지정해야 합니다.

XML Elements

Element
Requirement
Description

<StreamName>

Required

Output Stream을 매칭하는 데 사용합니다.

  • Wildcard characters (*)를 지원합니다.

<VariantNames>

Required

특정 Track을 선택할 때 사용합니다. <VariantNames>를 지정하지 않으면 기본적으로 모든 Track이 전송됩니다.

  • 여러 Variant는 콤마(,)로 구분하여 지정할 수 있습니다.

<Protocol>

Required

지원 Protocol은 srt, mpegts, rtmp입니다.

  • SRT 또는 MPEG-TS 전송 시, Network 및 환경(예: Firewall, Port, Packet Loss 등)을 고려해야 합니다.

  • RTMP 전송 시, H.264 + AAC 사용을 권장합니다.

<Url>

Required

Destination Address를 지정합니다.

  • Macro를 지원합니다.

<StreamKey>

Optional

필요 시 Stream Key를 지정합니다 (RTMP).

  • Macro를 지원합니다.

<TimestampMode>

Optional

(Enterprise Only)

Outgoing Packet의 Timestamp Mode를 설정합니다.

  • ZeroBased: 전송 시작 시점부터 Timestamp를 0으로 설정하여 전달합니다.

  • Original (default): 원본 Stream과 동일한 Timestamp를 전달합니다.

Macros

자동화 및 운영 효율 향상을 위해 Macro 활용을 권장합니다.

Macro
Description

${Application}

Application name

${SourceStream}

Source stream name

${Stream}

Output stream name

API Interface

Push Publishing 시작하기

Request

POST /v1/vhosts/{vhost}/apps/{app}:startPush

Header

Body : SRT

In SRT Push Publisher, only the caller connection mode is supported.

Body : RTMP

Body : MPEG2-TS

Responses

200 Ok

The request has succeeded

Header

Body

Please note that responses are incorrectly returned in Json array format for version 0.15.3 and earlier.

400 Bad Request

Invalid request.

401 Unauthorized

Authentication required

Header

Body

404 Not Found

The given vhost or application name could not be found.

Body

409 Conflict

duplicate ID

Parameter
Requirement
Description

id

Required

Push Publishing Task를 식별하기 위한 고유 ID 문자열입니다.

  • ID 중복은 허용되지 않습니다.

stream

Required

Output Target Stream Information Object입니다.

stream.name

Required

Output Stream의 Name입니다.

  • 예시: "myStreamOut".

stream.variantNames

Optional

전송할 Track (Variant) Name 목록입니다.

  • variantNames를 생략하거나 지정하지 않으면, 모든 Track이 전송되거나, RTMP의 경우 첫번째 Video Track과 Audio Track이 선택됩니다.

protocol

Required

Push Publishing에 사용할 Protocol입니다.

  • 예시: "srt", "mpegts", "rtmp".

url

Required

Destination URL입니다.

  • Protocol별로 형식이 다르며 Query String 옵션을 사용할 수 있습니다.

streamKey

Optional

RTMP 전송 시 필요한Stream Key입니다.

  • MPEG-TS 전송 시, 생략할 수 있습니다.

timestampMode

Optional

(Enterprise Only)

Outgoing Packet의 Timestamp Mode를 설정합니다.

  • ZeroBased: 전송 시작 시점부터 Timestamp를 0으로 설정하여 전달합니다.

  • Original (default): 원본 Stream과 동일한 Timestamp를 전달합니다.

Push Publishing 중지하기

Request

POST /v1/vhosts/{vhost}/apps/{app}:stopPush

Header

Body

Responses

200 Ok

The request has succeeded

Header

Body

400 Bad Request

Invalid request.

401 Unauthorized

Authentication required

Header

Body

404 Not Found

The given vhost/application name or id of recording task could not be found.

Body

Push Publishing 상태 조회하기

Request

POST /v1/vhosts/{vhost}/apps/{app}:pushes

Header

Body

Responses

200 Ok

The request has succeeded

Header

Body

The response is Json array format.

401 Unauthorized

Authentication required

Header

Body

404 Not Found

The given vhost or application name could not be found.

Body

Push Publishing 상태 목록

State
Description

ready

Waiting for the stream to be created.

connecting

Connecting to destination

pushing

Connected and streaming

stopping

Disconnection / stop in progress

stopped

Push is disconnected / stopped

error

Push encountered an error

Last updated

Was this helpful?