Stream
Get Stream List
Get all stream names in the {vhost name}/{app name} application.
Request
GET /v1/vhosts/{vhost}/apps/{app}/streams
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",
"response": [
"stream",
"stream2"
]
}
# 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 Stream (Pull)
Create a stream by pulling an external URL. External URL protocols currently support RTSP and OVT.
Request
POST /v1/vhosts/{vhost}/apps/{app}/streams
Header
Authorization: Basic {credentials}
Content-Type: application/json
# Authorization
Credentials for HTTP Basic Authentication created with <AccessToken>
Body
{
"name": "new_stream_name",
"urls": [
"rtsp://192.168.0.160:553/app/stream",
"url to pull the stream from - support OVT/RTSP",
"Only urls with the same scheme can be sent as a group."
],
"properties":{
"persistent": false,
"noInputFailoverTimeoutMs": 3000,
"unusedStreamDeletionTimeoutMs": 60000,
}
}
# name (required)
Stream name to create
# urls (required)
A list of URLs to pull streams from, in Json array format.
All URLs must have the same scheme.
# properties (optional)
## persistent
Created as a persistent stream, not deleted until DELETE
## noInputFailoverTimeoutMs
If no data is input during this period, the stream is deleted,
but ignored if persistent is true
## unusedStreamDeletionTimeoutMs
If no data is output during this period (if there is no viewer),
the stream is deleted, but ignored if persistent is true
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
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)"
}
Get Stream Info
Get detailed information of stream.
Request
GET /v1/vhosts/{vhost}/apps/{app}/streams/{stream}
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",
"response": {
"input": {
"createdTime": "2021-01-11T03:45:21.879+09:00",
"sourceType": "Rtmp",
"tracks": [
{
"id": 0,
"type": "Video",
"video": {
"bitrate": "2500000",
"bypass": false,
"codec": "H264",
"framerate": 30.0,
"hasBframes": false,
"keyFrameInterval": 30,
"height": 720,
"width": 1280
}
},
{
"id": 1,
"audio": {
"bitrate": "128000",
"bypass": false,
"channel": 2,
"codec": "AAC",
"samplerate": 48000
},
"type": "Audio"
}
]
},
"name": "stream",
"outputs": [
{
"name": "stream",
"tracks": [
{
"id": 0,
"type": "Video",
"video": {
"bypass": true
}
},
{
"id": 1,
"audio": {
"bypass": true
},
"type": "Audio"
},
{
"id": 2,
"audio": {
"bitrate": "128000",
"bypass": false,
"channel": 2,
"codec": "OPUS",
"samplerate": 48000
},
"type": "Audio"
}
]
}
]
}
}
# statusCode
Same as HTTP Status Code
# message
A human-readable description of the response code
# response
Details of the stream
keyFrameInterval is GOP size
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 Stream
Delete Stream. This terminates the ingress connection.
The sender can reconnect after the connection is terminated. To prevent reconnection, you must use AccessControl.
Request
DELETE /v1/vhosts/{vhost}/apps/{app}/streams/{stream}
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