MultiplexChannel

Using MultiplexChannel, you can combine multiple internal streams into one ABR stream, or duplicate the stream and send it to another application.

MultiplexChannel can be controlled by API or file. See below for more information about MultiplexChannel.

pageMultiplex Channel

The body of the API all has the same structure as the mux file.

Get Channel List

Get all multiplex channels in the {vhost name}/{app name} application.

Request

GET /v1/vhosts/{vhost}/apps/{app}/multiplexChannels

Header

Authorization: Basic {credentials}

# Authorization
    Credentials for HTTP Basic Authentication created with <AccessToken>

Responses

200 Ok

The request has succeeded

Header

Content-Type: application/json

Body

{
    "message": "OK",
    "response": [
        "stream"
    ],
    "statusCode": 200
}

# statusCode
	Same as HTTP Status Code
# message
	A human-readable description of the response code
# response
	Json array containing a list of stream names
401 Unauthorized

Authentication required

Header

WWW-Authenticate: Basic realm=”OvenMediaEngine”

Body

{
    "message": "[HTTP] Authorization header is required to call API (401)",
    "statusCode": 401
}
404 Not Found

The given vhost name or app name could not be found.

Header

Content-Type: application/json

Body

{
    "statusCode": 404,
    "message": "Could not find the application: [default/non-exists] (404)"
}

Create Channel

Create a multiplex channel.

Request

POST /v1/vhosts/{vhost}/apps/{app}/multiplexChannels

Header

Authorization: Basic {credentials}
Content-Type: application/json

# Authorization
    Credentials for HTTP Basic Authentication created with <AccessToken>

Body

{
  "outputStream": {
    "name": "stream"
  },
  "sourceStreams": [
    {
      "name": "input1",
      "url": "stream://default/app/input1",
      "trackMap": [
        {
          "sourceTrackName": "bypass_video",
          "newTrackName": "input1_video",
          "bitrateConf": 5000000,
          "framerateConf": 30
        },
        {
          "sourceTrackName": "bypass_audio",
          "newTrackName": "input1_audio",
          "bitrateConf": 128000
        }
      ]
    },
    {
      "name": "input2",
      "url": "stream://default/app/input2",
      "trackMap": [
        {
          "sourceTrackName": "bypass_video",
          "newTrackName": "input2_video",
          "bitrateConf": 1000000,
          "framerateConf": 30
        },
        {
          "sourceTrackName": "bypass_audio",
          "newTrackName": "input2_audio",
          "bitrateConf": 128000
        }
      ]
    }
  ],
  "playlists": [
    {
      "name": "LLHLS ABR",
      "fileName": "abr",
      "options": {
        "webrtcAutoAbr": true,
        "hlsChunklistPathDepth": 0
      },
      "renditions": [
        {
          "name": "input1",
          "video": "input1_video",
          "audio": "input1_audio"
        },
        {
          "name": "input2",
          "video": "input2_video",
          "audio": "input2_audio"
        }
      ]
    }
  ]
}

Responses

201 Created

A stream has been created.

Header

Content-Type: application/json

Body

{
    "message": "Created",
    "statusCode": 201
}

# statusCode
    Same as HTTP Status Code
# message
    A human-readable description of the response code
400 Bad Request

Invalid request. Body is not a Json Object or does not have a required value

401 Unauthorized

Authentication required

Header

WWW-Authenticate: Basic realm=”OvenMediaEngine”

Body

{
    "message": "[HTTP] Authorization header is required to call API (401)",
    "statusCode": 401
}
404 Not Found

The given vhost name or app name could not be found.

Body

{
    "statusCode": 404,
    "message": "Could not find the application: [default/non-exists] (404)"
}
409 Conflict

A stream with the same name already exists

502 Bad Gateway

Failed to pull provided URL

500 Internal Server Error

Unknown error

Get Channel Info

Get detailed information of multiplex channel. It also provides information about the currently playing program and item.

Request

GET /v1/vhosts/{vhost}/apps/{app}/multiplexChannels/{channel name}

Header

Authorization: Basic {credentials}

# Authorization
    Credentials for HTTP Basic Authentication created with <AccessToken>

Responses

200 Ok

The request has succeeded

Header

Content-Type: application/json

Body

{
    "message": "OK",
    "statusCode": 200,
    "response": {
        "state": "Pulling",
        "pullingMessage": "Multiplex Channel : #default#app/stream: Wait for stream input1",
        "outputStream": {
            "name": "stream"
        },
        "playlists": [
            {
                "fileName": "abr",
                "name": "LLHLS ABR",
                "options": {
                    "hlsChunklistPathDepth": 0,
                    "webrtcAutoAbr": true
                },
                "renditions": [
                    {
                        "audio": "input1_audio",
                        "name": "input1",
                        "video": "input1_video"
                    },
                    {
                        "audio": "input2_audio",
                        "name": "input2",
                        "video": "input2_video"
                    }
                ]
            }
        ],
        "sourceStreams": [
            {
                "name": "input1",
                "trackMap": [
                    {
                        "bitrateConf": 128000,
                        "newTrackName": "input1_audio",
                        "sourceTrackName": "bypass_audio"
                    },
                    {
                        "bitrateConf": 5000000,
                        "framerateConf": 30,
                        "newTrackName": "input1_video",
                        "sourceTrackName": "bypass_video"
                    }
                ],
                "url": "stream://default/app/input1"
            },
            {
                "name": "input2",
                "trackMap": [
                    {
                        "bitrateConf": 128000,
                        "newTrackName": "input2_audio",
                        "sourceTrackName": "bypass_audio"
                    },
                    {
                        "bitrateConf": 1000000,
                        "framerateConf": 30,
                        "newTrackName": "input2_video",
                        "sourceTrackName": "bypass_video"
                    }
                ],
                "url": "stream://default/app/input2"
            }
        ]
    }
}
401 Unauthorized

Authentication required

Header

WWW-Authenticate: Basic realm=”OvenMediaEngine”

Body

{
    "message": "[HTTP] Authorization header is required to call API (401)",
    "statusCode": 401
}
404 Not Found

The given vhost name or app name could not be found.

Header

Content-Type: application/json

Body

{
    "statusCode": 404,
    "message": "Could not find the application or stream (404)"
}

Delete Channel

Delete Multiplex Channel

Request

DELETE /v1/vhosts/{vhost}/apps/{app}/multiplexChannels/{channel name}

Header

Authorization: Basic {credentials}

# Authorization
    Credentials for HTTP Basic Authentication created with <AccessToken>

Responses

200 Ok

The request has succeeded

Header

Content-Type: application/json

Body

{
	"statusCode": 200,
	"message": "OK",
}


# statusCode
	Same as HTTP Status Code
# message
	A human-readable description of the response code
401 Unauthorized

Authentication required

Header

WWW-Authenticate: Basic realm=”OvenMediaEngine”

Body

{
    "message": "[HTTP] Authorization header is required to call API (401)",
    "statusCode": 401
}
404 Not Found

The given vhost name or app name could not be found.

Header

Content-Type: application/json

Body

{
    "message": "[HTTP] Could not find the stream: [default/#default#app/stream] (404)",
    "statusCode": 404
}