Push

Start push publishing

POST http://<OME_HOST>:<API_PORT>/v1/vhosts/{vhost_name}/apps/{app_name}:startPush

Example - RTMP push publishing by Output Stream Name POST http[s]://{host}/v1/vhosts/default/apps/app:startPush { "id": "{unique_push_id}", "stream": { "name": "{output_stream_name}" }, "protocol": "rtmp", "url":"rtmp://{host}[:port]/{app_ame}", "streamKey":"{stream_name}" }

Example - MPEG TS push publishing by Output Stream Name POST http[s]://{host}/v1/vhosts/default/apps/app:startPush { "id": "{unique_push_id}", "stream": { "name": "{output_stream_name}" }, "protocol": "mpegts", "url":"udp://{host}[:port]", "streamKey":"" }

Example - Push publishing by Output Stream Name and Track Ids POST http[s]://{host}/v1/vhosts/default/apps/app:startPush { "id": "{unique_push_id}", "stream": { "name": "{output_stream_name}", "trackIds": [ 101, 102 ] }, "protocol": "rtmp", "url":"rtmp://{host}[:port]/{appName}", "streamKey":"{stream_name}" }

Example - Push publishing by Output Stream Name and Variant Names POST http[s]://{host}/v1/vhosts/default/apps/app:startPush { "id": "{unique_push_id}", "stream": { "name": "{output_stream_name}", "variantNames": [ "h264_fhd", "aac" ] }, "protocol": "rtmp", "url":"rtmp://{host}[:port]/{app_name}", "streamKey":"{stream_name}" }

* variantName means Application.OutputProfiles.OutputProfie.Encodes.[Video|Audio|Data].Name in the Server.xml configuration file.

Path Parameters

NameTypeDescription

vhost_name*

string

A name ofVirtualHost

app_name*

string

A name ofApplication

Headers

NameTypeDescription

authorization*

string

A string for authentication in Basic Base64(AccessToken) format.

For example, Basic b21lLWFjY2Vzcy10b2tlbg== if access token is ome-access-token

Request Body

NameTypeDescription

id*

string

Unique identifier of push publishing

stream*

string

Output stream for push.

name*

string

Output stream name

trackIds

array

Used for push publishing specific track ids.

protocol*

string

Transport protocol [rtmp | mpegts]

url*

string

Destination URL.

streamKey*

object

Destination stream key.

variantNames

array

Used for push publishing specific variant names.

{
  "message": "OK",
  "response": [
    {
      "app": "app",
      "createdTime": "2021-02-04T01:42:40.160+0900",
      "id": "userDefinedUniqueId",
      "protocol": "rtmp",
      "sentBytes": 0,
      "sentTime": 0,
      "sequence": 0,
      "startTime": "1970-01-01T09:00:00.000+0900",
      "state": "ready",
      "stream": {
        "name": "stream",
        "tracks": [
          101,
          102
        ]
      },
      "streamKey": "2u5w-rt7q-tepj-91qa-4yft",
      "totalsentBytes": 0,
      "totalsentTime": 0,
      "url": "rtmp://a.rtmp.youtube.com/live2",
      "vhost": "default"
    }
  ],
  "statusCode": 200
}

Stop push publishing

POST http://<OME_HOST>:<API_PORT>/v1/vhosts/{vhost_name}/apps/{app_name}:stopPush

Example POST http[s]://{host}/v1/vhosts/default/apps/app:stopRecord { "id": "{unique_push_id}" }

Path Parameters

NameTypeDescription

vhost_name*

string

A name ofVirtualHost

app_name*

string

A name ofApplication

Headers

NameTypeDescription

authorization*

string

A string for authentication in Basic Base64(AccessToken) format.

For example, Basic b21lLWFjY2Vzcy10b2tlbg== if access token is ome-access-token.

Request Body

NameTypeDescription

id*

string

Unique identifier of push publishing

    {
      "id": "userDefinedUniqueId",
      "app": "app",
      "createdTime": "2021-01-18T10:25:03.765+0900",
      "startTime": "2021-01-18T10:25:03.765+0900",
      "finishTime": "2021-01-18T10:35:03.765+0900",
      "protocol": "rtmp",
      "sentBytes": 32841631,
      "sentTime": 601,
      "sequence": 0,
      "state": "stopping",
      "stream": {
        "name": "stream",
        "tracks": [
          101,
          102
        ]
      },
      "streamKey": "2u5w-rt7q-tepj-91qa-4yft",
      "totalsentBytes": 32841631,
      "totalsentTime": 601000,
      "url": "rtmp://a.rtmp.youtube.com/live2",
      "vhost": "default"
    

Push publishing status

POST http://<OME_HOST>:<API_PORT>/v1/vhosts/{vhost_name}/apps/{app_name}:pushes

Example

POST http[s]://{host}/v1/vhosts/default/apps/app:pushes { "id": "{unique_push_id}" }

Path Parameters

NameTypeDescription

vhost_name*

string

A name of

VirtualHost

app_name*

string

A name of

Application

Headers

NameTypeDescription

authorization*

string

A string for authentication in

Basic Base64(AccessToken)

format.

\

For example,

Basic b21lLWFjY2Vzcy10b2tlbg==

if access token is

ome-access-token

.

Request Body

NameTypeDescription

id

string

Unique identifier of push publishing

{
	"statusCode": 200,
	"message": "OK",
	"response": [
    {
      "id": "UniqueId1",
      "app": "app",
      "createdTime": "2021-01-18T10:25:03.765+0900",
      "startTime": "1970-01-01T09:00:00.000+0900",
      "finishTime": "1970-01-01T09:00:00.000+0900",
      "protocol": "rtmp",
      "sentBytes": 0,
      "sentTime": 0,
      "sequence": 0,
      "state": "ready",
      "stream": {
        "name": "stream",
        "tracks": [
          101,
          102
        ]
      },
      "streamKey": "2u5w-rt7q-tepj-91qa-4yft",
      "totalsentBytes": 0,
      "totalsentTime": 0,
      "url": "rtmp://a.rtmp.youtube.com/live2",
      "vhost": "default"
    },
    {
      "id": "UniqueId2",
      "app": "app",
      "createdTime": "2021-01-18T10:26:15.968+0900",
      "startTime": "1970-01-01T09:00:00.000+0900",
      "finishTime": "1970-01-01T09:00:00.000+0900",
      "protocol": "rtmp",
      "sentBytes": 0,
      "sentTime": 0,
      "sequence": 0,
      "state": "ready",
      "stream": {
        "name": "strea2m",
        "tracks": [
          101,
          102
        ]
      },
      "streamKey": "2u5w-rt7q-tepj-91qa-4yft",
      "totalsentBytes": 0,
      "totalsentTime": 0,
      "url": "rtmp://a.rtmp.youtube.com/live2",
      "vhost": "default"
    }
	]
}

Last updated