Domain name for API request: vod.intl.tencentcloudapi.com.
This API is used to initiate processing tasks for audio-video media in VOD, with features including:
If event notification is used, its 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 on VOD, assigned by the VOD backend after successful upload. You can obtain this field in 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. For customers who activate on-demand services from December 25, 2023, if they access resources in on-demand applications (whether the default application or a newly created application), this field must be filled in as the app ID. |
| MediaProcessTask | No | MediaProcessTaskInput | Video processing type task parameters. |
| 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 | Audio/video content recognition type task parameter. |
| TasksPriority | No | Integer | Priority of the task flow. The higher the value, the higher the priority. The value range is from -10 to 10. If this is not specified, the default value is 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 for special purposes. |
| Url | No | String | Valid when FileID is empty. Pull the Url to generate a new media asset and a new FileID. Media processing products will be affiliated products of the new media asset. Note: Storage fees will occur for the new media asset. |
| OutputAsIndependentMedia | No | String | The media processing transcoding result is output as standalone media assets. Enabling this option will output the product as standalone media assets and generate a brand new FileID. Currently, only TranscodeTask transcoding task output is supported as standalone media assets. Enumeration values:
Default value: OFF Note: New media assets will incur storage fees. This option does not currently support enabling for video opening/closing credits, traceable watermarks, and other features in transcoding tasks. |
| 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. |
This example shows you how to initiate a content recognition task for a video with the file path /dir/video.mp4, including face recognition, using template ID 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, unsafe, and 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"
}
}
This example shows you how to initiate a content recognition task for a video with the file ID 5285485487985271487, including face recognition, using template ID 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"
}
}
This example shows you how to initiate a transcoding task for the video with fileId 5285485487985271487, transfer three specifications using transcoding template IDs 20, 30, and 40, and add a watermark to all transcoded videos with the watermark 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 categorization, 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"
}
}
This example shows you how to initiate a transcoding task for a video with fileId 5285485487985271487, transfer three specifications, and the transcoding template IDs used are 20, 30, and 40, respectively.
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 to transfer three specifications. The transcoding template IDs used are 20, 30, and 40, respectively. At the same time, take sampled screenshots of the video using the sampled screenshot template ID 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 for bitrate reduction. |
| FailedOperation.TaskDuplicate | Operation failed: duplicate task. |
| InternalError | Internal error. |
| InvalidParameter | Parameter error. |
| InvalidParameterValue | Parameter value error. |
| InvalidParameterValue.AiAnalysisTaskDefinition | Parameter value error: AI analysis Definition. |
| InvalidParameterValue.AiContentReviewTaskDefinition | Parameter value error: AI content review Definition. |
| InvalidParameterValue.AiRecognitionTaskDefinition | Parameter value error: AI recognition Definition. |
| InvalidParameterValue.FileId | FileId does not exist. |
| InvalidParameterValue.SessionContextTooLong | SessionContext is too long. |
| InvalidParameterValue.SessionId | Duplicate recognition code. Request deduplicated. |
| InvalidParameterValue.SessionIdTooLong | SessionId is too long. |
| InvalidParameterValue.SubAppId | Parameter value error: app ID. |
| UnauthorizedOperation | Unauthorized operation. |
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan