Domain name for API request: vod.intl.tencentcloudapi.com.
This API is used to initiate processing tasks for audio-video media in on-demand video, with features including:
If you use event notification, the event notification type is task flow status change (https://www.tencentcloud.com/document/product/266/9636?from_cn_redirect=1).
A maximum of 200 requests can be initiated per second for this API.
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: ProcessMedia. |
| Version | Yes | String | Common Params. The value used for this API: 2018-07-17. |
| Region | No | String | Common Params. This parameter is not required. |
| FileId | No | String | Media file ID, the globally unique identifier of the file in VOD, is assigned by the VOD backend after a successful upload. You can get this field in the video upload completion event notification or the VOD console. |
| MediaStoragePath | No | String | Storage path of the media. |
| SubAppId | No | Integer | Video-on-demand (VOD) application ID. Customers who activate on-demand services from December 25, 2023 must fill this field with the app ID to access resources in on-demand applications (whether default or newly created application). |
| MediaProcessTask | No | MediaProcessTaskInput | Parameters for the video processing type task. |
| AiContentReviewTask | No | AiContentReviewTaskInput | Audio and video content review type task parameters. |
| AiAnalysisTask | No | AiAnalysisTaskInput | Parameters for the audio and video content analysis task. |
| AiRecognitionTask | No | AiRecognitionTaskInput | Parameters for the audio/video content recognition task. |
| TasksPriority | No | Integer | Priority of the task flow. The higher the value, the higher the priority. The value ranges from -10 to 10. If this is not specified, it represents 0. |
| TasksNotifyMode | No | String | Task flow status change notification mode. Valid values are Finish, Change, and None. If this is not specified, the default value is Finish. |
| SessionContext | No | String | Source context. This is used to pass user request information. The task status change callback returns the value of this field. The maximum length is 1000 characters. |
| SessionId | No | String | Identifier for deduplication. If a request with the same identifier has been sent within the past three days, an error is returned for the current request. The maximum length is 50 characters. If this is not specified or left empty, deduplication is not performed. |
| ExtInfo | No | String | Reserved field, used when special purpose. |
| Url | No | String | Valid when FileID is empty. Pull the Url to generate new media assets and generate a new FileID. The media processing product will be affiliated with the new media assets. Note: Storage fees will occur for new media assets. |
| Parameter Name | Type | Description |
|---|---|---|
| TaskId | String | Task 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. |
Trigger a content recognition task (including face recognition) for the video with file path /dir/video.mp4. The template ID used for content recognition is 10.
POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ProcessMedia
<Common request parameters>
{
"AiRecognitionTask": {
"Definition": 10
},
"MediaStoragePath": "/dir/video.mp4"
}
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc70006fje1",
"TaskId": "125xxx65-procedurev2-bffb15f07586237bcecodb01fac7kdabc"
}
}
Initiate a content review task for the video with fileId 5285485487985271487 (offensive content, unsafe information, inappropriate information), using content review template ID 10.
POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ProcessMedia
<Common request parameters>
{
"AiContentReviewTask": {
"Definition": 10
},
"FileId": "5285485487985271487"
}
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"TaskId": "125xxx65-procedurev2-bffb15f07530b57bc1aabb01fac74bca"
}
}
Trigger a content recognition task (including face recognition) for the video with fileId 5285485487985271487. The template ID used for content recognition is 10.
POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ProcessMedia
<Common request parameters>
{
"AiRecognitionTask": {
"Definition": 10
},
"FileId": "5285485487985271487"
}
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc70006fje1",
"TaskId": "125xxx65-procedurev2-bffb15f07586237bcecodb01fac7kdabc"
}
}
Initiate a transcoding task for the video with fileId 5285485487985271487, transfer three specifications, and the transcoding template IDs used are 20, 30, and 40, respectively. All transcoded videos are watermarked with template ID 15780.
POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ProcessMedia
<Common request parameters>
{
"MediaProcessTask": {
"TranscodeTaskSet": [
{
"Definition": 30,
"WatermarkSet": [
{
"Definition": 15780
}
]
},
{
"Definition": 20,
"WatermarkSet": [
{
"Definition": 15780
}
]
},
{
"Definition": 40,
"WatermarkSet": [
{
"Definition": 15780
}
]
}
]
},
"FileId": "5285485487985271487"
}
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"TaskId": "125xxx65-procedurev2-bffb15f07530b57bc1aabb01fac74bca"
}
}
Trigger a content analysis task for the video with fileId 5285485487985271487, including intelligent classification, intelligent tag and intelligent cover. The template ID used for content analysis is 10.
POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ProcessMedia
<Common request parameters>
{
"AiAnalysisTask": {
"Definition": 10
},
"FileId": "5285485487985271487"
}
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"TaskId": "125xxx65-procedurev2-bffb15f07586237bcecodb01fac7kdikk"
}
}
Initiate a transcoding task for the video with fileId 5285485487985271487, transfer three specifications, and the transcoding template IDs used are 20, 30, and 40.
POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ProcessMedia
<Common request parameters>
{
"MediaProcessTask": {
"TranscodeTaskSet": [
{
"Definition": 30
},
{
"Definition": 20
},
{
"Definition": 40
}
]
},
"FileId": "5285485487985271487"
}
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"TaskId": "125xxx65-procedurev2-bffb15f07530b57bc1aabb01fac74bca"
}
}
Initiate a transcoding task for the video with fileId 5285485487985271487, transfer three specifications, and the transcoding template IDs used are 20, 30, and 40. Meanwhile, perform sampling screenshot taking for the video, and the template ID used is 10.
POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ProcessMedia
<Common request parameters>
{
"MediaProcessTask": {
"TranscodeTaskSet": [
{
"Definition": 30
},
{
"Definition": 20
},
{
"Definition": 40
}
],
"SampleSnapshotTaskSet": [
{
"Definition": 10
}
]
},
"FileId": "5285485487985271487"
}
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"TaskId": "125xxx65-procedurev2-bffb15f07530b57bc1aabb01fac74bca"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
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 | Operation failed. |
| FailedOperation.InvalidVodUser | The VOD service is not activated. |
| FailedOperation.NoNeedToReduceMediaBitrate | No need to reduce the bitrate. |
| FailedOperation.TaskDuplicate | Operation failed: the task already exists. |
| InternalError | Internal error. |
| InvalidParameter | Parameter error. |
| InvalidParameterValue | Parameter value error. |
| InvalidParameterValue.AiAnalysisTaskDefinition | Incorrect parameter value: Definition for AI-based analysis. |
| InvalidParameterValue.AiContentReviewTaskDefinition | Incorrect parameter value: Definition AI-based content audit. |
| InvalidParameterValue.AiRecognitionTaskDefinition | Incorrect parameter value: Definition for AI-based recognition. |
| InvalidParameterValue.FileId | The FileId does not exist. |
| InvalidParameterValue.SessionContextTooLong | SessionContext is too long. |
| InvalidParameterValue.SessionId | The deduplication ID already exists. The request is removed due to duplication. |
| InvalidParameterValue.SessionIdTooLong | SessionId is too long. |
| InvalidParameterValue.SubAppId | Incorrect parameter value: application id. |
| UnauthorizedOperation | Unauthorized operation. |
フィードバック