The Slicer API contains the following endpoints:
Endpoint | Description |
---|---|
GET /api2/slicer/status
|
Retrieves the last known status information for one or more Live Slicers. |
GET /api2/slicer/schedule/get
|
Retrieves a Live Slicer's slicing schedule. |
GET /api2/slicer/schedule/update
|
Updates a Live Slicer's slicing schedule. |
Live Slicer API
Consider using the Live Slicer API when you need to control the behavior of your stream (e.g., mark ads, replacement content, or content boundaries), set metadata on an asset, or retrieve detailed Live Slicer status information.
Slicer API
Consider using the Slicer API when you need to find out the last known status information for one or more Live Slicers or retrieve/update a slicing scheduling.
Returns the last known status for one or more Live Slicers.
Request syntax:
Pass the following request parameters:
Request Parameter |
Type |
Description |
---|---|---|
slicer_ids Required |
list |
Identifies one or more Live Slicers by their slicer IDs. |
The response for a successful request contain the following parameters.
Response Parameter |
Type |
Description |
---|---|---|
slicers |
List |
Contains the set of Live Slicers identified by the slicer_ids parameter. |
cc_last_seen |
Object |
Indicates the time at which the Live Slicer received the most recent caption for each channel. The Live Slicer updates these timestamps every ten seconds. Syntax: "Channel Number":Unix Time
This parameter will report a null value until a caption is detected. |
dropped |
Integer |
Indicates the number of frames that have been dropped for the current beam. Prior to Live Slicer version 19022000, this metric reported the number of dropped frames since the Live Slicer was started. Dropped frames are indicative that the Live Slicer is experiencing severe egress bandwidth problems or insufficient system resources (CPU/memory). |
id |
String |
Indicates the Live Slicer's ID as defined in the Live Slicer configuration file. |
lastmod |
Integer |
Indicates when a Live Slicer's status was last updated in Unix time. |
luma |
Integer |
Indicates the average luminosity percentage for the last few seconds of video. This percentage will only be returned when the Live Slicer has reported a luma value. |
outdated |
Integer |
A value of 1 indicates that either:
|
signal |
String |
Indicates the input signal type.
|
source_queue_depth |
Integer |
Requires Live Slicer version 15080600 or higher Indicates the number of packets waiting to be read by the Live Slicer. |
source_queue_max_depth |
Integer |
Requires Live Slicer version 15080600 or higher Indicates the maximum number of packets waiting to be read by the Live Slicer since it started running. |
state |
Integer |
Valid values are:
|
state_str |
String |
Indicates the Live Slicer's state. |
version |
String |
Indicates the Live Slicer's version number. |
vol |
Integer |
Indicates the average loudness percentage for the last few seconds of audio. This percentage will only be returned when the Live Slicer has reported a volume value. |
waiting |
Integer |
Requires Live Slicer version 15071501 or higher Indicates the number of slices waiting to be uploaded. |
Sample request/response:
The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.
from uplynk_api2_auth import Call print(Call('/api2/slicer/status', slicer_ids=['my_slicer_1', 'my_slicer_2'])) { "slicers": [ { "state_str": "No status found", "lastmod": -1, "outdated": 1, "state": -1, "id": "my_slicer_2" }, { "state_str": "capture", "lastmod": 1367520728, "outdated": 0, "state": 0, "id": "my_slicer_1", "signal": "HD 1080i 60fps", "luma": 20, "vol": 30, "version": 15061800, "dropped": 0, "cc_last_seen": {"0": 1367520728} } ], "error": 0 }
Gets a Live Slicer's current slicing schedule.
Request syntax:
Pass the following request parameters:
Request Parameter |
Type |
Description |
---|---|---|
slicer_id Required |
String |
Identifies the desired Live Slicer by its ID. |
Sample request/response:
The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.
from uplynk_api2_auth import Call print(Call('/api2/slicer/schedule/get', slicer_id='slicer123')) { "schedule": [{ "date": "2019-03-13", "timecode": "11:22:33;04", "break_type": "replace_pod", "duration": 61.3 } ], "error": 0 }
Updates a Live Slicer's slicing schedule.
Request syntax:
Pass the following request parameters:
Request Parameter |
Type |
Description |
---|---|---|
schedule Required |
List |
Contains schedule entries that will replace either:
|
slicer_id Required |
String |
Identifies the desired Live Slicer by its ID. |
update_end |
String |
Identifies a frame accurate position by date and time. Only schedule entries that start before this position may be replaced. The time zone for this parameter is defined by the utc_offset parameter. Syntax: yyyy-mm-dd hh:mm:ss;ff
|
update_start |
String |
Identifies a frame accurate position by date and time. Only schedule entries that start after this position may be replaced. The time zone for this parameter is defined by the utc_offset parameter. Syntax: yyyy-mm-dd hh:mm:ss;ff
|
utc_offset Required |
Integer |
Identifies the UTC offset for dates and times defined within this schedule. Syntax: ±Offset
Example: -8
|
wallclock |
Integer |
Requires Slicer version 21070801 or higher Determines how the Live Slicer tracks time when interpreting the start_timecode parameter. Valid values are:
Older versions (i.e., 21061600 or lower) of the Live Slicer always use the default behavior. Default value: 0
|
schedule is a list of objects with the following attributes:
Attributes |
Type |
Description |
---|---|---|
break_type Required |
String |
Valid values are:
|
date Required |
String |
Identifies the date for the timecode parameter. The time zone for this parameter is defined by the utc_offset parameter. Syntax: yyyy-mm-dd
|
duration |
Float |
Required for replace_pod and replace_content Identifies the duration, in seconds, for the replacement operation. |
external_id |
String |
content_start Only Assigns an external ID to a new asset. |
meta |
Object |
content_start Only Assigns metadata to a new asset. |
replacements |
List |
Required for replace_content A list of replacement content to be substituted. |
timecode Required |
String |
Identifies a timecode that finds the frame accurate position for the schedule entry. hh:mm:ss;ff
|
title |
String |
Required for content_start Sets the title/description for the new asset. |
Sample request/response (start_time):
The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.
from uplynk_api2_auth import Call print(Call('/api2/slicer/schedule/update', slicer_id='slicer123', utc_offset=-8, schedule=[{"date":"2019-03-13", "timecode":"11:22:33;04", "break_type":"content_start", "title":"The Show II", "external_id":"ts2", "meta":{"episode":38}}])) { "schedule": [{ "date": "2019-03-13", "timecode": "11:22:33;04", "break_type": "content_start", "title": "The Show II", "external_id": "ts2", "meta": { "episode": 38 } } ], "error": 0 }
Sample request/response (replace_pod):
The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.
from uplynk_api2_auth import Call print(Call('/api2/slicer/schedule/update', slicer_id='slicer123', utc_offset=-8, schedule=[{"date":"2019-03-13", "timecode":"11:22:33;04", "break_type":"replace_pod", "duration":61.3}])) { "schedule": [{ "date": "2019-03-13", "timecode": "11:22:33;04", "break_type": "replace_pod", "duration": 61.3 } ], "error": 0 }