Create Clip (Quick)

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:

NameData TypeDescription
argsDictionaryIdentifies an asset and the clip's poster image.
sourceDictionaryContains 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:

NameData TypeDescription
trimListIdentifies 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:

NameData TypeDescription
beam_id RequiredStringIdentifies 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_tsInteger / StringIdentifies 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.

Learn more.

Response

The response for a successful request contains the following parameter.

NameData TypeDescription
jobDictionaryDescribes 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
}