tencent cloud

Submitting Tasks
Last updated: 2025-11-19 10:59:04
Submitting Tasks
Last updated: 2025-11-19 10:59:04

Feature Description

Submit a video splitting task.

Authorization Description

When using with a sub-account, the ci:CreateMediaJobs permission is required. For details, see Cloud Infinite action.
When a sub-account uses an asynchronous processing interface, the cam:passrole permission is required. The asynchronous processing interface performs read and write operations on COS resources through the "role" in CAM. The PassRole permission is used for role passing. For details, refer to Access Management > Write Operations > PassRole API.

Activating a Service

Using this feature requires enabling Cloud Infinite in advance and binding a bucket. For details, see Bind bucket.
Use this feature requires enabling Media Processing Service in advance via console or API. For details, see Enable Media Processing Service.

Use Limits

When using this API, please first confirm the relevant restrictions. For details, see Usage Limits.

Fee Description

This API is a paid service. The incurred fees will be collected by Cloud Infinite. For detailed billing instructions, see Media Processing Fees.


Request

Request sample

POST /jobs HTTP/1.1
Host: <BucketName-APPID>.ci.<Region>.myqcloud.com
Date: <GMT Date>
Authorization: <Auth String>
Content-Length: <length>
Content-Type: application/xml

<body>
Note:
Authorization: Auth String. For details, see the Request Signature document.

Request header.

This API only uses common request headers. For details, see Common Request Headers documentation.

Request body.

The implementation of this request operation requires the following request body.
<Request>
<Tag>SplitVideoParts</Tag>
<Input>
<Object>input/test.mp4</Object>
</Input>
<Operation>
<SplitVideoParts>
<Mode>SHOTDETECT</Mode>
</SplitVideoParts>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
<CallBack>http://callback.demo.com</CallBack>
<CallBackFormat>JSON</CallBackFormat>
</Request>
The data are described as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
Request
None.
Container for saving requests
Container
Yes
The specific data description of the Request Container type is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
Tag
Request
Create task Tag: SplitVideoParts
String
Yes
Input
Request
Object information to be operated
Container
Yes
Operation
Request
Operation rule
Container
Yes
CallBackFormat
Request
job callback format, JSON or XML, default XML, priority is higher than the callback format of the queue
String
No
CallBackType
Request
job callback type, Url or TDMQ, default Url, priority is higher than the callback type of the queue
String
No
CallBack
Request
job callback address, priority is higher than the callback address of the queue. When set to no, it indicates that the callback address of the queue does not generate a callback.
String
No
CallBackMqConfig
Request
Task callback TDMQ configuration, required when CallBackType is TDMQ. For details, see CallBackMqConfig.
Container
No
The specific data description of the Input Container type is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
Object
Request.Input
file path
String
Yes
The specific data description of the
Operation
Container type is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
SplitVideoParts
Request.Operation
Video splitting configuration
Container
Yes
UserData
Request.Operation
Pass through user information, printable ASCII code, length not exceeding 1024
String
No
JobLevel
Request.Operation
Task priority, level limit: 0, 1, 2. Higher level means higher task priority, default is 0.
String
No
The specific data description of the SplitVideoParts Container type is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required or Not
Mode
Request.Operation.SplitVideoParts
Split mode, currently supports SHOTDETECT (shot-based splitting) and SCENEDETECT (scene-based splitting).
String
Yes

Response

Response Headers

This API only returns the public response header. For details, see Common Response Headers documentation.

Response Body

The response body is returned as application/xml. An example including the complete node data is shown below:
<Response>
<JobsDetail>
<Code>Success</Code>
<Message/>
<JobId>ac7c990a00bf211ed946af9e0691f2b7a</JobId>
<State>Submitted</State>
<CreationTime>2022-06-27T14:44:10+0800</CreationTime>
<StartTime>-</StartTime>
<EndTime>-</EndTime>
<QueueId>pcd463e1467964d39ad2d3f66aacd8199</QueueId>
<Tag>SplitVideoParts</Tag>
<Input>
<BucketId>test-123456789</BucketId>
<Object>input/test.mp4</Object>
<Region>ap-chongqing</Region>
</Input>
<Operation>
<SplitVideoParts>
<Mode>SHOTDETECT</Mode>
</SplitVideoParts>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
</JobsDetail>
</Response>
The data are as follows:
Node Name (Keyword)
Parent Node
Description
Type
Response
None.
Container for saving results
Container
Container node Response content:
Node Name (Keyword)
Parent Node
Description
Type
JobsDetail
Response
Task details
Container array
The content of Container node
JobsDetail
:
Node Name (Keyword)
Parent Node
Description
Type
Code
Response.JobsDetail
error code, meaningful only when State is Failed
String
Message
Response.JobsDetail
error description, meaningful only when State is Failed
String
JobId
Response.JobsDetail
ID of the newly created task
String
Tag
Response.JobsDetail
Newly created task Tag: SplitVideoParts
String
State
Response.JobsDetail
Task Status
Submitted: Submitted, pending execution
Running: Executing
Success: Execution successful
Failed: Execution failed
Pause: Task is paused. When the pause queue is triggered, pending tasks will become paused state.
Cancel: Task execution cancelled
String
CreationTime
Response.JobsDetail
Task creation time
String
StartTime
Response.JobsDetail
Task Start Time
String
EndTime
Response.JobsDetail
Task End Time
String
QueueId
Response.JobsDetail
Task's Queue ID
String
Input
Response.JobsDetail
Request.Input node in the same request
Container
Operation
Response.JobsDetail
Rules of the task
Container
Container node Operation content:
Node Name (Keyword)
Parent Node
Description
Type
SplitVideoParts
Response.JobsDetail.Operation
Request.Operation.SplitVideoParts in the same request
Container
UserData
Response.JobsDetail.Operation
Pass through user information
String
JobLevel
Response.JobsDetail.Operation
Task Priority
String
SplitVideoInfoResult
Response.JobsDetail.Operation
Output the split information, do not return if the task is not completed.
Container
Container node SplitVideoInfoResult content:
Node Name (Keyword)
Parent Node
Description
Type
TimeInfo
Response.JobsDetail.Operation.SplitVideoInfoResult
Details of each fragment
Container array
Container node TimeInfo content:
Node Name (Keyword)
Parent Node
Description
Type
Index
Response.JobsDetail.Operation.SplitVideoInfoResult.TimeInfo
Fragment index
String
PartBegin
Response.JobsDetail.Operation.SplitVideoInfoResult.TimeInfo
Segment start time
String
PartEnd
Response.JobsDetail.Operation.SplitVideoInfoResult.TimeInfo
Segment end time
String

Error Codes

This request returns common error responses and error codes. For more information, see Error Codes.

Examples

Request

POST /jobs HTTP/1.1
Authorization: q-sign-algorithm=sha1&q-ak=**********************************&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=**************************************
Host: test-1234567890.ci.ap-beijing.myqcloud.com
Content-Length: 166
Content-Type: application/xml

<Request>
<Tag>SplitVideoParts</Tag>
<Input>
<Object>input/test.mp4</Object>
</Input>
<Operation>
<SplitVideoParts>
<Mode>SHOTDETECT</Mode>
</SplitVideoParts>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
<CallBack>http://callback.demo.com</CallBack>
<CallBackFormat>JSON</CallBackFormat>
</Request>

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 230
Connection: keep-alive
Date: Mon, 28 Jun 2022 15:23:12 GMT
Server: tencent-ci
x-ci-request-id: NTk0MjdmODlfMjQ4OGY3XzYzYzhf****

<Response>
<JobsDetail>
<Code>Success</Code>
<Message/>
<JobId>ac7c990a00bf211ed946af9e0691f2b7a</JobId>
<State>Submitted</State>
<CreationTime>2022-06-27T14:44:10+0800</CreationTime>
<StartTime>-</StartTime>
<EndTime>-</EndTime>
<QueueId>pcd463e1467964d39ad2d3f66aacd8199</QueueId>
<Tag>SplitVideoParts</Tag>
<Input>
<BucketId>test-123456789</BucketId>
<Object>input/test.mp4</Object>
<Region>ap-chongqing</Region>
</Input>
<Operation>
<SplitVideoParts>
<Mode>SHOTDETECT</Mode>
</SplitVideoParts>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
</JobsDetail>
</Response>

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback