Slicer

The Slicer API contains the following endpoints:

Endpoint Description

Get Last Status

GET /api2/slicer/status

Retrieves the last known status information for one or more Live Slicers.

Get Slicing Schedule

GET /api2/slicer/schedule/get

Retrieves a Live Slicer's slicing schedule.

Update Slicing Schedule

GET /api2/slicer/schedule/update

Updates a Live Slicer's slicing schedule.

Get Last Status

Returns the last known status for one or more Live Slicers.

Request syntax:

/api2/slicer/status

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:

  • The Live Slicer has been shut down.
  • The Live Slicer is having trouble uploading data and communicating with the Uplynk system.

signal

String

Indicates the input signal type.

  • Blackmagic Capture Devices: Indicates the signal format reported by the card.

    Sample value:

    HD 1080i 60fps
  • UDP Transport Streams Reports the following information:

    TS multicast | unicastSource IP Address:PortResolution Width x Height
  • No Signal: Reports the following value when the signal is lost:

    No signal

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:

  • -1: No status found
  • 0: Capturing
  • 1: Ad break
  • 2: Replacing content
  • 3: Blackout

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
}

Get Slicing Schedule

Gets a Live Slicer's current slicing schedule.

Request syntax:

/api2/slicer/schedule/get

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
}

Update Slicing Schedule

Updates a Live Slicer's slicing schedule.

Request syntax:

/api2/slicer/schedule/update

Pass the following request parameters:

Request Parameter

Type

Description

schedule

Required

List

Contains schedule entries that will replace either:

  • All Schedule Entries: Replace the entire schedule by excluding the update_start and update_end parameters from the request.
  • Schedule Entries within a Time Period: Replace all entries within a specific time period by defining the update_start and update_end parameters.

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:

  • 0: The Live Slicer will trigger a scheduled start or stop action upon encountering the corresponding timecode within the video.
  • 1: The Live Slicer will trigger a scheduled start or stop action according to local system time.

    If our service detects your server's local time is off by more than 5 minutes, then we will use our server's system time instead.

Older versions (i.e., 21061600 or lower) of the Live Slicer always use the default behavior.

Default value: 

0

schedule List

schedule is a list of objects with the following attributes:

Attributes

Type

Description

break_type

Required

String

Valid values are:

  • blackout
  • content_start
  • pod_end
  • pod_start
  • replace_content
  • replace_pod

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.

Learn more (Live Slicer API - replace_content).

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
}