Use the Cloud Slicer to slice and encode content within our cloud infrastructure. This solution provides an alternative to running a slicer on a local machine.
Each request to our Cloud Slicer service creates a job. This job is placed into a queue until a Cloud Slicer is available to work on it. At which point, the assigned Cloud Slicer downloads the media and then slices it for encoding.
Considerations when using the Cloud Slicer:
Automate the Cloud Slicer via the Cloud Slicer API. It supports the following endpoints:
Category | Endpoints |
---|---|
Alternative Audio Track |
Adds an alternative audio track to an asset. /jobs/add_track_audio
|
Cloud Slicer Jobs |
Deletes queued and completed Cloud Slicer jobs. /jobs/delete
Retrieves the details of an existing Cloud Slicer job. /jobs/get
Get Multiple Cloud Slicer Jobs Retrieves a list of recent Cloud Slicer jobs. /jobs/list
|
Creating Assets |
Creates an asset from your media. /jobs/create
|
Copying and Exporting Assets |
Copies an asset from a shared library. /jobs/copy-from-library
Copies one or more asset(s) from a shared library. /batch/copy-from-library
Retrieves the results for a copy request. /batch/get-job-states
Exports an asset. /jobs/create_export
|
Video Clips |
Creates a clip from an existing CMS asset. /jobs/quickclip
|
WebVTT Tracks |
Adds a WebVTT track to an asset. /jobs/add_track_vtt
Replaces an asset's subtitle track. /jobs/replace_track_vtt
|
Deletes queued or finished Cloud Slicer jobs.
Request syntax:
Request parameters:
Pass the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
ids |
List |
Identifies one or more jobs by their system-defined IDs. |
Pass a digital signature based off of msg.
The response for a successful request contains the following parameter.
Name |
Data Type |
Description |
---|---|---|
actions |
List |
Contains a list of actions for each job defined in the request. Each action is described using the following syntax: |
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/delete', ids=['1234', 'd3345dbe5e064d09a20b762f7618839e'])) { "actions": [ [ "1234", "Not found" ], [ "d3345dbe5e064d09a20b762f7618839e", "deleted" ] ], "error": 0 }
Retrieves the details of an existing Cloud Slicer job.
Request syntax:
Request parameters:
Pass the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
id |
String |
Identifies a Cloud Slicer job by its system-defined ID. |
Pass a digital signature based off of msg.
The response for a successful request contains the following parameter.
Name |
Data Type |
Description |
---|---|---|
Dictionary |
Describes a Cloud Slicer job. |
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/get', id='0dce9166be404672a7dd0d28d7257587')) { "job": { "state": "waiting", "last_error": "", "args": { "trim": "5000,10000", "desc": "blarg" }, "attempts": 0, "source": { "url": "http://www.protoven.com/dave/edu/TomNgo_lo.mp4" }, "finished": 0, "last_start": 0, "owner": "a735c56ea4014685bc74c0a375236cc5", "progress": "", "id": "0dce9166be404672a7dd0d28d7257587" }, "error": 0 }
Retrieves a list of current and recent Cloud Slicer jobs.
Request syntax:
Request parameters:
Pass the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
limit |
Integer |
Determines the maximum number of jobs that will be returned. Maximum value: 50 |
skip |
Integer |
Determines the number of jobs that will be skipped. Use both skip and limit to paginate your results. |
Pass a digital signature based off of msg.
The response for a successful request contains the following parameter.
Name |
Data Type |
Description |
---|---|---|
jobs |
List of Dictionaries |
Contains a list of jobs. |
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/list', limit=3)) { "jobs": [ { "id": "d3345dbe5e064d09a20b762f7618839e", "attempts": 1, ... }, { "id": "aa85e5d009ae459d98b24a540ef5a0c7", "attempts": 3, ... }, { "id": "361f8426d36a4ac3af3348113489c83a", "attempts": 1, ... } ], "error": 0 }
Creates an asset from your media.
Similar to the Slicebot, the Cloud Slicer will take advantage of ttml and configuration file if they are provided alongside your content.
In this example, you have requested that the Cloud Slicer process the following URL:
Prior to processing, the Cloud Slicer will check for subtitles and configuration settings via the following URLs:
http://www.example.com/file.mp4.cfg
http://www.example.com/file.mp4.ttml
Request syntax:
Request parameters:
Pass the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
args |
Dictionary |
Contains Slicebot configuration settings that configure how the Cloud Slicer will process your media. |
source |
Dictionary |
Contains properties that identify the media that will be sliced. The Cloud Slicer may only process files that are smaller than 90 GBs. Please use a local slicer for larger files.
|
Pass a digital signature based off of msg.
The response for a successful request contains the following parameter.
Name |
Data Type |
Description |
---|---|---|
Dictionary |
Describes the Cloud Slicer job that was created. |
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/create', args=dict(trim='5000,10000', description='My file description'), source=dict(url='http://www.myserver.com/videos/test.mp4'))) { "job": { "state": "waiting", "last_error": "", "args": { "trim": "5000,10000", "desc": "My file description" }, "attempts": 0, "source": { "url": "http://www.myserver.com/videos/test.mp4" }, "finished": 0, "last_start": 0, "owner": "a735c56ea4014685bc74c0a375236cc5", "progress": "", "id": "0dce9166be404672a7dd0d28d7257587" }, "error": 0 }
A sample response when an invalid Slicer argument has been passed is provided below.
{ "job": {...}, "illegal_slicer_args": [ "bad_arg1", "bad_arg2" ], "error": 0 }
Invalid arguments are ignored. Your media will be processed without it.
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 syntax:
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. |
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]}
|
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. Where can I find an asset ID?
|
poster_ts |
Integer / String |
Identifies the frame from which a poster image will generated.
|
Pass a digital signature based off of msg.
The response for a successful request contains the following parameter.
Name |
Data Type |
Description |
---|---|---|
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.
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 }
Creates a job to export the specified asset as a downloadable MP4.
Request syntax:
Request parameters:
Pass the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
asset |
String |
Identifies the asset that will be exported by its asset ID. Where can I find an asset ID?
|
Pass a digital signature based off of msg.
The response for a successful request contains the following parameter.
Name |
Data Type |
Description |
---|---|---|
Dictionary |
Describes a Cloud Slicer job. |
Once an asset has been successfully exported, use the Get Cloud Slicer Job endpoint to find out the URL to the exported MP4 (hd_exported_url). If captions are present, a TTML file may be downloaded by appending .ttml to this URL.
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/create_export', asset='a29a0bf647454d70bbb9b13d6896a108')) { "job": { "state": "assigned", "last_error": "", "args": {"export_mp4": True}, "attempts": 0, "source": {}, "finished": 0, "asset": "a29a0bf647454d70bbb9b13d6896a108", "last_start": 0, "owner": "a735c56ea4014685bc74c0a375236cc5", "progress": "", "id": "d0d05debde654249ae25b1c7f45a19fe" }, "error": 0 } print(Call('/api2/cloudslicer/jobs/get', id='d0d05debde654249ae25b1c7f45a19fe')) { "job": { "state": "done", "last_error": "", "args": {"export_mp4": True}, "attempts": 1, "source": {}, "finished": 1488565621330, "hd_exported_url": "http://stg-ec-ore-u.uplynk.com/slices/5409e4c0c71444849ac6e07743ff20bd_g.mp4" "asset": "a29a0bf647454d70bbb9b13d6896a108", "last_start": 1488565611238, "owner": "a735c56ea4014685bc74c0a971238cc5", "progress": "Finished successfully", "id": "d0d05debde654249ae25b1c7f45a19fe" }, "error": 0 }
Cancels a Cloud Slicer job. Jobs that have already completed cannot be canceled.
Key information:
Request syntax:
Request parameters:
Pass the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
id |
String |
Identifies a Cloud Slicer job by its system-defined ID. |
Pass a digital signature based off of msg.
The response for a successful request contains the following parameter.
Name |
Data Type |
Description |
---|---|---|
Dictionary |
Describes the Cloud Slicer job that was cancelled. |
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/cancel', id='d3345dbe5e064d09a20b762f7618839e')) { "job": { "state": "cancelled", "last_error": "", "args": {"export_mp4": True}, "attempts": 0, "source": {}, "finished": 0, "asset": "a29a0bf647454d70bbb9b13d6896a108", "last_start": 0, "owner": "a735c56ea4014685bc74c0a375236cc5", "progress": "", "id": "d0d05debde654249ae25b1c7f45a19fe" }, "error": 0 }
View your libraries by clicking My Content from the Content tab.
Copies an asset from a library shared with your account to your CMS library. The following data will be copied from the original asset:
The asset copied to your account will be assigned a unique system-defined ID (i.e., GUID).
Request syntax:
Request parameters:
Pass the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
asset_id Required |
String |
Identifies the asset that will be copied by its asset ID. This asset must reside in a library shared with your account. Where can I find an asset ID?
|
Pass a digital signature based off of msg.
The response for a successful request contains the following parameter.
Name |
Data Type |
Description |
---|---|---|
Dictionary |
Describes a Cloud Slicer job. |
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/copy-from-library', asset_id='ae01164a50a04847b5624485aae1aac3')) { 'job' : { 'state' : 'waiting', 'last_error' : '', 'args' : {}, 'attempts' : 0, 'source' : { 'beam_id' : 'ae01164a50a04847b5624485aae1aac3' }, 'finished' : 0, 'asset' : None, 'last_start' : 0, 'owner' : 'a7231b9499a94e7a90e0438c6a136940', 'progress' : '', 'id' : 'a3b33c97e932443ea33bc44ab83abb33' }, 'error' : 0 }
View your libraries by clicking My Content from the Content tab.
Copies one or more assets from a library shared with your account to your CMS library. The following data will be copied from the original asset:
Each asset copied to your account will be assigned a unique system-defined ID (i.e., GUID).
Request syntax:
Request parameters:
Pass the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
asset_ids Required |
List |
Identifies one or more assets in a shared library that will be copied to your account. Each asset is identified by its asset IDThis unique ID identifies an asset. View this ID by navigating to the Content tab, selecting the desired asset, and then viewing the GUID option from the Details tab.. Where can I find an asset ID?
|
Pass a digital signature based off of msg.
The response for a successful request contains the following parameters.
Name |
Data Type |
Description |
---|---|---|
batch_id |
String |
Identifies the batch job by its system-defined ID. Pass this ID to the Get Batch Copy Status endpoint to find out the status of the batch copy job. |
error |
Integer |
Indicates whether an error occurred. |
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/batch/copy-from-library', asset_ids=['d0c403730ca14575a92f337ef71e0c5a', '30d0013d33d54b7c9354a339bfdc743c'])) { 'batch_id' : '63a304b482284968be49571adb6db661', 'error' : 0 }
Provides status information on a batch copy job.
Request syntax:
Request parameters:
Pass the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
id Required |
String |
Identifies a batch copy job by its system-defined ID. This ID was provided in the response to the Copy Assets endpoint. |
Pass a digital signature based off of msg.
The response for a successful request contains the following parameters.
Name |
Data Type |
Description |
---|---|---|
states |
Dictionary |
Indicates status information for each copy job in the batch. This parameter may contain one or more of the following lists: waiting | assigned | done | error | cancelled
Each list contains the asset IDThis unique ID identifies an asset. View this ID by navigating to the Content tab, selecting the desired asset, and then viewing the GUID option from the Details tab. for each asset in that state. |
error |
Integer |
Indicates whether an error occurred. |
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/batch/get-job-states', id='b3a304b482284968be49571adb6db521')) { 'states' : { 'done' : ['a0c403730ca14575a92f337ef71e0c5f', 'c0d0013d33d54b7c9354a339bfdc7434'] }, 'error' : 0 }
Adds up to 32 alternative audio tracks to an existing asset.
Request syntax:
Request parameters:
The set of required request parameters varies according to whether you plan on adding a single or multiple alternative audio tracks to an asset.
Add a single alternative audio track to an asset by passing the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
api_key |
String |
Amazon S3 (Private) Only Set this parameter if your audio track is stored in a private bucket on Amazon S3. Identifies your AWS access key. |
api_secret |
String |
Amazon S3 (Private) Only Set this parameter if your audio track is stored in a private bucket on Amazon S3. Identifies your AWS secret access key. |
asset Required |
String |
Identifies an asset by its asset ID or external ID. Asset ID Syntax: Asset ID
External ID Syntax: ext:External ID
Where can I find an asset ID?
Where can I find an asset's external ID?
|
desc Required |
String |
Indicates the alternative audio track's description (e.g., Spanish). |
dolby |
Number |
Determines whether to generate a Dolby Digital PlusDolby Digital Plus (DD+) - (aka E-AC-3 and EC-3). A digital audio compression standard. audio track. Valid values are:
Default value: 0
|
lang |
String |
Sets the language (e.g., en) for the track that will be added to the asset. Default value: en
|
url Required |
String |
Identifies a URL that points to the desired alternative audio track. HTTP URL Example: http://myserver.com/path/to/myfile.mp3
Amazon S3 (Private) URL syntax: s3://S3 Endpoint/Bucket/Key Name
Amazon S3 (Private) URL Example: s3://s3.eu-west-1.amazonaws.com/videos/nature.mp4
You should also set the api_key and api_secret parameters when adding an audio track using an Amazon S3 (private) URL. If your AWS S3 content is publicly accessible, then you should use an HTTP URL instead of an S3 URL. |
Add up to 32 alternative audio tracks to an asset by passing the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
asset Required |
String |
Identifies an asset by its asset ID or external ID. Asset ID Syntax: Asset ID
External ID Syntax: ext:External ID
Where can I find an asset ID?
Where can I find an asset's external ID?
|
source Required |
List of dictionaries |
Contains a list of the audio tracks that will be added to the asset. |
source List
The source list contains a dictionary for each audio track that will be added to the asset. Describe each audio track through the following properties:
Name |
Data Type |
Description |
---|---|---|
api_key |
String |
Amazon S3 (Private) Only Set this parameter if your audio track is stored in a private bucket on Amazon S3. Identifies your AWS access key. |
api_secret |
String |
Amazon S3 (Private) Only Set this parameter if your audio track is stored in a private bucket on Amazon S3. Identifies your AWS secret access key. |
desc Required |
String |
Indicates the alternative audio track's description (e.g., Spanish). |
dolby |
Number |
Determines whether to generate a Dolby Digital PlusDolby Digital Plus (DD+) - (aka E-AC-3 and EC-3). A digital audio compression standard. audio track. Valid values are:
Default value: 0
|
lang |
String |
Sets the language (e.g., en) for the track that will be added to the asset. Default value: en
|
url Required |
String |
Identifies a URL that points to the desired alternative audio track. HTTP URL Example: http://myserver.com/path/to/myfile.mp3
Amazon S3 (Private) URL syntax: s3://S3 Endpoint/Bucket/Key Name
Amazon S3 (Private) URL Example: s3://s3.eu-west-1.amazonaws.com/videos/nature.mp4
You should also set the api_key and api_secret parameters when adding an audio track using an Amazon S3 (private) URL. If your AWS S3 content is publicly accessible, then you should use an HTTP URL instead of an S3 URL. |
Pass a digital signature based off of msg.
The response for a successful request contains the following parameter.
Name |
Data Type |
Description |
---|---|---|
Dictionary |
Describes a Cloud Slicer job. |
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/add_track_audio', asset='0dce9166be404672a7dd0d28d7257587', desc='Spanish', url='https://storage.example.com/audio/widget-sales-101-spanish.mp3')) { 'job': { 'last_error': '', 'args': { 'url': 'http://storage.example.com/audio/widget-sales-101-spanish.mp3', 'track_desc': 'Spanish', 'dolby': 0 }, 'finished': 0, 'attempts': 0, 'source': {}, 'state': 'waiting', 'asset': '0dce9166be404672a7dd0d28d7257587', 'last_start': 0, 'owner': 'a735c56ea4014685bc74c0a375236cc5', 'progress': '', 'id': '1dce4166be303662a7dd0d28d7257533' }, 'error': 0 }
Adds a WebVTT track to an asset.
Key information:
Add up to 63 tracks to an asset.
You cannot add a track to an asset that is still being sliced.
Specify TTML data in the request or by providing a URL to it.
You may only add the first track from TTML data.
Request syntax:
Request parameters:
The set of request parameters varies according to whether you plan on adding a single or multiple WebVTT tracks to an asset.
Add a single WebVTT track to an asset by passing the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
api_key |
String |
Amazon S3 (Private) Only Set this parameter if your TTML file is stored in a private bucket on Amazon S3. Identifies your AWS access key. |
api_secret |
String |
Amazon S3 (Private) Only Set this parameter if your TTML file is stored in a private bucket on Amazon S3. Identifies your AWS secret access key. |
asset Required |
String |
Identifies an asset by its asset ID or external ID. Asset ID Syntax: Asset ID
External ID Syntax: ext:External ID
Where can I find an asset ID?
Where can I find an asset's external ID?
|
default_position |
String |
Determines the default horizontal text alignment for captions and subtitles when the sidecar TTML file does not define a horizontal text alignment (i.e., tts:textAlign). Valid values are: left | center | right
Default value: left
|
default_vertical |
String |
Determines the default vertical position for captions and subtitles when the sidecar TTML file does not define a vertical position (i.e., tts:origin). Valid values are: top | center | bottom
Default value: top
|
desc |
String |
Overrides the description (e.g., English) for the track that will be added to the asset. |
lang |
String |
Overrides the language (e.g., en) for the track that will be added to the asset. Learn how HLS and DASH handle language.
HLS uses the track's desc as NAME and lang as LANGUAGE. #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=NO,FORCED=NO,URI="...", LANGUAGE="en",AUTOSELECT=YES,CHARACTERISTICS="public.accessibility.transcribes-spoken-dialog"
If a desc is not provided, then it sets NAME to Unknown. NAME="Unknown"
DASH DASH identifies a track's language via lang: <AdaptationSet contentType="text" group="2" lang="en" mimeType="application/mp4" segmentAlignment="true">
A video player may look up language codes to provide friendlier labels. Default value: The default value when language has not been defined within TTML data is: en
Define language within TTML data via the following tag: <div xml:lang="en">
|
subtitle_absolute_time |
Integer |
Determines how timed text tracks (e.g., subtitles and closed captioning) are mapped to time. Valid values are:
Default Behavior: If this setting is missing, then timed text tracks will be mapped according to whether other tracks within this asset use the X-TIMESTAMP-MAP header or absolute time. |
ttml_data Required |
String |
You must specify either the ttml_url or ttml_data parameter. Contains Base64-encoded TTML data whose first track will be added to the asset. |
ttml_url Required |
String |
You must specify either the ttml_url or ttml_data parameter. Identifies a URL that points to the TTML file whose first track will be added to the asset. Amazon S3 (Private) If your TTML file is stored in a private bucket on Amazon S3, then you must:
If your AWS S3 content is publicly accessible, then you should use an HTTP URL instead of an S3 URL. |
Add multiple WebVTT tracks to an asset by passing the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
asset Required |
String |
Identifies an asset by its asset ID or external ID. Asset ID Syntax: Asset ID
External ID Syntax: ext:External ID
Where can I find an asset ID?
Where can I find an asset's external ID?
|
source Required |
List of dictionaries |
Contains a list of WebVTT tracks that will be added to the asset. |
source List
The source list contains a dictionary for each WebVTT track that will be added to the asset. Describe each WebVTT track through the following properties:
Name |
Data Type |
Description |
---|---|---|
api_key |
String |
Amazon S3 (Private) Only Set this parameter if your TTML file is stored in a private bucket on Amazon S3. Identifies your AWS access key. |
api_secret |
String |
Amazon S3 (Private) Only Set this parameter if your TTML file is stored in a private bucket on Amazon S3. Identifies your AWS secret access key. |
default_position |
String |
Determines the default horizontal text alignment for captions and subtitles when the sidecar TTML file does not define a horizontal text alignment (i.e., tts:textAlign). Valid values are: left | center | right
Default value: left
|
default_vertical |
String |
Determines the default vertical position for captions and subtitles when the sidecar TTML file does not define a vertical position (i.e., tts:origin). Valid values are: top | center | bottom
Default value: top
|
desc |
String |
Overrides the description (e.g., English) for the track that will be added to the asset. |
lang |
String |
Overrides the language (e.g., en) for the track that will be added to the asset. Learn how HLS and DASH handle language.
HLS uses the track's desc as NAME and lang as LANGUAGE. #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=NO,FORCED=NO,URI="...", LANGUAGE="en",AUTOSELECT=YES,CHARACTERISTICS="public.accessibility.transcribes-spoken-dialog"
If a desc is not provided, then it sets NAME to Unknown. NAME="Unknown"
DASH DASH identifies a track's language via lang: <AdaptationSet contentType="text" group="2" lang="en" mimeType="application/mp4" segmentAlignment="true">
A video player may look up language codes to provide friendlier labels. Default value: The default value when language has not been defined within TTML data is: en
Define language within TTML data via the following tag: <div xml:lang="en">
|
subtitle_absolute_time |
Integer |
Determines how timed text tracks (e.g., subtitles and closed captioning) are mapped to time. Valid values are:
Default Behavior: If this setting is missing, then timed text tracks will be mapped according to whether other tracks within this asset use the X-TIMESTAMP-MAP header or absolute time. |
ttml_data Required |
String |
You must specify either the ttml_url or ttml_data parameter. Contains Base64-encoded TTML data whose first track will be added to the asset. |
ttml_url Required |
String |
You must specify either the ttml_url or ttml_data parameter. Identifies a URL that points to the TTML file whose first track will be added to the asset. Amazon S3 (Private) If your TTML file is stored in a private bucket on Amazon S3, then you must:
If your AWS S3 content is publicly accessible, then you should use an HTTP URL instead of an S3 URL. |
Pass a digital signature based off of msg.
The response for a successful request contains the following parameter.
Name |
Data Type |
Description |
---|---|---|
Dictionary |
Describes the Cloud Slicer job that was created. |
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/add_track_vtt', asset='ae01164a50a04847b5624485aae1aac3', ttml_url='https://cdn.example.com/resources/ttml/m_campaign_23.ttml)) { 'job': { 'last_error': '', 'args': { 'add_track_num': 0, 'old_ranges': { 'ranges': [[92416, -1, 92416], ... [164736, -1, 164736]], 'full_slice_samples': 196608, 'break_durations': {} }, 'ttml_data': None, 'write_dash': 2, 'ttml_url': 'https://cdn.example.com/resources/ttml/m_campaign_23.ttml' }, 'finished': 0, 'attempts': 0, 'source': {}, 'state': 'waiting', 'asset': 'abb0000a6fe24c1f963e4dd51b37988e', 'last_start': 0, 'owner': 'cb233864a92b46a1a286cdd49b0a9bc8', 'progress': '', 'id': '7a04bd253c914eb496794f97a918da51' }, 'error': 0 }
Replaces an asset's track.
Key information:
Specify TTML data in the request or by providing a URL to it.
You may only add the first track from TTML data.
Request syntax:
Request parameters:
The set of request parameters varies according to whether you plan on replacing a single or multiple WebVTT tracks.
Replace a single WebVTT track by passing the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
api_key |
String |
Amazon S3 (Private) Only Set this parameter if your TTML file is stored in a private bucket on Amazon S3. Identifies your AWS access key. |
api_secret |
String |
Amazon S3 (Private) Only Set this parameter if your TTML file is stored in a private bucket on Amazon S3. Identifies your AWS secret access key. |
asset Required |
String |
Identifies an asset by its asset ID or external ID. Asset ID Syntax: Asset ID
External ID Syntax: ext:External ID
Where can I find an asset ID?
Where can I find an asset's external ID?
|
default_position |
String |
Determines the default horizontal text alignment for captions and subtitles when the sidecar TTML file does not define a horizontal text alignment (i.e., tts:textAlign). Valid values are: left | center | right
Default value: left
|
default_vertical |
String |
Determines the default vertical position for captions and subtitles when the sidecar TTML file does not define a vertical position (i.e., tts:origin). Valid values are: top | center | bottom
Default value: top
|
desc |
String |
Overrides the description (e.g., English) for the track that will be added to the asset. |
lang |
String |
Overrides the language (e.g., en) for the track that will be added to the asset. Learn how HLS and DASH handle language.
HLS uses the track's desc as NAME and lang as LANGUAGE. #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=NO,FORCED=NO,URI="...", LANGUAGE="en",AUTOSELECT=YES,CHARACTERISTICS="public.accessibility.transcribes-spoken-dialog"
If a desc is not provided, then it sets NAME to Unknown. NAME="Unknown"
DASH DASH identifies a track's language via lang: <AdaptationSet contentType="text" group="2" lang="en" mimeType="application/mp4" segmentAlignment="true">
A video player may look up language codes to provide friendlier labels. Default value: en
TTML may override this default value via the following tag: <div xml:lang="en">
|
subtitle_absolute_time |
Integer |
Determines how timed text tracks (e.g., subtitles and closed captioning) are mapped to time. Valid values are:
Default Behavior: If this setting is missing, then timed text tracks will be mapped according to whether the track being replaced uses the X-TIMESTAMP-MAP header or absolute time. |
track_num Required |
Integer |
Identifies the track that will be replaced using a zero-based index number. |
ttml_data Required |
String |
You must specify either the ttml_url or ttml_data parameter. Contains Base64-encoded TTML data whose first track will be added to the asset. |
ttml_url Required |
String |
You must specify either the ttml_url or ttml_data parameter. Identifies a URL that points to the TTML file whose first track will be added to the asset. Amazon S3 (Private) If your TTML file is stored in a private bucket on Amazon S3, then you must:
If your AWS S3 content is publicly accessible, then you should use an HTTP URL instead of an S3 URL. |
Replace multiple WebVTT tracks by passing the following parameters through the msg parameter:
Name |
Data Type |
Description |
---|---|---|
asset Required |
String |
Identifies an asset by its asset IDThis unique ID identifies an asset. View this ID by navigating to the Content tab, selecting the desired asset, and then viewing the GUID option from the Details tab.. Where can I find an asset ID?
|
source Required |
List of dictionaries |
Contains a list of WebVTT tracks that will replace existing tracks within the asset. |
source List
The source list contains a dictionary for each WebVTT track that will replace an existing track within an asset. Describe each WebVTT track through the following properties:
Name |
Data Type |
Description |
---|---|---|
api_key |
String |
Amazon S3 (Private) Only Set this parameter if your TTML file is stored in a private bucket on Amazon S3. Identifies your AWS access key. |
api_secret |
String |
Amazon S3 (Private) Only Set this parameter if your TTML file is stored in a private bucket on Amazon S3. Identifies your AWS secret access key. |
default_position |
String |
Determines the default horizontal text alignment for captions and subtitles when the sidecar TTML file does not define a horizontal text alignment (i.e., tts:textAlign). Valid values are: left | center | right
Default value: left
|
default_vertical |
String |
Determines the default vertical position for captions and subtitles when the sidecar TTML file does not define a vertical position (i.e., tts:origin). Valid values are: top | center | bottom
Default value: top
|
desc |
String |
Overrides the description (e.g., English) for the track that will be added to the asset. |
lang |
String |
Overrides the language (e.g., en) for the track that will be added to the asset. Learn how HLS and DASH handle language.
HLS uses the track's desc as NAME and lang as LANGUAGE. #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=NO,FORCED=NO,URI="...", LANGUAGE="en",AUTOSELECT=YES,CHARACTERISTICS="public.accessibility.transcribes-spoken-dialog"
If a desc is not provided, then it sets NAME to Unknown. NAME="Unknown"
DASH DASH identifies a track's language via lang: <AdaptationSet contentType="text" group="2" lang="en" mimeType="application/mp4" segmentAlignment="true">
A video player may look up language codes to provide friendlier labels. Default value: en
TTML may override this default value via the following tag: <div xml:lang="en">
|
subtitle_absolute_time |
Integer |
Determines how timed text tracks (e.g., subtitles and closed captioning) are mapped to time. Valid values are:
Default Behavior: If this setting is missing, then timed text tracks will be mapped according to whether the track being replaced uses the X-TIMESTAMP-MAP header or absolute time. |
track_num Required |
Integer |
Identifies the track that will be replaced using a zero-based index number. |
ttml_data Required |
String |
You must specify either the ttml_url or ttml_data parameter. Contains Base64-encoded TTML data whose first track will be added to the asset. |
ttml_url Required |
String |
You must specify either the ttml_url or ttml_data parameter. Identifies a URL that points to the TTML file whose first track will be added to the asset. Amazon S3 (Private) If your TTML file is stored in a private bucket on Amazon S3, then you must:
If your AWS S3 content is publicly accessible, then you should use an HTTP URL instead of an S3 URL. |
Pass a digital signature based off of msg.
The response for a successful request contains the following parameter.
Name |
Data Type |
Description |
---|---|---|
Dictionary |
Describes the Cloud Slicer job that was created. |
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/replace_track_vtt', asset='ae01164a50a04847b5624485aae1aac3', ttml_url='https://cdn.example.com/resources/ttml/m_campaign_23.ttml', track_num=0)) { 'job': { 'last_error': '', 'args': { 'add_track_num': 0, 'old_ranges': { 'ranges': [[92416, -1, 92416], ... [164736, -1, 164736]], 'full_slice_samples': 196608, 'break_durations': {} }, 'ttml_data': None, 'write_dash': 2, 'ttml_url': 'https://cdn.example.com/resources/ttml/m_campaign_23.ttml' }, 'finished': 0, 'attempts': 0, 'source': {}, 'state': 'waiting', 'asset': 'abb0000a6fe24c1f963e4dd51b37988e', 'last_start': 0, 'owner': 'cb233864a92b46a1a286cdd49b0a9bc8', 'progress': '', 'id': '535a7bc35e69413f945348cdc3381ae8' }, 'error': 0 }
The job dictionary describes a Cloud Slicer job via the following properties:
Name |
Type |
Description |
---|---|---|
args |
Dictionary |
Contains slicing parameters associated with this job. |
asset |
String |
Create Clip | Add WebVTT Track | Update WebVTT Track Indicates the asset IDThis unique ID identifies an asset. View this ID by navigating to the Content tab, selecting the desired asset, and then viewing the GUID option from the Details tab. for the clip that was created or for the asset to which a WebVTT track was added or replaced. |
attempts |
Integer |
Indicates the number of attempts to slice the media associated with the job. |
finished |
Integer |
Indicates the timestamp, in Unix time (milliseconds), at which the job reached either the done or error state. |
hd_exported_url |
String |
Export Asset Only Indicates the URL to the exported MP4 asset. If captions are present, download a TTML file by appending .ttml to this URL. |
id |
String |
Identifies the Cloud Slicer job by its system-defined ID. |
last_error |
String |
Provides the most recent error message. |
last_start |
Integer |
Indicates the timestamp, in Unix time (milliseconds), at which the job was most recently assigned to a Cloud Slicer. |
owner |
String |
Identifies the owner of this job by user IDA user ID uniquely identifies a user account via an alpanumeric system-defined ID.. |
progress |
String |
Describes the job's progress. |
source |
Dictionary |
Identifies the media associated with this job. |
state |
String |
Indicates the current state of the job. Valid values are: waiting | assigned | done | error | cancelled
|
Track a job's current progress via one of the following statuses:
Upon creating a job, it enters the waiting state. It will remain in that state until it is assigned a Cloud Slicer. At which point, it will be in the assigned state while the Cloud Slicer processes the job. If the job is successful, it enters the done state. Otherwise, it is moved back to the waiting state in order to allow another attempt to process it. If the job cannot be processed after several attempts, it will enter the error state. This life cycle is illustrated below.
Cancel a job at any time via the Cancel Cloud Slicer Job endpoint. This will update the job's state to cancelled. If a Cloud Slicer was currently slicing content for that job, then it will stop within 10 seconds. If the job was in the waiting state, then it will not be processed.
Use the Delete Cloud Slicer Job endpoint to delete a job in the waiting, done, cancelled, or error state. Jobs in the assigned state cannot be deleted.
The system will automatically erase a job 72 hours after its completion (i.e,. done, cancelled, or error).