OvenMediaEngine
0.18.0
0.18.0
  • Introduction
  • Quick Start
    • Online Demo
  • Getting Started
    • Getting Started with Docker
    • Getting Started with OME Docker Launcher
  • Configuration
    • TLS Encryption
    • IPv6
  • Live Source
    • RTMP
    • WebRTC / WHIP
    • SRT
    • MPEG-2 TS
    • RTSP Pull
    • Scheduled Channel
    • Multiplex Channel
  • ABR and Transcoding
    • Transcoding
    • ABR
    • TranscodeWebhook
    • GPU Acceleration
  • Streaming
    • WebRTC Streaming
    • Low-Latency HLS
    • HLS
    • SRT
  • CrossDomains
  • Access Control
    • SignedPolicy
    • AdmissionWebhooks
  • Clustering
  • Thumbnail
  • Recording
  • Push Publishing
  • REST API
    • v1
      • VirtualHost
        • Reload Certificate
        • Application
          • Output Profile
          • Record
          • Push
          • Stream
            • Send Event
            • HLS Dump
            • Conclude HLS Live
          • ScheduledChannel
          • MultiplexChannel
      • Statistics
        • Current
  • Alert
  • Performance Tuning
  • Logs and Statistics
  • Troubleshooting
  • P2P Delivery (Experiment)
Powered by GitBook
On this page
  • Get Channel List
  • Create Channel
  • Patch Schedule
  • Get Channel Info
  • Delete Channel

Was this helpful?

Export as PDF
  1. REST API
  2. v1
  3. VirtualHost
  4. Application

ScheduledChannel

Was this helpful?

ScheduledChannel allows you to create a live channel by scheduling pre-recorded files has been added to OvenMediaEngine. Other services or software call this Pre-recorded Live or File Live, but OvenMediaEngine plans to expand the function to organize live channels as a source, so we named it Scheduled Channel.

ScheduledChannel can be controlled by API or file. For more information about ScheduledChannel, see below.

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

Get Channel List

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

Request

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

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 Scheduled channel.

Request

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

Header

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

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

Body

{
    "stream": {
        "name": "stream2",
        "bypassTranscoder": false,
        "videoTrack": true,
        "audioTrack": true,
        "audioMap": [ // Optional
            {
                "name": "english",
                "language": "en",
                "characteristics": "1"
            },
            {
                "name": "Korean",
                "language": "ko",
                "characteristics": "2"
            },
            {
                "name": "Japanese",
                "language": "ja",
                "characteristics": "3"
            }
        ]
    },
    "fallbackProgram": {
        "items": [
            {
                "url": "file://video/sample.mp4",
                "start": 0,
                "duration": 60000
            }
        ]
    },
    "programs": [
        {
            "name": "1",
            "scheduled": "2023-11-13T20:57:00.000+09",
            "repeat": true,
            "items": [
                {
                    "url": "file://video/sample.mp4",
                    "start": 0,
                    "duration": 60000
                },
                {
                    "url": "file://video/1.mp4",
                    "start": 0,
                    "duration": 60000
                }
            ]
        },
        {
            "name": "2",
            "scheduled": "2023-11-14T20:57:00.000+09",
            "repeat": true,
            "items": [
                {
                    "url": "file://1.mp4",
                    "start": 0,
                    "duration": 60000
                },
                {
                    "url": "file://sample.mp4",
                    "start": 0,
                    "duration": 60000
                }
            ]
        }
    ]
}

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

Patch Schedule

Update the schedule. <Stream> cannot be PATCHed.

Request

PATCH /v1/vhosts/{vhost}/apps/{app}/scheduledChannels/{channel name}

Header

Authorization: Basic {credentials}

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

Body

Write the value you want to modify. However, name and outputProfiles cannot be modified.

{
    "fallbackProgram": {
        "items": [
            {
                "url": "file://video/sample.mp4",
                "start": 5000,
                "duration": 30000
            }
        ]
    },
    "programs": [
        {
            "name": "1",
            "scheduled": "2023-11-10T20:57:00.000+09",
            "repeat": true,
            "items": [
                {
                    "url": "file://video/1.mp4",
                    "start": 0,
                    "duration": 60000
                }
            ]
        },
        {
            "name": "2",
            "scheduled": "2023-11-20T20:57:00.000+09",
            "repeat": true,
            "items": [
                {
                    "url": "file://video/1.mp4",
                    "start": 0,
                    "duration": 60000
                },
                {
                    "url": "file://video/sample.mp4",
                    "start": 0,
                    "duration": 60000
                }
            ]
        }
    ]
}

Responses

200 Ok

The request has succeeded

Header

Content-Type: application/json

Body

{
    "message": "Created",
    "statusCode": 201
}
400 Bad Request

Invalid request.

{
    "message": "[HTTP] Cannot change [name] using this API (400)",
    "statusCode": 400
}
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 application name could not be found.

Body

{
    "message": "[HTTP] Could not find the application: [default/app2] (404)",
    "statusCode": 404
}

Get Channel Info

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

Request

GET /v1/vhosts/{vhost}/apps/{app}/scheduledChannels/{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",
    "response": {
        "currentProgram": {
            "currentItem": {
                "currentPosition": 1700,
                "duration": 60000,
                "start": 0,
                "url": "file://video/1.mp4"
            },
            "duration": -1,
            "end": "2262-04-12T08:47:16.854+09:00",
            "name": "2",
            "repeat": true,
            "scheduled": "2023-11-20T20:57:00.000+09:00",
            "state": "onair"
        },
        "fallbackProgram": {
            "items": [
                {
                    "duration": -1,
                    "start": 0,
                    "url": "file://hevc.mov"
                },
                {
                    "duration": -1,
                    "start": 0,
                    "url": "file://avc.mov"
                }
            ],
            "name": "fallback",
            "repeat": true,
            "scheduled": "1970-01-01T00:00:00Z"
        },
        "programs": [
            {
                "name": "2",
                "repeat": true,
                "scheduled": "2023-11-20T20:57:00.000+09"
            }
        ],
        "stream": {
            "audioTrack": true,
            "bypassTranscoder": false,
            "name": "stream",
            "videoTrack": true
        }
    },
    "statusCode": 200
}
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 Scheduled Channel

Request

DELETE /v1/vhosts/{vhost}/apps/{app}/scheduledChannels/{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
}
Scheduled Channel