Customer Sign In

upLynk

Integration APIs: Slicer

Overview

The slicer APIs are for manipulating and querying information on live slicers in your upLynk account.

/api2/slicer/status

Returns the last known status of one or more slicers.

Request parameters
slicer_idslist(Required) List of slicer IDs to query
Response parameters
slicerslistAn unordered list of objects with information about each slicer queried. Each contains:
  idstringThe slicer's ID.
  stateintOne of: -1 (not found), 0 (capturing), 1 (in ad break), 2 (replacing content), or 3 (in blackout).
  state_strstringHuman-readable version of state.
  lastmodintTimestamp of when the status was last updated, in seconds since the epoch.
  outdatedint1 if the system believes this status is too old to be trusted. Unless the slicer has been shut down, this usually indicates that the slicer is having trouble uploading data and communicating with the Uplynk backend.
  versionstringThe slicer's current version as reported by the slicer itself.
  signalstringIf the slicer is reporting an input signal type, it will be included in the response. For BlackMagic capture devices, this will be the signal format reported by the card (e.g. HD 1080i 60fps). For UDP Transport streams, it will include the source IP address, port, and resolution. In both cases, if the signal is lost, "No signal" will be returned.
  lumaintThe average luminosity of the last few seconds of video, expressed as a percentage. This will only be returned if the slicer has reported a luma value.
  volintThe average loudness of the last few seconds of audio, expressed as a percentage. This will only be returned if the slicer has reported a value for volume.
  droppedintThe number of frames the slicer has dropped since it started. Dropped frames are usually an indication that the slicer is experiencing severe egress bandwidth problems, or insufficient system resources (CPU/memory).
  waitingintThe number of slices waiting to be uploaded. (Requires Slicer version 15071501 or newer)
  source_queue_depthintThe number of packets waiting to be read by the Slicer. (Requires Slicer version 15080600 or newer)
  source_queue_max_depthintThe maximum number of packets waiting to be read by the Slicer since the Slicer began running. (Requires Slicer version 15080600 or newer)
  cc_last_seenobjectA map of {"<channel number>":<timestamp when last observed>}. The slicer only updates these timestamps every ten seconds.
Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Call('/api2/slicer/status', slicer_ids=['my_slicer_1', 'bogus_slicer'])

{
    "slicers": [
        {
            "state_str": "No status found",
            "lastmod": -1,
            "outdated": 1,
            "state": -1,
            "id": "bogus_slicer"
        },
        {
            "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
}

/api2/slicer/schedule/get

Gets the current Slicing Schedule for a slicer.

Request parameters
slicer_idstring(Required) The ID of the slicer for which the schedule should be retrieved.
Example
1
2
3
4
5
6
7
Call('/api2/slicer/schedule/get', slicer_id='slicer123')

{
    "schedule": [{"date":"2013-03-13", "timecode":"11:22:33:44", "break_type":"replace_pod", "duration":61.3"}],
    "error": 0
}
                

/api2/slicer/schedule/update

Updates the Slicing Schedule for a slicer.

Request parameters
slicer_idstring(Required) The ID of the slicer to update.
utc_offsetint(Required) The UTC offset used for dates and timecodes in this schedule.
update_startstring(Optional) Timecode and date (yyyy-mm-dd hh:mm:ss;ff) in the timezone specified by the utc_offset parameter. If supplied, only entries with a date and timecode after this time are replaced.
update_endstring(Optional) Timecode and date (yyyy-mm-dd hh:mm:ss;ff) in the timezone specified by the utc_offset parameter. If supplied, only entries with a date and timecode before this time are replaced.
schedulelist(Required) A list of schedule entries. This schedule will replace any existing schedule entires for this slicer that occur between update_start and update_end. If update_start and update_end are not given, all entries are replaced with the new schedule.

schedule is a list of objects with the following attributes:

Slicing schedule entry format
date string (Requred) yyyy-mm-dd format. The date (in the timezone indicated by the utc_offset parameter) during which timecode applies.
timecode string (Requred) hh:mm:ss;ff timecode value. This timecode is used to find the frame accurate position for the schedule entry.
break_type string (Required) One of: content_start, replace_pod, pod_start, pod_end, replace_content, blackout.
title string (Required for content_start) Title/description of new asset.
external_id string (Optional. Used by content_start). External ID to assign to new asset.
meta object (Optional. Used by content_start). Metadata to assign to new asset.
duration float (Required for replace_pod and replace_content). Duration, in seconds, of replacement operation.
replacements list (Required for replace_content). A list of replacement content to be substituted. See the Live Slicer API documentation for replace_content for details.
start_time Example
1
2
3
4
5
6
Call('/api2/slicer/schedule/update', slicer_id='slicer123', utc_offset=-8, schedule=[{"date":"2013-03-13", "timecode":"11:22:33:44", "break_type":"content_start", "title":"Some Show II", "external_id":"ss2", "meta":{"episode":38}}])

{
    "schedule": [{"date":"2013-03-13", "timecode":"11:22:33:44", "break_type":"content_start", "title":"Some Show II", "external_id":"ss2", "meta":{"episode":38}}],
    "error": 0
}
replace_pod Example
1
2
3
4
5
6
Call('/api2/slicer/schedule/update', slicer_id='slicer123', utc_offset=-8, schedule=[{"date":"2013-03-13", "timecode":"11:22:33:44", "break_type":"replace_pod", "duration":61.3"}])

{
    "schedule": [{"date":"2013-03-13", "timecode":"11:22:33:44", "break_type":"replace_pod", "duration":61.3"}],
    "error": 0
}