Quickly create clips from your assets.
This endpoint has been optimized for speed and therefore you cannot apply effects (e.g., fading, bumpers, modify alternate audio tracks, etc.) to clips generated by it.
Request
Request syntax:
/jobs/quickclip
Request parameters:
Pass the following parameters through the msg parameter:
Name | Data Type | Description |
---|---|---|
args | Dictionary | Identifies an asset and the clip's poster image. |
source | Dictionary | Contains the clip's start offset and duration. |
source Dictionary
The source dictionary identifies the start offset and the duration of the clip via the following property:
Name | Data Type | Description |
---|---|---|
trim | List | Identifies the clip's start offset (milliseconds) and duration (milliseconds) using the following syntax: source={"trim":[Start Offset,Duration]} Example: source={"trim":[3000,15000]} |
args Dictionary
The args dictionary identifies the asset and the clip's poster image via the following properties:
Name | Data Type | Description |
---|---|---|
beam_id Required | String | Identifies the asset ID for the asset from which a clip will be generated. ClosedWhere can I find an asset ID? 1. Navigate to the CMS library by clicking the Content tab. 2. Select the desired asset. 3. The asset ID corresponding to the asset selected in the previous step is listed under the GUID label. |
poster_ts | Integer / String | Identifies the frame from which a poster image will generated. Integer: Specify the number of milliseconds from the start of the asset. String: Specify a timestamp using either of the following formats: hh:mm:ss.ms ss.ms |
Authentication
Pass a digital signature based off of msg.
Response
The response for a successful request contains the following parameter.
Name | Data Type | Description |
---|---|---|
job | Dictionary | Describes a Cloud Slicer job. |
Once a clip has been successfully created, use the Get Cloud Slicer Job endpoint to find out the clip's asset ID.
Sample Request/Response
A sample request/response is provided below. 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/cloudslicer/jobs/quickclip', source={"trim":[3000,15000]}, args={"beam_id":"3adca3eeeb7c4f46ad2e0988079816de"}))
{
'job':
{
'state': 'waiting',
'last_error': '',
'args': {},
'attempts': 0,
'source': {'trim': [3000, 15000], 'url': 'https://content.uplynk.com/3adca3eeeb7c4f46ad2e0988079816de.m3u8'},
'finished': 0,
'asset': None,
'last_start': 0,
'owner': 'eeef81067eee479aaa6e837cb97cf6d9',
'progress': '',
'id': 'd3345dbe5e064d09a20b762f7618839e'
},
'error': 0
}
Call('/api2/cloudslicer/jobs/get', id='d3345dbe5e064d09a20b762f7618839e')
{
'job':
{
'state': 'done',
'last_error': '',
'args': {},
'attempts': 1,
'source': {'trim': [3000, 15000], 'url': 'https://content.uplynk.com/3adca3eeeb7c4f46ad2e0988079816de.m3u8'},
'finished': 1447368234226,
'asset': 'e30ed0b8eee447c7b53c1c441ceecb3f',
'last_start': 1447366087113,
'owner': 'eeef81067eee479aaa6e837cb97cf6d9',
'progress': 'Finished successfully',
'id': 'd3345dbe5e064d09a20b762f7618839e'
},
'error': 0
}