Creating a Clipping Task
Function
Creates a clip task on media files to generate a new file.
Scenarios:
Ensure that an input media file is stored in an OBS bucket in the same region as MPC and the permission for accessing the OBS bucket has been granted to MPC.
Note: This function does not support OpenGOP sources.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
mpc:editingTask:create
Write
-
-
-
-
URI
POST /v2/{project_id}/editing/jobs
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | No | String | User token The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
| Authorization | No | String | Authentication information. This parameter is mandatory when AK/SK-based authentication is used. |
| X-Project_Id | No | String | Project ID. This parameter is mandatory when AK/SK-based authentication is used. It is same as the project ID in path parameters. |
| X-Sdk-Date | No | String | Time when the request is sent. This parameter is mandatory when AK/SK-based authentication is used. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| inputs | No | Array of EditingInput objects | Specifies multiple clipping segments of the source. |
| output | No | ObsObjInfo object | Output address |
| editing_settings | No | EditingSetting object | Media processing configuration to process the source files specified in input parameters. |
| metadata | No | Array of FileMetaData objects | Metadata setting. By default, only AIGC is supported. |
| user_data | No | String | User customized data |
| editing_type | No | Integer | Clipping type. You are advised to set this parameter to 1. If this parameter is set to 0, the performance and clipping capability do not meet the commercial use conditions. Options:
|
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| input | Yes | ObsObjInfo object | Input file storage location |
| timeline_start | No | String | Clipping start time, in seconds. |
| timeline_end | No | String | Clipping end time, in seconds. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| X-Request-Id | String | This field indicates the unique request identifier used for tracing task process. Format: request_id(uuid)-timestamp-hostname |
| Parameter | Type | Description |
|---|---|---|
| job_id | String | Task ID generated after a task is accepted |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| X-Request-Id | String | This field indicates the unique request identifier used for tracing task process. Format: request_id(uuid)-timestamp-hostname |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code |
| error_msg | String | Error description |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| X-Request-Id | String | This field indicates the unique request identifier used for tracing task process. Format: request_id(uuid)-timestamp-hostname |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code |
| error_msg | String | Error description |
Example Requests
Creates a clip task on media files to generate a new file.
POST https://{endpoint}/v2/{project_id}/editing
{
"inputs" : [ {
"input" : {
"bucket" : "example-bucket",
"location" : "region01",
"object" : "example-path/input.ts"
},
"timeline_start" : "0",
"timeline_end" : "10"
}, {
"input" : {
"bucket" : "example-bucket",
"location" : "region01",
"object" : "example-path/input.ts"
},
"timeline_start" : "30",
"timeline_end" : "40"
}, {
"input" : {
"bucket" : "example-bucket",
"location" : "region01",
"object" : "example-path/input.ts"
},
"timeline_start" : "50",
"timeline_end" : "0"
} ],
"output" : {
"bucket" : "example-bucket",
"location" : "region01",
"object" : "example-path/output",
"file_name" : "output.m3u8"
},
"editing_settings" : {
"resolution_adaptation" : "OPEN",
"reference" : "MAX_RESOLUTION",
"format" : "HLS",
"width" : 0,
"height" : 720
},
"user_data" : "example_user_data"
} Example Responses
None
Status Codes
| Status Code | Description |
|---|---|
| 200 | The clipping task has been created. |
| 400 | Create the clipping task failed or request the parameter verification failed. |
| 500 | Internal server error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot