tencent cloud

媒体处理

CreateSchedule

Download
聚焦模式
字号
最后更新时间: 2026-08-14 16:33:21

1. API Description

Domain name for API request: mps.intl.tencentcloudapi.com.

This API is used to set processing rules for uploaded media files under the directory of a specified Bucket in COS, including:

  1. Video transcoding (watermarked);
  2. Video-to-GIF conversion;
  3. Screenshot taking at specified time points;
  4. Sampled screenshot taking;
  5. Sprite screenshot taking;
  6. Transcoding to adaptive bitrate streaming;
  7. Intelligent content moderation (porn detection and sensitive information detection);
  8. Intelligent content analysis (tag, category, cover, frame tag).
  9. Intelligent content identification (human face, full text, text keyword, full speech, speech keyword).
  10. Media quality inspection (live stream format diagnosis, audio and video content detection (jitter, blur, low light, overexposure, black and white edges, black and white screens, screen glitch, noise, mosaic, QR code, and more), and no-reference scoring).
  11. Smart subtitle (full speech, speech hotword, and speech translation).
  12. Smart erasing (watermark removal, subtitle removal, and privacy protection).

Note: After orchestration is created successfully, it is in disable status and needs to be manually enabled.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateSchedule.
Version Yes String Common Params. The value used for this API: 2019-06-12.
Region No String Common Params. This parameter is not required for this API.
ScheduleName Yes String Orchestration name, up to 128 characters. The name is unique for the same user.
Trigger Yes WorkflowTrigger Orchestrate the bound trigger rule. The orchestration is triggered when an uploaded video hits the rule for the object.
Activities.N Yes Array of Activity Orchestration task list.
OutputStorage No TaskOutputStorage Media Processing Service output storage location. If left blank, it inherits the storage location from Trigger.
OutputDir No String Storage directory for the output file. It should start and end with a slash (/), such as /movie/201907/.
If left empty, it is the same as the directory of the trigger file.
TaskNotifyConfig No TaskNotifyConfig Event notification configuration of the task. If left blank, it indicates that no event notification will be obtained.
ResourceId No String Resource ID. Ensure that the corresponding resource is enabled. The default value is the primary resource ID of the account.

3. Output Parameters

Parameter Name Type Description
ScheduleId Integer Orchestration ID.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Setting a Transcoding Rule

This example shows you how to create an orchestration for the Bucket named evan-test-1300828900. When an mp4 or flv file is uploaded to the /input/ directory, it triggers multiple transcoding tasks with the transcoding template ID 10.

Input Example

POST / HTTP/1.1
Host: mps.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateSchedule
<Common request parameters>

{
    "ScheduleName": "evan_test7",
    "Trigger": {
        "Type": "CosFileUpload",
        "CosFileUploadTrigger": {
            "Bucket": "evan-test-1300828900",
            "Region": "ap-guangzhou",
            "Dir": "/input/",
            "Formats": [
                "mp4",
                "flv"
            ]
        }
    },
    "Activities": [
        {
            "ActivityType": "input",
            "ReardriveIndex": [
                1,
                2
            ]
        },
        {
            "ActivityType": "action-trans",
            "ReardriveIndex": [
                3
            ],
            "ActivityPara": {
                "TranscodeTask": {
                    "Definition": 10
                }
            }
        },
        {
            "ActivityType": "action-trans",
            "ReardriveIndex": [
                6,
                7
            ],
            "ActivityPara": {
                "TranscodeTask": {
                    "Definition": 10
                }
            }
        },
        {
            "ActivityType": "action-trans",
            "ReardriveIndex": [
                4,
                5
            ],
            "ActivityPara": {
                "TranscodeTask": {
                    "Definition": 10
                }
            }
        },
        {
            "ActivityType": "action-trans",
            "ReardriveIndex": [
                10
            ],
            "ActivityPara": {
                "TranscodeTask": {
                    "Definition": 10
                }
            }
        },
        {
            "ActivityType": "action-trans",
            "ReardriveIndex": [
                10
            ],
            "ActivityPara": {
                "TranscodeTask": {
                    "Definition": 10
                }
            }
        },
        {
            "ActivityType": "action-trans",
            "ReardriveIndex": [
                10
            ],
            "ActivityPara": {
                "TranscodeTask": {
                    "Definition": 10
                }
            }
        },
        {
            "ActivityType": "action-trans",
            "ReardriveIndex": [
                8
            ],
            "ActivityPara": {
                "TranscodeTask": {
                    "Definition": 10
                }
            }
        },
        {
            "ActivityType": "action-trans",
            "ReardriveIndex": [
                9
            ],
            "ActivityPara": {
                "TranscodeTask": {
                    "Definition": 10
                }
            }
        },
        {
            "ActivityType": "action-trans",
            "ReardriveIndex": [
                10
            ],
            "ActivityPara": {
                "TranscodeTask": {
                    "Definition": 10
                }
            }
        },
        {
            "ActivityType": "output",
            "ActivityPara": {}
        }
    ],
    "OutputStorage": {
        "Type": "COS",
        "CosOutputStorage": {
            "Bucket": "evan-test-1300828900",
            "Region": "ap-nanjing"
        }
    },
    "OutputDir": "output/"
}

Output Example

{
    "Response": {
        "RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
        "ScheduleId": 157482
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.CosStatusInavlid Operation failed: COS service is suspended.
FailedOperation.GenerateResource Resource generation failed.
FailedOperation.InvalidMpsUser Operation failed: unauthorized MPS user.
InternalError Internal error.
InternalError.AccessDBError Data error.
InternalError.GenDefinition Internal error: failed to generate template ID.
InvalidParameterValue Incorrect parameter value.
LimitExceeded.TooMuchTemplate Limit reached: the number of templates exceeds the limit.
ResourceNotFound.CosBucketNameInvalid The resource does not exist: invalid COS bucket name.
ResourceNotFound.CosBucketNotExist The resource does not exist: the COS bucket does not exist.

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈